Skip to main content

cobre

Python bindings for the Cobre power systems solver.

Cobre is a high-performance SDDP (Stochastic Dual Dynamic Programming) solver for hydrothermal dispatch, written in Rust. This package provides Python access to case loading, validation, training, simulation, and result inspection.

Installation

pip install cobre-python

Pre-built wheels are available for:

  • Linux x86_64 (manylinux_2_34)
  • Linux aarch64 (manylinux_2_28)
  • Linux musl x86_64 (musllinux_1_2)
  • macOS Apple Silicon (aarch64) and Intel (x86_64)
  • Windows x86_64
  • Python 3.12+

Quick Start

import cobre

# Load and validate a case
system = cobre.io.load_case("path/to/case")
print(f"System: {system.n_buses} buses, {system.n_hydros} hydros, {system.n_thermals} thermals")

# Run training + simulation
result = cobre.run.run("path/to/case", output_dir="output/")
print(f"Converged: {result['converged']}, LB: {result['lower_bound']:.2f}")

convergence = cobre.results.load_convergence("output/")
print(f"Iterations: {len(convergence)}")

simulation = cobre.results.load_simulation("output/")
print(f"Cost records: {len(simulation['costs'])}")

policy = cobre.results.load_policy("output/")
print(f"Iterations completed: {policy['metadata']['producer']['completed_iterations']}")

The same workflow, driven step by step:

# The Study lifecycle — construct, train, simulate
study = cobre.Study("path/to/case", output_dir="output/")
policy = study.train()
summary = study.simulate(policy)
print(f"Scenarios: {summary['n_scenarios']}, Completed: {summary['completed']}")

# Inspect the study before running any phase
print(f"Stages: {study.stochastic['n_stages']}, Seed: {study.stochastic['seed']}")

Modules

  • cobre.io — Load and validate case directories
  • cobre.model — Data model classes (System, Bus, Line, Thermal, Hydro, etc.)
  • cobre.run — Execute SDDP training and simulation
  • cobre.results — Load and inspect output artifacts, including convergence history, Parquet simulation outputs, and FlatBuffers policy (FCF) checkpoints
  • cobre.schema — JSON Schema export for case-directory input types
  • cobre.errors — Typed exception hierarchy for case-loading and solver errors

The package also exports Study, Policy, write_policy_checkpoint, and version_info at the top level.

Requirements

  • Python >= 3.12
  • No runtime dependencies (the Rust solver is statically linked)

License

Apache-2.0 — see LICENSE.

Metadata

Release files for cobre-python 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cobre-python 0.18.0
File Actions
cobre_python-0.18.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for cobre_python-0.18.0-cp312-abi3-win_amd64.whl
cobre_python-0.18.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for cobre_python-0.18.0-cp312-abi3-musllinux_1_2_x86_64.whl
cobre_python-0.18.0-cp312-abi3-manylinux_2_34_x86_64.whl CPython 3.12 abi3 Linux glibc 2.34+ x86-64 Details for cobre_python-0.18.0-cp312-abi3-manylinux_2_34_x86_64.whl
cobre_python-0.18.0-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details for cobre_python-0.18.0-cp312-abi3-manylinux_2_28_aarch64.whl
cobre_python-0.18.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for cobre_python-0.18.0-cp312-abi3-macosx_11_0_arm64.whl
cobre_python-0.18.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for cobre_python-0.18.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 60.0 MB

Release files / cobre_python-0.18.0-cp312-abi3-win_amd64.whl

Download URL cobre_python-0.18.0-cp312-abi3-win_amd64.whl
Size 8.0 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ee0f8e9344deb921535542bf17e32a6e14ddea952575029cadc06f8c4e1f44be
BLAKE2b-256 checksum
How to use checksums
386901b8b25419b30c2cac3fdc37d71bb49b40005719fbae82278e779b6b62bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cobre_python-0.18.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL cobre_python-0.18.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 16.0 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3b8bf8e0b7f5905dfdd89239203e75d50a67d7ea1f98d85cd364575a1d225b0a
BLAKE2b-256 checksum
How to use checksums
d925d1eba12bda9505b474783976017b3681719fe89647a584b40da60823821b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cobre_python-0.18.0-cp312-abi3-manylinux_2_34_x86_64.whl

Download URL cobre_python-0.18.0-cp312-abi3-manylinux_2_34_x86_64.whl
Size 9.7 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
8a31828a528ea54a6a9edcddd74a948b046f982f164eb379aafcc7c660f7513c
BLAKE2b-256 checksum
How to use checksums
b9a04d2d69a40f1c2f290dde8464d8c027692a34985276ef60adff3af913974b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cobre_python-0.18.0-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL cobre_python-0.18.0-cp312-abi3-manylinux_2_28_aarch64.whl
Size 9.1 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
af67c3ef8f9c24048a79a89523b1be7cc4af5187f11c71f6261a46df2efad396
BLAKE2b-256 checksum
How to use checksums
5321a7f58d4b30a8a559be799d557fc4dc4437a5679c911f4c423c95eaaf43e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cobre_python-0.18.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL cobre_python-0.18.0-cp312-abi3-macosx_11_0_arm64.whl
Size 8.2 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ca986b23394c5751c720b1864d8ee84333e54c2bd26af7fdb4392f638e094ece
BLAKE2b-256 checksum
How to use checksums
c2fdcbf0c594951f239d903ffae1debec7e14447d50eb677d633b71a30c0b017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cobre_python-0.18.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL cobre_python-0.18.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 9.0 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0efb76c61ec42af2365ec4ced74679559b19bfa9ca60b1aa7773e1667f998d5e
BLAKE2b-256 checksum
How to use checksums
5be925962e694ebe23cd946938c0d229e277223ec4293cc39b30d2806fc0e940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Security for cobre-python 0.18.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for cobre_python-0.18.0-cp312-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.18.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page