Metadata-Version: 2.4
Name: httk-io
Version: 0.1.0
Summary: httk₂ file input/output (CIF and mCIF readers/writers)
Author-email: Rickard Armiento <rickard-gpg@armiento.net>
License-Expression: AGPL-3.0-or-later
Project-URL: Homepage, https://httk.org
Project-URL: Documentation, https://docs.httk.org/httk-io/
Project-URL: Repository, https://github.com/httk/httk-io
Project-URL: Issues, https://github.com/httk/httk-io/issues
Keywords: Materials Discovery,Materials Informatics,Materials Science,CIF,Crystallography
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httk-core<3,>=2.0.0
Requires-Dist: numpy>=1.21
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: myst-nb; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-autoapi; extra == "docs"
Provides-Extra: release
Requires-Dist: build>=1.2; extra == "release"
Requires-Dist: twine>=6.0; extra == "release"
Dynamic: license-file

# httk-io

*httk-io* is the file input/output module for *httk₂*. It provides:

- the `httk.io` package within the PEP 420 native `httk` namespace, currently a
  CIF/mCIF parser, reader and writer stack; and
- the `httk.handlers.io` package, which registers the `.cif` loader with
  `httk-core`'s plugin registry so files can be read via `httk.core.load`.

Most users should install the [`httk2`](https://github.com/httk/httk2)
metapackage, which selects a useful set of httk modules:

```console
pip install httk2
```

Install only this module (it depends on `httk-core` and `numpy`) with:

```console
pip install httk-io
```

## Usage

Importing `httk.core` discovers `httk.handlers.io` and registers the `.cif`
loader. `httk.core.load` then dispatches on the file extension and returns the
raw parsed CIF data as a `(data_blocks, header)` tuple:

```python
import httk.core  # discovery registers the ".cif" loader

data_blocks, header = httk.core.load("structure.cif")
name, block = data_blocks[0]
print(block["cell_length_a"])
```

Development and release instructions are in the
[`RELEASING.md`](https://github.com/httk/httk-io/blob/main/RELEASING.md) guide.
