Metadata-Version: 2.4
Name: r2x-core
Version: 1.0.0
Summary: Shared Python infrastructure for power-system model translators
Keywords: power-systems,energy-modeling,model-translation,reeds,plexos,switch,sienna,plugin-architecture
Author: pesap, kodiobika, Vivienne Liu, Micah Webb, Kinshuk Panda, mcllerena, jarry7
Author-email: pesap <pesap@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>, Vivienne Liu <vivienne.liu@nrel.gov>, Micah Webb <micahpw@user.noreply.github.com>, Kinshuk Panda <7632244+k1nshuk@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>
License-Expression: BSD-3-Clause
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
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
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: h5py>=3.13.0,<4.0.0
Requires-Dist: infrasys>=1.0.0,<2.0.0
Requires-Dist: loguru>=0.7.3,<0.8.0
Requires-Dist: packaging>=24.0,<26.0
Requires-Dist: polars>=1.44.1,<2.0.0
Requires-Dist: pydantic>=2.11.9,<3.0.0
Requires-Dist: rust-ok>=0.3.0,<1.0.0
Maintainer: pesap, mcllerena, jarry7, kodiobika
Maintainer-email: pesap <pesap@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>
Requires-Python: >=3.11, <3.15
Project-URL: Homepage, https://github.com/NatLabRockies/r2x-core
Project-URL: Documentation, https://natlabrockies.github.io/r2x-core/
Project-URL: Repository, https://github.com/NatLabRockies/r2x-core
Project-URL: Issues, https://github.com/NatLabRockies/r2x-core/issues
Project-URL: Changelog, https://natlabrockies.github.io/r2x-core/CHANGELOG.html
Description-Content-Type: text/markdown

<img src="./docs/src/assets/r2x-logo-full-square.svg" alt="R2X framework logo" align="left" width="220px" height="220px" hspace="10"/>
<img align="left" alt="" width="0" height="220px" hspace="10"/>

#### r2x-core
<p><small>Shared Python tools for power system translators.</small></p>

[![CI](https://github.com/NatLabRockies/r2x-core/actions/workflows/ci.yaml/badge.svg)](https://github.com/NatLabRockies/r2x-core/actions/workflows/ci.yaml) [![PyPI](https://img.shields.io/pypi/v/r2x-core.svg)](https://pypi.org/project/r2x-core/) [![Last commit](https://img.shields.io/github/last-commit/NatLabRockies/r2x-core?style=flat-square)](https://github.com/NatLabRockies/r2x-core/commits/main) [![Docs](https://img.shields.io/badge/docs-guides-0079c2?style=flat-square)](https://natlabrockies.github.io/r2x-core/)
<br/>
[![Python 3.11 to 3.14](https://img.shields.io/badge/Python-3.11%20to%203.14-3776ab?logo=python&logoColor=white)](https://natlabrockies.github.io/r2x-core/install/) [![Managed with uv](https://img.shields.io/badge/managed%20with-uv-6f42c1)](https://docs.astral.sh/uv/) [![BSD 3 clause](https://img.shields.io/badge/license-BSD%203%20clause-blue.svg)](./LICENSE.txt)

<br clear="left">

`r2x-core` provides typed plugin configuration, lifecycle hooks, file readers,
rule mappings, and unit handling for systems.
Model packages implement parsers and exporters. [r2x-cli](https://github.com/NatLabRockies/r2x-cli)
installs and runs them in its own managed Python environment. `r2x-core` is a
library and does not install the `r2x` executable.

## Quick Start

### Install

Use Python 3.11 through 3.14. In an activated virtual environment:

```bash
python -m pip install r2x-core
```

Polars is a runtime dependency for the table reader and processor included with
r2x-core. It loads only when needed, so importing configuration does not load
it. Applications can provide their own `FileReader` and `TabularProcessor`.
See [Installation](https://natlabrockies.github.io/r2x-core/install/) for environment and upgrade instructions.

Verify the installation and create a system:

```bash
python -c "from r2x_core import System; print(System(name='example').name)"
```

Expect `example`. Continue with the CSV capacity tutorial to build, transform,
export, and independently reload a system.

## Documentation

Use the guide that matches your task:

- [Getting started](https://natlabrockies.github.io/r2x-core/install/): install the library and prepare your environment.
- [Tutorials](https://natlabrockies.github.io/r2x-core/tutorials/): learn through runnable examples.
- [How to guides](https://natlabrockies.github.io/r2x-core/how-tos/): configure files, plugins, units, and rules.
- [API reference](https://natlabrockies.github.io/r2x-core/references/api/): public contracts, signatures, and implementation links.
- [Explanation](https://natlabrockies.github.io/r2x-core/explanations/): architecture and data flow.
- [Troubleshooting](https://natlabrockies.github.io/r2x-core/troubleshooting/): diagnose input, lifecycle, unit, and serialization failures.
- [Changelog](CHANGELOG.md): release history.

See the [documentation site](https://natlabrockies.github.io/r2x-core/) for the complete guide map.

## Development

Install `uv`, a supported Python version, Node.js 22.22 or newer for the docs, and `mise`.
From a source checkout:

```bash
mise run setup
mise run hooks
mise run test
```

Build the searchable documentation site:

```bash
npm ci --prefix docs
mise run docs
```

See [Contributing](CONTRIBUTING.md) for setup and checks, and the [r2x-core agent skill](skills/r2x-core/SKILL.md) for additional development workflows.

## License

BSD license with three clauses.
See [LICENSE.txt](./LICENSE.txt) for the full license text.
