MoneyWarp
Bend time. Model cash.
Development Stage Notice -- MoneyWarp is in active development (alpha). Core classes are stable and covered by 5700+ tests, but the API may evolve.
MoneyWarp is a Python library for working with the time value of money. It treats loans, annuities, and investments as cash flows through time -- and gives you the tools to warp them back and forth between present, future, and everything in between.
Features
- Time Machine (Warp) -- travel to any date and see loan state as of that moment
- PMT, NPV, IRR, MIRR -- core finance functions powered by scipy
- Loan tracking -- payments, fines, mora interest, grace periods
- High-precision Money -- Decimal arithmetic, never floats
- Amortization schedules -- French (Price) and SAC (Inverted Price)
- Flexible dates -- irregular due dates, smart month-end handling
- Type-safe interest rates -- explicit percentage handling, frequency conversions
- Percentage type -- non-temporal flat percentages for fees, fines, MDR
- Installments and Settlements -- first-class repayment plan and payment allocation
- Payment waivers -- waive fines, mora, or overdue interest per payment
- Working day calendars -- business day awareness for penalty deadlines
- Tax module -- Brazilian IOF, grossup, pluggable tax strategy
- Timezone-aware -- UTC by default, configurable globally
- Marshmallow extension -- custom fields for serialization
- SQLAlchemy extension -- column types + loan/settlement bridge with SQL-queryable balance
Installation
pip install money-warp
With optional extensions:
pip install money-warp[marshmallow] # Marshmallow fields
pip install money-warp[sa] # SQLAlchemy types + bridge
Quick Start
from datetime import datetime, timezone
from money_warp import Money, InterestRate, Loan, generate_monthly_dates
from money_warp.tz import to_date
principal = Money("10000.00")
rate = InterestRate("5% a") # 5% annually
start_date = datetime(2024, 1, 15, tzinfo=timezone.utc)
due_dates = [to_date(d) for d in generate_monthly_dates(start_date, 12)]
loan = Loan(principal, rate, due_dates)
schedule = loan.get_amortization_schedule()
print(f"Monthly payment: {schedule[0].payment_amount}")
print(f"Total interest: {schedule.total_interest}")
loan.record_payment(Money("856.07"), datetime(2024, 2, 1, tzinfo=timezone.utc))
print(f"Remaining balance: {loan.current_balance}")
Time Machine
Travel to any date and see the loan exactly as it was -- payments, interest, fines, everything filtered to that moment:
from money_warp import Warp, Loan, Money, InterestRate
from datetime import date, datetime
loan = Loan(Money("10000"), InterestRate("5% a"), [date(2024, 1, 15)])
loan.record_payment(Money("500"), datetime(2024, 1, 10))
loan.record_payment(Money("600"), datetime(2024, 2, 10))
loan.record_payment(Money("700"), datetime(2024, 3, 10))
# Warp to the past -- only payments made by that date are visible
with Warp(loan, datetime(2024, 1, 20)) as past_loan:
print(f"Balance on Jan 20: {past_loan.current_balance}")
# Warp to the future
with Warp(loan, datetime(2025, 1, 1)) as future_loan:
print(f"Balance in 2025: {future_loan.current_balance}")
# Original loan is unchanged
print(f"Present balance: {loan.current_balance}")
Documentation
Full guides, examples, and API reference at tomascorrea.github.io/money-warp.
- Quick Start
- Money and Precision
- Interest Rates
- Percentages
- Cash Flow Analysis
- Date Generation
- Time Machine
- Present Value and IRR
- Fines and Mora Interest
- Tax and IOF
- Timezone Handling
- Marshmallow Extension
- SQLAlchemy Extension
- API Reference
Contributing
Contributions are welcome! See the Contributing Guide for details.
License
MIT -- see LICENSE.
Metadata
Release files for money-warp 0.33.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 | |
|---|---|---|---|
| money_warp-0.33.0.tar.gz | 86.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| money_warp-0.33.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 198.4 kB
Release files / money_warp-0.33.0.tar.gz
| Download URL | money_warp-0.33.0.tar.gz |
|---|---|
| Size | 86.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e7709afd335f65ea73deb6e63b61cc91b0ec8df7638f08126b176591f18526a
|
|
BLAKE2b-256 checksum How to use checksums |
303a4ef37bbe25d51fc1ddb5755ac0087b725f0d905bebf1682f52a9397d567e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 14, 2026.
Transparency logRelease files / money_warp-0.33.0-py3-none-any.whl
| Download URL | money_warp-0.33.0-py3-none-any.whl |
|---|---|
| Size | 111.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bcc3eaf029b2387b6a3a4dea8baf0d76be2a9959e7aa00c557aa6e956731bcd
|
|
BLAKE2b-256 checksum How to use checksums |
1316c7a87a095067516b7a18494532ac1c93e44c7131d8df1993beec48e2977e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 14, 2026.
Transparency log