Skip to main content

Financial math test vector validation

Project description

finlint

Financial math test vectors for Python. Validate that your Decimal arithmetic produces correct, verified results.

Install

pip install finlint

Usage

from decimal import Decimal
from finlint.vectors import run_suite

def allocate(amount, parts, method):
    base = amount.quantize(Decimal('0.01'))
    # ... your allocation logic
    return {"splits": splits, "sum": total}

# Run all allocation vectors
run_suite("allocation", allocate)

API

  • load_suite(name) — Load vectors for a named suite
  • run_vector(vector, impl) — Run one vector against an implementation
  • run_suite(name, impl) — Run all vectors in a suite
  • parse_decimal_values(obj) — Recursively parse string values to Decimal

Available Suites

allocation, rounding, aggregation, percentage, gain-loss, ratio, weighted-average, serialization

License

Apache-2.0 — github.com/kanso-finance/finlint

Project details


Download files

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

Source Distribution

finlint-1.0.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

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

finlint-1.0.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file finlint-1.0.0.tar.gz.

File metadata

  • Download URL: finlint-1.0.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for finlint-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3139478275dc62eec9003dd07319e0c922a2952499217f92f59de766552bee48
MD5 59c51eaa15d7bf360f9fd90d95969d05
BLAKE2b-256 db94d70839273b4d255e1b1103faad5e68326b1bc0188a02a27935791b80cbee

See more details on using hashes here.

File details

Details for the file finlint-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: finlint-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for finlint-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d9294c24587a4e7fd62912e9de0404205c77caa5ef415f45712036b5053db0c
MD5 da494ec9f677858b8a2eb53006f807c2
BLAKE2b-256 11dda2c85b12f5c17ed2464f1be18ce64f4504de737fd4b7bafb21cacf8ffffe

See more details on using hashes here.

Supported by

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