CurveMetric
Financial curve diagnostics and numerical validation for Python 3.11+. Compare two term structures on a common maturity grid and measure the effect on cash-flow present values. NumPy and SciPy power the core. QuantLib and pandas are optional.
Install from source
git clone https://github.com/Phasetensor/CurveMetric.git
cd CurveMetric
python -m pip install .
For QuantLib curve sampling or pandas tables, install with python -m pip install '.[quantlib,tables]'.
Example
from curvemetric import Curve, compare, present_value
pillars = [1, 3, 5]
rates = [0.02, 0.03, 0.04]
a = Curve.from_zero_rates(pillars, rates)
b = Curve.from_zero_rates(pillars, rates, "linear_zero")
report = compare(a, b, [1, 2, 3, 4, 5])
print(report["metrics"]["zero_bp"])
print(present_value(b, [2, 5], [4, 104]) - present_value(a, [2, 5], [4, 104]))
Run curvemetric examples/comparison.json report.html for a standalone report. Choose a .csv suffix for pointwise data or .json for data and summary statistics.
API and numerical conventions · Roadmap · Benchmark results · Apache 2.0
Reproduce validation
python -m unittest discover -s tests -v
PYTHONPATH=. python benchmarks/run.py > results.csv
The deterministic benchmark evaluates six interpolation choices, five analytical curve shapes and two pillar densities. The tests also check bootstrap residuals, closed-form DV01, parallel and key-rate shocks, multi-curve coupons, and file outputs.
Research validation
Version 1.1 adds analytical instantaneous forwards, explicit curve conventions, tolerance-based PASS/FAIL/UNKNOWN verdicts, calibration Jacobians and full-price quote sensitivities. Validation examples, figures and benchmark methodology. Software citation.
The 1.1.0 CI run on Python 3.12 measured 89% combined statement and branch coverage (344 statements, 27 missed, 110 branches, 22 partial). Measured run.
CurveMetric 1.5.0
Advanced scientific methods, reproducible figures and results · Module traceability and release gates. The advanced APIs are available in curvemetric.numerics, curvemetric.model_validation, curvemetric.statistics and curvemetric.portfolio.
Metadata
Release files for curvemetric 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| curvemetric-1.5.0.tar.gz | 131.5 kB | With provenance | Details for curvemetric-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curvemetric-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for curvemetric-1.5.0-py3-none-any.whl |
Total release size: 159.9 kB
Release files / curvemetric-1.5.0.tar.gz
| Download URL | curvemetric-1.5.0.tar.gz |
|---|---|
| Size | 131.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb6b1977baf41319cb9ebdf53707326faf52a6a1bfa113024237803bd9eafb8b
|
|
BLAKE2b-256 checksum How to use checksums |
dc58eae53166205cbe0386642ebc128f028ada02953867577b559c5235b73a19
|
| 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 logRelease files / curvemetric-1.5.0-py3-none-any.whl
| Download URL | curvemetric-1.5.0-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
224fd2fd72257614b452152c05cd67ee10b2588637e152e68576c5321dcb0c66
|
|
BLAKE2b-256 checksum How to use checksums |
480a7e85ba90ff0e2637240f00f9ff0cb1b628bcde5e2ed6c79925c701946fe8
|
| 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 logSecurity for curvemetric 1.5.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
Both files in this release have been uploaded with provenance metadata.
Attestation for curvemetric-1.5.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 Nov 27, 2026.
Transparency logA 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.