We report the publication of treams, a new software for electromagnetic scattering computations based on the T-matrix method. Besides conventional T-matrix calculations for individual scatterers and finite clusters of particles, a unique feature of the code is its full support for periodic boundaries in one, two, and all three spatial dimensions. We use highly efficient and quickly converging lattice summation techniques based on the Ewald method to evaluate the arising lattice sums in these cases. In addition to the common use of vector spherical waves as a basis set for the T-matrix, vector cylindrical waves are also implemented. To describe stratified media, vector plane waves are used with an S-matrix description of the electromagnetic scattering. All basis sets and the associated methods can be used together with chiral constitutive relations. Thereby, chiral embedding media are supported, as well as scatterers made from chiral materials.This contribution outlines the basic methods implemented and the program structure. Two interfaces to the implemented functionality are available: a flexible and fast low-level interface and a high-level interface for added convenience and plausibility checks. We conclude with two examples: a demonstration of the field calculation in various lattices and the explorations of quasi-bound states in the continuum. The presented code was already used in calculations for various physical systems: from the mode properties of molecular arrays in cavities to analytical models for metasurfaces and from moiré lattices to the homogenization of artificial photonic materials. With the publication of treams and the associated documentation, we hope to empower more scientists to make an efficient, fast, and precise exploration of nanophotonic systems that can be described in the broader framework of scattering theory. Program summaryProgram title: treamsCPC Library link to program files:https://doi.org/10.17632/2np8snmzfx.1Developer's repository link:https://github.com/tfp-photonics/treamsLicensing provisions: MITProgramming language: Python and CythonNature of problem: Simulating electromagnetic scattering in periodic nanophotonic structures, when different length scales are present or for large parameter sweeps, require specialized tools that can solve Maxwell's equations more efficiently than general-purpose solvers. A possible tool for these computations is the T-matrix method, which needs to be amended by suitable lattice summation schemes in the presence of periodic boundary conditions.Solution method: The properties of the individual scatterers are described by T-matrices, such that the interaction can be solved analytically. The slowly converging lattice sums that appear in the presence of periodic boundary conditions are computed by converting them to two quickly converging series using Ewald's method. Depending on the lattice dimensions and the geometry of the scatterers, vector spherical, cylindrical, or plane waves are used. Using modes of well-defined helicity enables the straightforward inclusion of chiral material parameters for scatterers and embedding media.