Skip to main content

MetricChrono Python

Production Python bindings for MetricChrono. The PyPI package uses the bundled metricchrono-ffi native library via ctypes when it is present, and otherwise falls back to a byte-identical pure-Python implementation — so import metricchrono works with no native library at all.

Install

python3 -m pip install metricchrono

pip install metricchrono downloads a pre-built binary wheel and needs no Rust toolchain or Cargo. Wheels are published for Linux (manylinux x86_64 and aarch64), macOS (Intel and Apple Silicon), and Windows (x86_64).

Only the source-distribution (sdist) fallback build needs Cargo plus a Rust toolchain — used when pip cannot find a matching wheel for the target platform.

Source-tree usage

To use the wrapper directly from a checkout without installing a wheel, no native build is required: the pure-Python backend works from the source tree. Build the native library from the repository root only when you want the fast path, then point Python at it:

cargo build -p metricchrono-ffi --release
export METRICCHRONO_FFI_LIB=target/release/libmetricchrono_ffi.dylib

Use .so on Linux and .dll on Windows.

Backend selection defaults to METRICCHRONO_BACKEND=auto: Python uses the native library when the wheel or source-tree cdylib is present and loadable, otherwise it falls back to the pure-Python backend. Force a backend with METRICCHRONO_BACKEND=python or METRICCHRONO_BACKEND=native.

Example

import metricchrono as mc

ladder = mc.geometric_ladder(0.5, 1.0, 2.0, 4, 0.5, 1.0)
print(mc.ladder_distance(3.0, ladder))

with mc.EventLog(2) as log:
    log.append(10, [1.0, 0.0])
    log.append(11, [1.0, 1.0])
    print(log.next_event(0, 0))

API Surface

  • Kernel and ladders: Tier, tick_distance, ladder_distance, geometric_ladder, Ladder.
  • Serialization: tier_from_schema, tier_to_schema, ladder_from_schema, ladder_to_schema, tick_vector_from_schema, tick_vector_to_schema, consensus_result_from_schema.
  • Smooth and adaptive helpers: smooth_tick_distance, smooth_ladder_distance, adaptive_ladder_distance, ZoomDecision.
  • Event memory: EventLog.
  • Consensus: weighted_consensus, coherence_residuals, simple_weight_update.

Metadata

Release files for metricchrono 0.5.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 metricchrono 0.5.0
File Size Uploaded
metricchrono-0.5.0.tar.gz 87.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for metricchrono 0.5.0
File
metricchrono-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
metricchrono-0.5.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
metricchrono-0.5.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
metricchrono-0.5.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
metricchrono-0.5.0-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details

Total release size: 1.1 MB

Release files / metricchrono-0.5.0.tar.gz

Download URL metricchrono-0.5.0.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
870e32aac43dd1fe37acdf9599d4d6a29a1bb2ef69aacad5aae82251dfba7eb6
BLAKE2b-256 checksum
How to use checksums
322c2af941e4ce7b517f01a86759d8c05b35f278f6190a07c2da8cea4613edf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release files / metricchrono-0.5.0-py3-none-win_amd64.whl

Download URL metricchrono-0.5.0-py3-none-win_amd64.whl
Size 116.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a1c99ff43e74027944b289ecf461f6576daa604163c4eb866a851af9a873a2fd
BLAKE2b-256 checksum
How to use checksums
614b4ac87b38c380d500b15cd8b6ff47ea464d8877673a7e4928e5ceedc4d654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release files / metricchrono-0.5.0-py3-none-manylinux_2_28_x86_64.whl

Download URL metricchrono-0.5.0-py3-none-manylinux_2_28_x86_64.whl
Size 232.8 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
58e467ae7e9bd867de6ba0d309ac28c04af942b03dde37ee69cd0dba211e0617
BLAKE2b-256 checksum
How to use checksums
4d5232c44a4ef75ecc89f6947efcd3894133abcdc577500e6d4e779bce4af01a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release files / metricchrono-0.5.0-py3-none-manylinux_2_28_aarch64.whl

Download URL metricchrono-0.5.0-py3-none-manylinux_2_28_aarch64.whl
Size 228.2 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7778e0cfda9b8cae647d59ede64b1d4ac6d2c658b6b14c250aefc725ed6b27ab
BLAKE2b-256 checksum
How to use checksums
17f0cc2e7cb8b04445138fc9df602eac87d109c076aab3d246b1f635bbaecc3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release files / metricchrono-0.5.0-py3-none-macosx_11_0_arm64.whl

Download URL metricchrono-0.5.0-py3-none-macosx_11_0_arm64.whl
Size 205.1 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a99561ef6a14b7d039ea38da103d130265eda6161ae5694fba00322132c1d53d
BLAKE2b-256 checksum
How to use checksums
b4c11f62bef0d5f4258fba4f63a909942c925dc2885eb6ab64b97e86617d9624
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release files / metricchrono-0.5.0-py3-none-macosx_10_13_x86_64.whl

Download URL metricchrono-0.5.0-py3-none-macosx_10_13_x86_64.whl
Size 210.7 kB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
a46614bb5161a889a8f8557a695128c0a5efbd3c4d7a869d99b58acde4e6a4ce
BLAKE2b-256 checksum
How to use checksums
fdc4d4b48015842df7986cff042af1129d5cc4a6e82e41e5f1e6d61bf107a75c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

6 release files

0.4.0

6 release files

0.3.0

6 release files

0.2.0

1 release file

0.1.0

1 release file

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