Shared Python tools for power system translators.
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
installs and runs them in its own managed Python environment. r2x-core is a
library and does not install the r2x executable.
Use Python 3.11 through 3.14. In an activated virtual environment:
python -m pip install r2x-corePolars 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 for environment and upgrade instructions.
Verify the installation and create a system:
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.
Use the guide that matches your task:
- Getting started: install the library and prepare your environment.
- Tutorials: learn through runnable examples.
- How to guides: configure files, plugins, units, and rules.
- API reference: public contracts, signatures, and implementation links.
- Explanation: architecture and data flow.
- Troubleshooting: diagnose input, lifecycle, unit, and serialization failures.
- Changelog: release history.
See the documentation site for the complete guide map.
Install uv, a supported Python version, Node.js 22.22 or newer for the docs, and mise.
From a source checkout:
mise run setup
mise run hooks
mise run testBuild the searchable documentation site:
npm ci --prefix docs
mise run docsSee Contributing for setup and checks, and the r2x-core agent skill for additional development workflows.
BSD license with three clauses. See LICENSE.txt for the full license text.