py-money
Money module for python
What it is and what it does
py-money is a Money class for Python that enforces correct decimal representation for each currency—so 3.678 USD or 5.5 JPY are rejected as invalid. It wraps amounts as immutable objects tied to a specific Currency, supporting arithmetic (addition, division, multiplication) and comparison operators with automatic rounding to the currency's correct precision after each operation. The library depends on babel for locale-aware formatting.
The package is designed for straightforward monetary calculations: online stores computing sales tax, multi-currency pricing, and locale-specific display. It explicitly does not support currency conversion or operations requiring arbitrary precision beyond what the currency defines. Rounding happens after each operation, which is correct for retail math but can produce unexpected results if expressions are reordered—the documentation warns against this.
Use it for:
- Computing sales tax and totals in an online store across multiple currencies with correct rounding.
- Formatting prices for display in different locales (e.g., '$3.24' for en_US, '€5.56' for en_UK).
- Validating that monetary amounts conform to their currency's decimal precision before storage or transmission.
- Performing basic arithmetic on money objects (addition, division, multiplication) with automatic rounding per currency rules.
- Preventing accidental cross-currency operations by raising errors when mixing currencies in calculations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Represents monetary amounts with currency-aware precision, enforcing correct decimal places per currency and supporting arithmetic operations, comparisons, and locale-specific formatting.
No. While the package is lightweight and permissively licensed, it has been abandoned since 2020 with no maintenance for over 4 years. For new projects, choose an actively maintained alternative. For existing codebases already using py-money, it may continue to work if your Python version and babel compatibility remain stable, but you have no path to fixes or support.
Install
py-money on PyPI
pip
pip install py-moneyuv
uv add py-moneypoetry
poetry add py-moneyInstalling py-money
Before you install
Low install friction with a single runtime dependency (babel). However, the package is abandoned—last release was 2020-01-29 and last commit 2022-04-12—so expect no maintenance, bug fixes, or updates.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions, making it safe to adopt from a licensing perspective.
Quickstart
pip install py-money
from money.money import Money
from money.currency import Currency
m = Money('9.95', Currency.USD)
print(m.format('en_US')) # '$9.95'
Verify before relying
- Whether the package works correctly with modern Python versions beyond what the fact sheet specifies
- Whether babel's evolution since 2020 has introduced compatibility issues with py-money
- Real-world performance or correctness issues in production use since abandonment
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — babel |
| Maintenance | abandoned — 2,389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 808,931/month — #5,011 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_money-0.5.0-py3-none-any.whl
Keywords: money, currency
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
django-mathfiltersProvides Django template filters for basic…
permissive · top 15,000 on PyPI
iso4217Provides ISO 4217 currency data as a Python…
permissive · top 15,000 on PyPI
pricesHandles monetary amounts with currency…
permissive · top 15,000 on PyPI
py-moneyedProvides Money and Currency classes for…
permissive · top 5,000 on PyPI
django-moneyAdds Money and currency field types to Django…
permissive · top 5,000 on PyPI
ccyProvides a dictionary of currency objects with…
permissive · top 15,000 on PyPI
roundersProvides drop-in replacements for Python's…
permissive · top 15,000 on PyPI
forex-pythonFetches current and historical foreign exchange…
permissive · top 15,000 on PyPI
sigfigRounds numbers by significant figures, decimal…
permissive · top 5,000 on PyPI
price-parserExtracts price amounts and currency symbols…
permissive · top 5,000 on PyPI