Skip to main content

PyPI Package Build Status Coverage Report Documentation Status

Modello

Modello describes symbolic models with Python classes. Define relationships between quantities, supply the values you know, and let SymPy solve for the rest.

Installation

pip install modello

Requires Python 3.10 or newer and SymPy 1.14 or newer.

Define a model

Declare independent quantities with InstanceDummy and write expressions for the relationships between them:

from sympy import sqrt

from modello import InstanceDummy, Modello, component


class RightAngleTriangle(Modello):
    a = InstanceDummy("a", real=True, positive=True)
    b = InstanceDummy("b", real=True, positive=True)
    c = sqrt(a**2 + b**2)


triangle = RightAngleTriangle("T", a=3, b=4)
assert triangle.c == 5

triangle = RightAngleTriangle("T", b=4, c=5)
assert triangle.a == 3

The same model works in either direction. Positive assumptions select the positive side length when solving for a.

Compose models

Use component() to give a model named parts. A parent's equations can determine unknown values inside its children:

class Box(Modello):
    base = component(RightAngleTriangle)
    height = InstanceDummy("height", positive=True)
    diagonal = sqrt(base.c**2 + height**2)


base = RightAngleTriangle("base", b=4)
box = Box("B", base=base, height=12, diagonal=13)
assert box.base.a == 3

Here the box's height and diagonal determine the missing side of its base. The original base stays symbolic; box.base contains the completed values. component(RightAngleTriangle) also gives box.base its model instance type for editors and type checkers.

Follow the nested-model guide for more examples of composition and symbolic inputs. The examples directory includes geometry, flow, and tax models, and the API reference describes the available classes and functions.

Development

See Contributing and releases for environment setup, tests, documentation builds, and publishing. The optional notebook environment is described in notebooks/README.md.

Metadata

Release files for modello 0.2.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 modello 0.2.0
File Size Uploaded Provenance
modello-0.2.0.tar.gz 260.1 kB With provenance Details

Built distribution (wheel)

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

Total release size: 268.1 kB

Release files / modello-0.2.0.tar.gz

Download URL modello-0.2.0.tar.gz
Size 260.1 kB
Tags Source
SHA-256 checksum
How to use checksums
255d07ba73a545df78cff9943df076f4e96700adad019faca3a62bc341a7438e
BLAKE2b-256 checksum
How to use checksums
ed0841a4b8ff1cebaf993259cb9c5a6290746d0f718519b9f2789abb686e2f0d
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 18, 2026.

Transparency log

Release files / modello-0.2.0-py3-none-any.whl

Download URL modello-0.2.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0533841ac21e28804342ada120d4d1e143b7e71287ce70031d2fad91a3a95513
BLAKE2b-256 checksum
How to use checksums
452e31332c3f47e80c5b9c40976a5d6665698bce1ef901a259bc9e268ab3dd5d
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 18, 2026.

Transparency log

Security for modello 0.2.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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for modello-0.2.0.tar.gz

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 18, 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.

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