This project has been archived by its maintainers, and is no longer receiving any updates.
moneymoney
Money package for Python
Installation
pip install moneymoney
Usage
Base usages
from moneymoney.currency_codes import CurrencyCodes
from moneymoney.defaults import ONE_EUR
from moneymoney.money import Money
from moneymoney.presets import EUR
# using a string as currency code
quantity = Money(amount=1000, currency_code="EUR")
# using currency codes from this package
quantity_two = Money(amount=1000, currency_code=CurrencyCodes.EUR)
# using defaults
my_price = ONE_EUR
# using presets
my_euro = EUR(amount=1.0)
Some possible operations
You can add, subtract, multiply and divide money!
from moneymoney.money import Money
# add
money_a = Money(currency_code="EUR", amount=3.0)
money_b = Money(currency_code="EUR", amount=2.0)
money_c = money_a + money_b # equal to Money(currency_code="EUR", amount=5.0)
# subtract
money_a = Money(currency_code="EUR", amount=3.0)
money_b = Money(currency_code="EUR", amount=2.0)
money_c = money_a - money_b # equal to Money(currency_code="EUR", amount=1.0)
# multiply
money_a = Money(currency_code="EUR", amount=3.0)
money_b = money_a * 3 # equal to Money(currency_code="EUR", amount=9.0)
# divide
money_a = Money(currency_code="EUR", amount=3.0)
money_b = money_a / 3 # equal to Money(currency_code="EUR", amount=1.0)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Sponsors
Become a sponsor here
License
Metadata
Release files for moneymoney 1.1.2
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 |
|---|---|---|---|---|
| moneymoney-1.1.2.tar.gz | 16.4 kB | Without provenance | Details for moneymoney-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moneymoney-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for moneymoney-1.1.2-py3-none-any.whl |
Total release size: 33.1 kB
Release files / moneymoney-1.1.2.tar.gz
| Download URL | moneymoney-1.1.2.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
813e48e90383ea895712cb609dec0262b6105f0eeca1804fb6f993c0fb1ed612
|
|
BLAKE2b-256 checksum How to use checksums |
fa83021a02993d464bababd2ee6ca76bdb4c7595f5a3a42ea318aa5149c3271d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.18
|
Release files / moneymoney-1.1.2-py3-none-any.whl
| Download URL | moneymoney-1.1.2-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e840d4e92609e0dd904ca99e5747f81dd7baefc90a9c76b805a57c23f43c7343
|
|
BLAKE2b-256 checksum How to use checksums |
b4e9c1eb195b593b58e51067be5738f70d81492b12439b9480118bfaf1412277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.18
|
Security for moneymoney 1.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.