Metadata-Version: 2.4
Name: pylamda
Version: 0.2.0
Summary: Work with and work on molecular line data in the LAMDA format.
License-Expression: MIT
License-File: LICENSE
Keywords: LAMDA,RADEX,EMAA,NLTE,collision rates,Einstein A,molecular data,astrophysics
Author: Christian Rab
Requires-Python: >=3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Provides-Extra: dev
Provides-Extra: plot
Requires-Dist: matplotlib (>=3.8) ; extra == "dev"
Requires-Dist: matplotlib (>=3.8) ; extra == "plot"
Requires-Dist: myst-parser (>=4.0) ; extra == "dev"
Requires-Dist: numpy (>=1.26)
Requires-Dist: pytest (>=8) ; extra == "dev"
Requires-Dist: pytest-cov (>=5) ; extra == "dev"
Requires-Dist: requests (>=2.31)
Requires-Dist: ruff (>=0.6) ; extra == "dev"
Requires-Dist: sphinx (>=8.2) ; extra == "dev"
Requires-Dist: sphinx-copybutton (>=0.5) ; extra == "dev"
Requires-Dist: sphinx-rtd-theme (>=3.0) ; extra == "dev"
Project-URL: Changelog, https://github.com/chrab/pylamda/blob/main/CHANGELOG.md
Project-URL: Documentation, https://pylamda.readthedocs.io/
Project-URL: Issues, https://github.com/chrab/pylamda/issues
Project-URL: Repository, https://github.com/chrab/pylamda
Description-Content-Type: text/markdown

# pylamda

[![PyPI](https://img.shields.io/pypi/v/pylamda)](https://pypi.org/project/pylamda/)
[![Tests](https://img.shields.io/github/actions/workflow/status/chrab/pylamda/tests.yml?branch=main&label=tests)](https://github.com/chrab/pylamda/actions/workflows/tests.yml)
[![Python](https://img.shields.io/pypi/pyversions/pylamda)](https://pypi.org/project/pylamda/)
[![Documentation](https://img.shields.io/readthedocs/pylamda)](https://pylamda.readthedocs.io/)
[![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/chrab/pylamda/python-coverage-comment-action-data/endpoint.json)](https://github.com/chrab/pylamda/tree/python-coverage-comment-action-data)
[![License](https://img.shields.io/pypi/l/pylamda)](https://github.com/chrab/pylamda/blob/main/LICENSE)

Python toolkit for working with and on files in the LAMDA format (the
[Leiden Atomic and Molecular Database](https://home.strw.leidenuniv.nl/~moldata/)).

**Documentation:** <https://pylamda.readthedocs.io/>

## Main features

- reading, writing and manipulating (i.e. adding collisional partner) LAMDA files
- validating LAMDA files (i.e. do the follow the LAMDA standard)
- bibliography support (i.e. get all references for a file in bib format)

pylamda follows the [LAMDA standard](https://home.strw.leidenuniv.nl/~moldata/molformat.html)
strictly: collision partners are identified by their ID only, and deviations are
reported as issues, never silently interpreted.

```python
import pylamda

data = pylamda.read("co.dat")
for issue in pylamda.verify(data):  # all checks (see docs/checks.rst)
    print(issue)
pylamda.write(data, "co_normalised.dat")
```

```bash
pylamda check data/*.dat            # exit code 1 if there are errors
pylamda check --statistics data/*.dat
pylamda compare old.dat new.dat     # exit code 1 if they differ
pylamda bib data/*.dat -o refs.bib --online   # SciX needs SCIX_API_TOKEN
pylamda fix in.dat --in-place --trust id      # only the changed lines
pylamda add-partner o.dat o_chianti.dat e -o o_with_e.dat
```

## Installation

```bash
pip install .                 # numpy and requests
pip install ".[plot]"         # with matplotlib
pip install -e ".[dev]"       # development: tests, ruff, Sphinx
```

