Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Loman

Manage complex calculation flow via robust DAG-based dependency logic in Python

License: MIT Python versions PyPI - Version PyPI - Wheel ReadTheDocs

Github Linux MAC OS Code style: ruff uv Hatch project CodeFactor

CI MARIMO DEVCONTAINER

Open in GitHub Codespaces

Smart computation management - Only recalculate what's necessary

Loman tracks the state of your computations and their dependencies, enabling intelligent partial recalculations that save time and computational resources. Perfect for data pipelines, real-time systems, and complex analytical workflows.

Table of Contents

โœจ Features

Build smarter computation graphs with automatic dependency tracking

  • ๐Ÿ”„ Smart Recalculation: Only compute what's changed - save time and resources
  • ๐Ÿ“Š Dependency Tracking: Automatic graph-based dependency management
  • ๐ŸŽฏ Selective Updates: Control which outputs to compute and when
  • ๐Ÿ’พ State Persistence: Serialize computation graphs for inspection and recovery
  • ๐Ÿ” Visual Debugging: Built-in GraphViz integration for computation visualization
  • โšก Real-time Ready: Perfect for systems with inputs that tick at different rates
  • ๐Ÿงช Research Friendly: Iterate quickly by updating methods and re-running only necessary computations
  • ๐Ÿ”— Framework Agnostic: Works with NumPy, Pandas, and your favorite Python libraries

๐Ÿš€ Quick Start

Loman Graph Example

The above computation graph was generated with this simple Loman code:

from loman import Computation

# Create a computation graph
comp = Computation()
comp.add_node('a', value=1)                    # Input node
comp.add_node('b', lambda a: a + 1)            # b depends on a
comp.add_node('c', lambda a, b: 2 * a)         # c depends on a and b
comp.add_node('d', lambda b, c: b + c)         # d depends on b and c
comp.add_node('e', lambda c: c + 1)            # e depends on c

# Smart computation - only calculates what's needed
comp.compute('d')  # Will not compute 'e' unnecessarily!

# Inspect intermediate values
comp.to_dict()
# {'a': 1, 'b': 2, 'c': 2, 'd': 4, 'e': None}

# Visualize the computation graph
comp.draw()  # Creates the graph shown above

๐Ÿ“š Explore More: Check out our Interactive Examples including:

  • ๐Ÿ’ฐ Interest Rate Swap Pricing
  • ๐Ÿ“ˆ Portfolio Valuation
  • ๐Ÿฆ CDO Modeling

Why Loman?

Loman transforms how you build and maintain complex data processing pipelines by making computational dependencies explicit and manageable. Instead of manually tracking what needs to be recalculated when data changes, Loman handles this automatically.

Perfect for:

  • ๐Ÿ”ด Real-time Systems: Handle inputs that tick at different rates efficiently

    • Only recalculate affected downstream computations
    • Control which outputs are computed and when
    • Monitor status of all components in your pipeline
  • ๐Ÿ“ฆ Batch Processing: Build robust daily/periodic processes

    • Serialize computation state for easy inspection and debugging
    • Replace inputs or override intermediate values without full recomputation
    • Recover from failures efficiently by resuming from last good state
  • ๐Ÿ”ฌ Research & Analytics: Accelerate iterative development

    • Modify calculation methods and re-run only what's needed
    • Track complex dependencies in evolving analysis pipelines
    • Reuse expensive intermediate computations across experiments

๐Ÿ“– Learn More: The Introduction explains in detail how Loman can transform your workflow.

๐Ÿ“ฅ Installation

Using pip (recommended)

pip install loman

From source (development)

git clone https://github.com/janusassetallocation/loman.git
cd loman
pip install -e .

Note: Use -e flag for editable installation during development

๐Ÿ› ๏ธ Development

For contributors and advanced users

Loman uses modern Python development tools for a smooth developer experience:

# ๐Ÿ“ฆ Install development dependencies
make install

# ๐Ÿงช Run tests with coverage
make test

# โœจ Format and lint code
make check

Development Tools

  • Testing: pytest with coverage reporting
  • Formatting: ruff for code formatting and linting
  • Task Management: Taskfile for build automation
  • Quality: Pre-commit hooks for code quality

๐Ÿ“– Documentation

โ˜๏ธ Try Loman in Codespaces

Open in GitHub Codespaces

Instant development environment in your browser Click the button to launch a fully configured development environment in your browser.

What's Included

  • ๐Ÿ Python 3.13 - Latest Python with all dependencies pre-installed
  • ๐Ÿ› ๏ธ Development Tools - pytest, ruff, mypy, pre-commit hooks ready to go
  • ๐Ÿ““ Interactive Notebooks - Marimo notebooks for exploring examples
  • โšก Zero Setup - Everything configured ready to go
  • ๐ŸŽฏ VS Code Extensions - Python, testing, and productivity extensions pre-installed

๐Ÿ‘ฅ Contributing

We welcome contributions! ๐ŸŽ‰

Whether you're fixing bugs, adding features, or improving documentation, your help makes Loman better for everyone.

Quick Start for Contributors

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create your feature branch: git checkout -b feature/amazing-feature
  3. โœจ Make your changes and add tests
  4. ๐Ÿงช Test your changes: make test
  5. ๐Ÿ“ Commit your changes: git commit -m 'Add amazing feature'
  6. ๐Ÿš€ Push to your branch: git push origin feature/amazing-feature
  7. ๐ŸŽฏ Open a Pull Request

Resources

Acknowledgments ๐Ÿ™


โญ If you find Loman useful, please consider giving it a star! โญ

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loman-0.6.1a2.tar.gz (494.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loman-0.6.1a2-py3-none-any.whl (91.1 kB view details)

Uploaded Python 3

File details

Details for the file loman-0.6.1a2.tar.gz.

File metadata

  • Download URL: loman-0.6.1a2.tar.gz
  • Upload date:
  • Size: 494.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loman-0.6.1a2.tar.gz
Algorithm Hash digest
SHA256 714846f3b296776799c55e969026d6f327b2505b785c89d86b41696f21b81ea1
MD5 f405b0f68201398784e75a0ea3f24a0c
BLAKE2b-256 ae9390f314d1b8cacc908223f0f6d52eca6af02371528672ec331b4b2fa95f1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for loman-0.6.1a2.tar.gz:

Publisher: rhiza_release.yml on janushendersonassetallocation/loman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loman-0.6.1a2-py3-none-any.whl.

File metadata

  • Download URL: loman-0.6.1a2-py3-none-any.whl
  • Upload date:
  • Size: 91.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loman-0.6.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 e222845a1f33f9ba08d5d8bbfa74853acdcec86a3d583590d1cc42ed7cb6a07f
MD5 aaba2c2a5e46c3ed0312e0ffa73d8046
BLAKE2b-256 7c65e142baa039b0a6377a265d58dddea04fc1b047d816d9ef2a4a4153e245df

See more details on using hashes here.

Provenance

The following attestation bundles were made for loman-0.6.1a2-py3-none-any.whl:

Publisher: rhiza_release.yml on janushendersonassetallocation/loman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page