Metadata-Version: 2.4
Name: autoconf
Version: 2026.7.3.648
Summary: PyAuto Configration
Author-email: James Nightingale <James.Nightingale@newcastle.ac.uk>, Richard Hayes <richard@rghsoftware.co.uk>
License: MIT
Project-URL: Homepage, https://github.com/PyAutoLabs/PyAutoConf
Keywords: cli
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pathlib
Requires-Dist: typing-inspect>=0.4.0
Requires-Dist: PyYAML>=6.0.1
Requires-Dist: numpy<3.0.0,>=1.24.0
Provides-Extra: jax
Requires-Dist: jax<0.11.0,>=0.7.0; python_version >= "3.11" and extra == "jax"
Requires-Dist: jaxlib<0.11.0,>=0.7.0; python_version >= "3.11" and extra == "jax"
Requires-Dist: jaxnnls==1.0.1; python_version >= "3.11" and extra == "jax"
Provides-Extra: optional
Requires-Dist: autoconf[jax]; extra == "optional"
Requires-Dist: astropy>=5.0; extra == "optional"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Dynamic: license-file

# PyAutoConf

**PyAutoConf** (package `autoconf`) is the configuration, serialization, and
I/O foundation of the [PyAuto](https://github.com/PyAutoLabs) ecosystem. It
provides a layered configuration system with workspace overrides, dict / JSON /
CSV serialization of arbitrary objects, and FITS I/O.

`PyAutoFit`, `PyAutoArray`, `PyAutoGalaxy`, and `PyAutoLens` all depend on
autoconf: it supplies their packaged default config, the object-serialization
used to persist models and results, and shared utilities (`test_mode`,
`jax_wrapper`). Centralising these here keeps a single, consistent config and
I/O layer beneath every library.

## Install

```bash
pip install autoconf
```

## Examples

Layered config — read a directory of YAML into a queryable `Config`:

```python
from autoconf.conf import Config

config = Config("path/to/config")          # directory of YAML files
value = config["general"]["model"]["section"]["value"]
```

JSON serialization — round-trip arbitrary Python objects:

```python
from autoconf.dictable import output_to_json, from_json

data = {"sersic_index": 4.0, "centre": [0.0, 0.0]}
output_to_json(data, "model.json")
restored = from_json("model.json")         # == data
```

FITS I/O — write and read a NumPy array:

```python
import numpy as np
from autoconf.fitsable import output_to_fits, ndarray_via_fits_from

arr = np.arange(12.0).reshape(3, 4)
output_to_fits(values=arr, file_path="demo.fits", overwrite=True)
loaded = ndarray_via_fits_from(file_path="demo.fits", hdu=0)   # np.allclose(arr, loaded)
```

## Links

- Source & tests: [`autoconf/`](autoconf), [`test_autoconf/`](test_autoconf)
- Agent/contributor instructions: [`AGENTS.md`](AGENTS.md)
- Ecosystem: [PyAutoLabs on GitHub](https://github.com/PyAutoLabs)
