Skip to main content

fid for Python

How much a stored fact can still be trusted, from Python. The scoring, envelopes, registries and calibration all run in fid's Rust library; this package gives them a Python shape.

fidelity = baseline + (source × ∏(1 − noise) − baseline) × 0.5^(age / half_life)

See the fid repository for the model and the results it was calibrated on.

Install

pip install fidmeter          # then: import fid

Build from source

pip install maturin
cd bindings/python
maturin develop --release     # into the active virtualenv
python -m unittest discover -s tests

Use

import fid
from datetime import timedelta

# Score and gate
artifact = fid.stamp(
    {"ceo": "Ada"}, source="registry", source_class="database", half_life="5.8y"
)
fid.check(artifact, floor=0.7).status  # Status.SIGNAL (== 0, the CLI exit code)
fid.expires_at(artifact, floor=0.7)  # datetime when it falls below the floor

# Pipelines: stamping a stamped artifact appends a transform step
step = fid.stamp(artifact, source="summarize.py", noise=0.15)
print(fid.chain(step))

# Measured values from registries
half_life, baseline = fid.half_life("half-lives.yaml", "vessel_position", "underway")
noise = fid.noise("noise-model.yaml", "flight_leg", "previous_leg_late")

# The formula on its own
fid.fidelity(0.97, timedelta(hours=1), "2.9h", baseline=0.73)
fid.time_to_floor(0.97, "7d", 0.70, baseline=0.2)  # timedelta, or None if never

# Calibrate from facts you re-checked: (entity, age, still correct?, [state])
cal = fid.calibrate(rows, "policy_claim")
open("half-lives.yaml", "w").write(cal.yaml)
print(cal.report)
Function Returns
stamp(content, *, source, source_class, noise, half_life, baseline, type, state, condition, upstream, now) stamped dict {"fid": …, "content": …}
check(stamped, floor, *, now) Assessment with status (Status.SIGNAL / NOISE / UNKNOWN), fidelity, age, …
expires_at(stamped, floor) datetime, or None if it never falls below; IndeterminateError for an unknown source
chain(stamped, floor, *, now) the fid chain report
fidelity(source, age, half_life, *, noise, baseline) float
time_to_floor(fidelity, half_life, floor, *, baseline) timedelta, or None for never
half_life(path, type, state) / noise(path, transform, condition) registry lookups
registry(path, type, state) {half_life, baseline, source_fidelity}, ready for stamp(**…)
calibrate(rows, type, max_spread=2.5) Calibration with yaml, report, fits (each fit has 95% ranges)

Durations are strings ("30d", "6h"), seconds, or timedelta. Times must be timezone-aware. Errors raise ValueError.

Metadata

Release files for fidmeter 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fidmeter 0.2.1
File Size Uploaded Provenance Actions
fidmeter-0.2.1.tar.gz 165.8 kB With provenance Details for fidmeter-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fidmeter 0.2.1
File Actions
fidmeter-0.2.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for fidmeter-0.2.1-cp39-abi3-win_amd64.whl
fidmeter-0.2.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for fidmeter-0.2.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
fidmeter-0.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for fidmeter-0.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
fidmeter-0.2.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for fidmeter-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
fidmeter-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for fidmeter-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 3.8 MB

Release files / fidmeter-0.2.1.tar.gz

Download URL fidmeter-0.2.1.tar.gz
Size 165.8 kB
Tags Source
SHA-256 checksum
How to use checksums
29ec05fa67a1798dd24744d76a8503ecb602b2c65560e69d50702478eb512ddc
BLAKE2b-256 checksum
How to use checksums
d6e71074468af28aa75b24fcf83b23cfeefb3b40359f371b7a5ace2a6c62f1e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / fidmeter-0.2.1-cp39-abi3-win_amd64.whl

Download URL fidmeter-0.2.1-cp39-abi3-win_amd64.whl
Size 634.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ae34faa2bb738cb48505849ed6674b4e1bdd4c1019b4b5dc762dc48645c2e4c2
BLAKE2b-256 checksum
How to use checksums
ecc6d19bda4043e4f582ec23df141b5a804ca0b441d9632f208099a853943dc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / fidmeter-0.2.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL fidmeter-0.2.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 800.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a896fef550f9400982caad10cf6a11e583679b05a2ce31cd44b281df693d94f2
BLAKE2b-256 checksum
How to use checksums
eaf1c05d21dfb5a027e0adb5013f909cb23bde25a5097e478a257d18ac5cca1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / fidmeter-0.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL fidmeter-0.2.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 771.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c0d0a44061f6168b371e143bd2dde703b3372022cef003a1d1bc17304c84a202
BLAKE2b-256 checksum
How to use checksums
bec82775c1f80601c24852ff026fbbf6966f061f2b4805c11a59e9ad4db8a105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / fidmeter-0.2.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL fidmeter-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
Size 716.3 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
19e46137aa56bf2c7cb5aa15da1ad4694b338f7a56090bc5ce87e50f1326e1e5
BLAKE2b-256 checksum
How to use checksums
e15b77828cd3712786f9cf5faa47f2424c772e62d50187bf164c8c4c5ff49033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / fidmeter-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL fidmeter-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 743.1 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
094a7d8c7b33a9d9c92c00934acda74c7d5d18c2b462e74fb7d14ee17cfe4b61
BLAKE2b-256 checksum
How to use checksums
a61c13e494da4a5c06efed5e2aaa8c39429c06f6617e24f5e0e026e15f417351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for fidmeter 0.2.1

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for fidmeter-0.2.1.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 Nov 27, 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