---
name: lammpsio
description: Use when importing `lammpsio`, reading/writing LAMMPS data/dump files, or converting between LAMMPS and GSD formats.
---

# lammpsio

Pure Python package for reading and writing LAMMPS data and dump files, with optional HOOMD-blue GSD interconversion. Version 0.9.0. All indexes follow the LAMMPS 1-indexed convention. Per-particle arrays use lazy initialization — accessing a property allocates it; use `has_*()` methods to check without allocating.

## Quick Start

```bash
pip install lammpsio
# or: conda install -c conda-forge lammpsio
```

```python
import lammpsio

# Read a data file
snap = lammpsio.DataFile("atoms.data").read()

# Write a data file
lammpsio.DataFile.create("atoms.data", snapshot)

# Iterate a dump file
for snap in lammpsio.DumpFile("trajectory.lammpstrj"):
    print(snap.step, snap.N)
```

See `references/api_reference.md` for complete documentation of `Box`, `Snapshot`, `DataFile`, `DumpFile`, `Topology` classes, and `LabelMap`.
