Skip to main content

flodym

PyPI - Version flodym.tests docs status

The flodym (Flexibe Open Dynamic Material Systems Model) library provides key functionality for building material flow analysis models, including

  • the class MFASystem acting as a template (parent class) for users to create their own material flow models
  • the class FlodymArray handling mathematical operations between multi-dimensional arrays
  • different classes representing stocks accumulation, in- and outflows based on age cohort tracking and lifetime distributions. Those can be integrated in the MFASystem.
  • different options for data input and export, as well as visualization

flodym is based on the concepts of the Open Dynamic Material Systems Model ODYM (Pauliuk & Heeren, 2020). It is a re-implementation with a fundamentally overhauled API, internal dimension management, dynamic stock model integration, and other added features. As a result, flodym enables users to write customized, flexible MFAs, designed for maintainability and future extension.

Installation

flodym is published on PyPI and can be installed with your preferred Python package installer.

For example, with pip run python -m pip install flodym.

To install as a developer:

  1. Install uv.
  2. Clone the flodym repository using git.
  3. From the project root, run uv sync to create a virtual environment and install all development dependencies.

This workflow uses a project-local virtual environment (.venv) managed by uv.

Dimension Management

MFA models mainly consist of mathematical operations on different multi-dimensional arrays.

For example, the generation of different waste types waste might be a 3D-array defined over the dimensions time t, region r and waste type w, and might be calculated from multiplying end_of_life_products (defined over time, region, and product type p) with a waste_share mapping from product type to waste type. In numpy, the according matrix multiplication can be carried out nicely with the einsum function, were an index string indicates the involved dimensions:

waste = np.einsum('trp,pw->trw', end_of_life_products, waste_share)

flodym uses this function under the hood, but wraps it in a data type FlodymArray, which stores the dimensions of the array and internally manages the dimensions of different arrays involved in mathematical operations.

With this, the above example reduces to

waste[...] = end_of_life_products * waste_share

This gives a flodym-based MFA models the following properties:

  • Flexibility: When changing the dimensionality of any array in your code, you only have to apply the change once, where the array is defined, instead of adapting every operation involving it. This also allows, for example, to add or remove an entire dimension from your model with minimal effort.
  • Simplicity: Since dimensions are automatically managed by the library, coding array operations becomes much easier. No knowledge about the einsum function, about the dimensions of each involved array or their order are required.
  • Versatility: We offer different levels of flodym use: Users can choose to use the standard methods implemented for data read-in, system setup and visualization, or only use only some of the data types like FlodymArray, and custom methods for the rest.
  • Robustness: Through the use of Pydantic, the setup of the system is type-checked, highlighting errors early-on. The data read-in performs extensive checks on data sorting and completeness.
  • Performance: The use of numpy ndarrays ensures low model runtimes compared with dimension matching through pandas dataframes.

How to cite

If you use this software in publications, please cite our article in the Journal of Open Source Software:

@article{
    Duerrwaechter2026,
    author = {Dürrwächter, Jakob and Hosak, Merlin and Weiss, Bennet and Ueckerdt, Falko},
    title = {flodym: A Python package for dynamic material flow analysis},
    journal = {Journal of Open Source Software},
    year = {2026},
    doi = {10.21105/joss.10105},
    url = {https://doi.org/10.21105/joss.10105},
    publisher = {The Open Journal},
    volume = {11},
    number = {119},
    pages = {10105}
}

flodym is based on the concepts of ODYM. Please consider also citing the according publication: Pauliuk & Heeren, 2020.

Contributing

Contribution instructions and development setup is documented in CONTRIBUTING.md.

How to report problems and get support

If you encounter a bug or unexpected behaviour, please open an issue on GitHub.

For questions and general support, use GitHub Discussions or contact jakob[dot]duerrwaechter[at]pik-potsdam.de.

Acknowledgements

We thank Stefan Pauliuk and the other contributors to ODYM, which forms the conceptual basis for flodym.

We gratefully acknowledge funding from the TRANSIENCE project, grant number 101137606, funded by the European Commission within the Horizon Europe Research and Innovation Programme, from the Kopernikus-Projekt Ariadne through the German Federal Ministry of Education and Research (grant no. 03SFK5A0-2), and from the PRISMA project funded by the European Commission within the Horizon Europe Research and Innovation Programme under grant agreement No. 101081604 (PRISMA).

Documentation

See our readthedocs page for documentation!

The notebooks in the examples folder provide usage examples of the code.

Metadata

Release files for flodym 1.0.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 flodym 1.0.0
File Size Uploaded
flodym-1.0.0.tar.gz 52.2 kB Details

Built distribution (wheel)

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

Total release size: 112.9 kB

Release files / flodym-1.0.0.tar.gz

Download URL flodym-1.0.0.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
112e4f91ce369569a0085dae1723cba366804bd4d5a2dc1008ea2b3994090de9
BLAKE2b-256 checksum
How to use checksums
1538dc0d2be7000571338f57cd8fb6707ee5dc0a5b6e2c10c0ba509983901fa0
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 Aug 26, 2026.

Transparency log

Release files / flodym-1.0.0-py3-none-any.whl

Download URL flodym-1.0.0-py3-none-any.whl
Size 60.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7ba65b4d2da0accf67b82ec68c3a1972b9d253c0e9d85e14d70cdc1d784e205
BLAKE2b-256 checksum
How to use checksums
d705d69306a291ef59502cf1f412cedfa6603afb4f5b107d682d6add792b9bee
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 Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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