Install & Compatibility
Where this runs
tested against v1.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 50.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.1s · import 0.000s · 51MB
49MB installed
● package 49MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Money
✓ from prices import Money
✗ from prices import Price
TaxedMoney
✓ from prices import TaxedMoney
discount
✓ from prices import discount
Basic usage of Price, PriceRange, and TaxedMoney classes.
from prices import Price, Money, TaxedMoney, PriceRange
# Create a price
price = Price(currency='USD', net=Money(10, 'USD'), gross=Money(12, 'USD'))
print(price)
# Price arithmetic
p1 = Price(currency='USD', net=Money(5, 'USD'), gross=Money(6, 'USD'))
p2 = Price(currency='USD', net=Money(3, 'USD'), gross=Money(4, 'USD'))
print(p1 + p2)
# Create a price range
pr = PriceRange(start=p1, stop=p2)
print(pr)
# TaxedMoney
tm = TaxedMoney(net=Money(100, 'USD'), gross=Money(123, 'USD'))
print(tm)
Upgrade
Version history
1.1.1latest on PyPI · released Oct 7, 2022
Audit
Dependencies
babeloptionalOptional dependency for formatting prices with locale