Currency conversion
Project description
Currency conversion
Quickstart
Install currency_open_exchange:
pip install currency-open-exchange
Then use it in a project:
import currency_open_exchange
In order to save exchange rates to your database, add currency_open_exchange to your INSTALLED_APPS in your project’s settings:
INSTALLED_APPS = (
...
'currency_open_exchange',
...
)
Setup the Open Exchange Rates backend
Open an account at https://openexchangerates.org/ if you don’t have one already. Then, add this to your project’s settings:
'EXCHANGE_APP_ID': 'YOUR APP ID HERE', 'EXCHANGE_BASE_CURRENCY': 'USD' (optional, only USD for free accounts)
For more information on the Open Exchange Rates API, see https://openexchangerates.org/
Pull the latest Exchange Rates
Once your backend is setup, get the latest exchange rates:
$ ./manage.py update_rates
Convert from one currency to another
Here’s an example of converting 10 American Dollars to Chinese Renminbi:
from currency_open_exchange.utils import convert
amount, currency = convert(10, "EUR", "BRL")
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 currency_open_exchange-0.0.6.tar.gz.
File metadata
- Download URL: currency_open_exchange-0.0.6.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43c08f3391927532a5d0ae706a5c08dce7295d97e0097fb3df739a88989a90d1
|
|
| MD5 |
0dbf5f5f74345f08ca78223ae5f4b8a3
|
|
| BLAKE2b-256 |
43d6b3b8d1d9f77ab0aeae747a31b7f703a0460bc80ad2f0238ecffd1ebfbe92
|
File details
Details for the file currency_open_exchange-0.0.6-py2-none-any.whl.
File metadata
- Download URL: currency_open_exchange-0.0.6-py2-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf93bad2720b985194e45d060eaae38a4860afefb2cf1b79f7c1f3f8fb245990
|
|
| MD5 |
12a37fb3bca317c797f30d3d88599605
|
|
| BLAKE2b-256 |
3ecf2a3e9a9ab0934df7a9793c6309de7e191593a21145a533e24f6f4709e960
|