A simple interface to work with money-related entities.
Project description
A simple interface to work with money-related entities.
Installation
The current stable release:
pip install simple_money
or:
easy_install simple_money
or from source:
$ sudo python setup.py install
Usage
Arithmetic operations:
>>> Money(100, 'EUR') + Money(50, 'EUR')
150 EUR
>>> Money(100, 'EUR') - Money(50, 'EUR')
50 EUR
>>> Money(100, 'EUR') * 2
200 EUR
Also you can manipulate with money in different currencies:
>>> Money(100, 'EUR') + Money(50, 'USD')
100 EUR, 50 USD
>>> Money(100, 'EUR') - Money(50, 'USD')
100 EUR, -50 USD
>>> (Money(100, 'EUR') - Money(50, 'USD')) * 2
200 EUR, -100 USD
With multiply currencies you are able to get concrete currency value in the following way:
>>> value = Money(100, 'EUR') + Money(50, 'USD')
>>> value.EUR
100 EUR
>>> value.USD
50 USD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple-money-0.1.2.tar.gz.
File metadata
- Download URL: simple-money-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2124bb9863ec80080dc66ef28569f17c0eb5f319ec7fa782ad45b06590ad4ef
|
|
| MD5 |
cf22f5238c3d8b99abe75222cd360d6d
|
|
| BLAKE2b-256 |
92a9b05265a3adcc80c50d04c99d24b03c61b271c26c780e448acc1f1804ce41
|
File details
Details for the file simple_money-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: simple_money-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2f67c67cbf57268ff609b66f7aac7f9da83c15e2dfc2a902e0697b7beb0a64
|
|
| MD5 |
87a8611508bf65a45b5f1b3bdb0a5eb1
|
|
| BLAKE2b-256 |
b5febe56eab3ce96a07e2a5d48403693f470352d1f6f7e9f1294aede3dee6fde
|