Verify installation and first use
After installing the published package, check the version and construct an empty system:
python -c "import r2x_core; from r2x_core import System; system = System(); print(r2x_core.__version__); print(type(system).__name__)"Expect the installed version followed by System.
In a uv project, prefix the same command with uv run.
An import failure usually means the command is using a different environment; see Troubleshooting.
Next, build and verify a CSV capacity scenario. That worked example ships its own data and uses the repository’s locked runtime to keep the fixture and implementation aligned. It verifies a 165 MW system and reloads the exported artifact in a fresh process. For method contracts and source links, use the API reference.
Choose the plugin contract you need
Section titled “Choose the plugin contract you need”r2x-core provides infrastructure and registers no runnable CLI plugins of its own.
Model packages provide native input parsers, modifiers and exporters; r2x-cli installs and discovers those packages.
The contracts you implement depend on the work:
| Work | Public contract | Next step |
|---|---|---|
| Read native data into a system | Plugin.on_build() returns Result[System, str] | Build a parser |
| Modify a system | on_transform() or an exposed System, config callable | Create a function plugin |
| Translate component schemas | on_translate() and rule mappings | Apply rules |
| Write model-specific output | on_export() | Build an exporter |
A model package may call a modifier a sysmod; that name is not a built-in electrical operation in this library. Use the package’s registered reference and configuration instead of guessing a class or CLI command. For native model inputs, start with r2x-reeds or the model package linked from the R2X architecture guide.