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
Close
Hashes for currency_open_exchange-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c08f3391927532a5d0ae706a5c08dce7295d97e0097fb3df739a88989a90d1 |
|
MD5 | 0dbf5f5f74345f08ca78223ae5f4b8a3 |
|
BLAKE2b-256 | 43d6b3b8d1d9f77ab0aeae747a31b7f703a0460bc80ad2f0238ecffd1ebfbe92 |
Close
Hashes for currency_open_exchange-0.0.6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf93bad2720b985194e45d060eaae38a4860afefb2cf1b79f7c1f3f8fb245990 |
|
MD5 | 12a37fb3bca317c797f30d3d88599605 |
|
BLAKE2b-256 | 3ecf2a3e9a9ab0934df7a9793c6309de7e191593a21145a533e24f6f4709e960 |