Skip to main content

iosisLib

iosislib is a Python library for typed, deterministic, time-aware computation graphs over Polars time-series data. It owns graph validation, causal parent alignment, null policies, materialization boundaries, model lifecycle contracts, and graph-native backtesting while Polars remains the columnar execution engine.

Install from PyPI with Python 3.11, 3.12, or 3.13:

pip install iosislib

Optional extras:

pip install iosislib[charting]   # matplotlib helpers
pip install iosislib[lightgbm]   # LightGBM model TSFN
pip install iosislib[yfinance]   # yfinance adapter (also pulls pandas)
pip install iosislib[acceleration] # numba JIT acceleration

The installed package namespace is iosislib. Owning modules such as iosislib.core.graph remain canonical, with a small top-level convenience surface for Graph, Node, and frame signatures.

Modules

  • iosislib.core -- graph, node, TSFN base classes, model lifecycle, and utilities.
  • iosislib.tsfn.transforms -- concrete transforms: delta, logit, log, exp, spread, ratio, lag, lead, rolling, ewm, pct_change, log_return, log_ratio, negate, feature_packer, feature_unpacker.
  • iosislib.tsfn.adapters -- data sources: dataset, parquet, csv, dataframe, streaming parquet, yfinance, polymarket.
  • iosislib.models -- supervised model TSFNs: LightGBM, DenseMLP.
  • iosislib.backtest -- graph-native immediate-execution backtesting: policies, risk controls, venue, and feeds.
  • iosislib.strategy -- portable iosis.strategy YAML parsing, lowering, and the operation registry.
  • iosislib.metrics -- post-hoc metric extraction over materialized frames.
  • iosislib.charting -- Matplotlib helpers for plotting graph results.

Offline quickstart

The tracked offline graph example snapshots a temporary local CSV by content hash, then executes CSVSource -> Logit -> Delta without network access. Run it from the repository root after installation:

python examples/offline_graph.py

Nodes are immutable declarations. A child owns the alignment tolerance and null policy for each input it consumes; graph execution aligns parents with a backward as-of join on the union of their timestamps.

Concrete frozen configs are accepted through the typed config= path, while parameters= mappings remain available for dynamic programs. Both normalize to the same Node identity. Use node.output("column") for an explicit typed binding; node.column remains equivalent shorthand.

Graphs are immutable after successful validation. Execution strategies are runtime choices, supplied with graph.execute(executor=...); they are not part of the graph declaration or ID. CSV and Parquet sources read, hash, and parse the same in-memory byte snapshot. This gives an exact content guarantee at the cost of holding the full source bytes and parsed frame at that boundary.

Parquet data sources

ParquetSource accepts a local file, a local directory, an S3 object, or an S3 bucket/prefix. Directories and prefixes are searched recursively for .parquet files. This source is deliberately non-streaming: it downloads every selected object, verifies one deterministic dataset digest, parses the snapshot, and then returns a projected LazyFrame with the declared time-series schema.

import polars as pl

from iosislib.core.node import Node
from iosislib.core.tsfn import FrameSignature
from iosislib.tsfn.adapters import ParquetSource, sha256_parquet_source

location = "s3://my-bucket/prices/"  # A local pathlib.Path works too.
signature = FrameSignature(columns=(("price", pl.Float64),))
source = Node(
    ParquetSource,
    parameters={
        "path": location,
        "output_signature": signature,
        "content_sha256": sha256_parquet_source(location),
    },
)

S3 access uses PyArrow's standard AWS credential chain; credentials are not graph parameters and therefore are not serialized into node identity. Computing the digest reads the dataset once, and graph execution reads it again and rejects the result if the bytes or selected object manifest changed between those operations. The digest identifies the physical snapshot, not only its logical rows, so changing a multi-file dataset's partitioning intentionally changes its content address. A single-file directory or prefix retains the bare file's SHA-256 for compatibility.

Development

Install the complete local toolchain:

python -m pip install -e ".[dev]"

Run the same quality gates enforced by CI:

python -m compileall -q src/iosislib examples
python -m ruff check src examples
python -m mypy
python examples/offline_graph.py
python -m pytest
python -m build
python -m twine check --strict dist/*
check-wheel-contents dist

Ruff checks production source and tracked examples without forcing churn in deliberately adversarial tests. Strict mypy checks the TSFN and Node contracts, the concrete transforms, and a public consumer fixture. This is an enforced public slice, not a claim that every production module is already strict-clean.

Tracked tests use local fixtures or mock remote API boundaries; they do not require live market or finance services. CI runs the full suite on Windows and Ubuntu for every declared Python version, then validates both source and wheel distributions in a clean environment outside the checkout.

Releases publish to PyPI automatically when a v* tag is pushed.

Portable strategy declarations

iosislib.strategy provides the backend-independent iosis.strategy YAML representation for storing strategies and passing them between APIs and frontends. Document and operation versions are explicit SemVer fields. It uses stable symbolic operation names and readable node.output references rather than Python class paths or backend graph IDs. The parser, deterministic serializer, fingerprint, and packaged JSON Schema are documented in the strategy format specification. A backend operation registry/compiler is intentionally a later layer.

See AGENTS.md for the architectural and contribution constraints.

Third-party TSFN and model authors should start with the extension guide, which explains the graph, signature, null, identity, materialization, and walk-forward model contracts.

Download files

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

Source Distribution

iosislib-0.2.1.tar.gz (176.0 kB view details)

Uploaded Source

Built Distribution

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

iosislib-0.2.1-py3-none-any.whl (131.1 kB view details)

Uploaded Python 3

File details

Details for the file iosislib-0.2.1.tar.gz.

File metadata

  • Download URL: iosislib-0.2.1.tar.gz
  • Upload date:
  • Size: 176.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for iosislib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a85ae2016b285621596a5517374dd67f11cb2b36fba9d4b41a0f18d8b2d0c6b0
MD5 29adb0d76be2425ea279e3d9b4bebb0f
BLAKE2b-256 7c56567cab2d121fbf61816b150efad5b12055af6e030a220acbe499b376e467

See more details on using hashes here.

Provenance

The following attestation bundles were made for iosislib-0.2.1.tar.gz:

Publisher: publish.yml on iosis-quant/iosislib

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

File details

Details for the file iosislib-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for iosislib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b933c6a27bad18dc26fd65821a8b6aa4c090c2aac3b81832e8ff12db657620f
MD5 f5696d485b53c3d1d6327358299fd4c1
BLAKE2b-256 e0bab2d29f349dfc48f7f2870ff6f56ecd120c4e9e30af6f4cfdef8aa9970789

See more details on using hashes here.

Provenance

The following attestation bundles were made for iosislib-0.2.1-py3-none-any.whl:

Publisher: publish.yml on iosis-quant/iosislib

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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.1.0

2 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