Skip to main content

Odys

CI Coverage Python versions PyPI License

Optimize energy portfolios under uncertainty.

Documentation · User Guide · Examples · Formulation

Odys is a free, open-source Python framework for the short-term operation of energy asset portfolios across electricity markets. Generators, storage, electric vehicles, chargers and loads are scheduled against one or more markets, with uncertainty represented by probability-weighted scenarios.

Features:

  • Stochastic optimization: maximize expected profit over a set of scenarios, with optional stage-fixed (non-anticipative) market positions and a CVaR risk term.
  • Solver choice: HiGHS by default; Gurobi, CPLEX and SCIP as optional extras. Models are built with linopy.
  • Validated inputs: assets, profiles and scenarios are Pydantic models, checked before the model is built.
  • Results as pandas: dispatch comes back as Series and DataFrames.
  • Documented formulation: every variable, constraint and objective term is written out.
  • Typed and tested: fully typed public API, tested on Python 3.11 to 3.14.

Scope: Odys models a portfolio on a single bus over a short horizon. It does not model networks, power flow or capacity expansion; for those, see PyPSA or Calliope.

Installation

pip install odys

Requires Python 3.11+. HiGHS is included. Gurobi, CPLEX and SCIP are optional extras:

pip install "odys[gurobi]"

See the solver docs for choosing a solver and passing options.

Quick example

Define your assets, describe the scenario, and call .optimize():

from datetime import timedelta

from odys import AssetPortfolio, EnergySystem, FixedLoad, Generator, LoadProfile, Scenario

generator = Generator(name="gen", nominal_power=100.0, variable_cost=50.0)
load = FixedLoad(name="demand")

portfolio = AssetPortfolio([generator, load])

energy_system = EnergySystem(
    portfolio=portfolio,
    scenarios=Scenario(profiles=(LoadProfile(load=load, values=[60, 90, 40, 70]),)),
    timestep=timedelta(hours=1),
    number_of_steps=4,
)

result = energy_system.optimize()
print(result.generators.power)
time  generator
0     gen          60.0
1     gen          90.0
2     gen          40.0
3     gen          70.0
Name: power, dtype: float64

See the documentation for the full workflow, or check the examples for complete worked scenarios.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Metadata

Release files for odys 0.3.0

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

Source distribution (sdist)

Source distribution for odys 0.3.0
File Size Uploaded Provenance Actions
odys-0.3.0.tar.gz 53.1 kB Without provenance Details for odys-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for odys 0.3.0
File Interpreter ABI Platform Actions
odys-0.3.0-py3-none-any.whl Python 3 none any Details for odys-0.3.0-py3-none-any.whl

Total release size: 131.1 kB

Release files / odys-0.3.0.tar.gz

Download URL odys-0.3.0.tar.gz
Size 53.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9140c977d3fbdb93982b7e4c772a9674f04ae5cc2569f6e9b6123df987ce8c48
BLAKE2b-256 checksum
How to use checksums
2921ba7b6c9dd8940d90e4223e42a96faa43b5c03930beac9d07093d0a4a194d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / odys-0.3.0-py3-none-any.whl

Download URL odys-0.3.0-py3-none-any.whl
Size 78.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73b84b0576e9cea7dc6e474c6c9d831e03a2a570e6ba1aca986d7282816acc8b
BLAKE2b-256 checksum
How to use checksums
c8330981668c367f17f6e33d739beb949699ae2553f73360f58f0b371d300323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for odys 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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