Documentation
-------------
The full documentation is at https://dj-currencies.readthedocs.io.
Quickstart
----------
For Django 2 support, please use version 0.1.2.
Django 3 support added in version 1.0.
Django 4 support from version >=1.1.
Install djcurrencies::
pip install dj-currencies
Add it to your `INSTALLED_APPS`:
.. code-block:: python
INSTALLED_APPS = (
...
'dj_currencies',
...
)
Settings
========
.. code-block:: python
DJANGO_CURRENCIES = {
'DEFAULT_BACKEND': 'djmoney_rates.backends.OpenExchangeBackend',
'OPENEXCHANGE_APP_ID': '',
'BASE_CURRENCIES': ['USD'],
'MAX_CACHE_DAYS': 7
}
**DEFAULT_BACKEND**: The selected backend to sync exchange rates
**OPENEXCHANGE_APP_ID**: Must be configured if you use **OpenExchangeBackend**
**BASE_CURRENCIES**: A list of base currencies to use. At the time of this version, you will only be able to convert currency from any one of the base currency to target currency.
**MAX_CACHE_DAYS**: Only use the cache within this time limit. If exchange rates was not synced within the time frame, an exception will thrown
.. NOTE::
You will need to have at least "OPENEXCHANGE_APP_ID" configured if you use **OpenExchangeBackend**
Features
--------
* [open exchange rates](openexchangerates.org) integration
* Extensible backend design, hook your own exchange rate sources
* Multi base currencies support, no double conversion to lose precision
* Store historical exchange rates
* offline currency conversion
Running Tests
-------------
Does the code actually work?
::
source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py
Raw data
{
"_id": null,
"home_page": "https://github.com/CoverGenius/dj-currencies",
"name": "dj-currencies",
"maintainer": "Lihan Li",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "lihan@covergenius.com",
"keywords": "currency,openexchangerates,django",
"author": "Lihan",
"author_email": "lihan@covergenius.com",
"download_url": "https://files.pythonhosted.org/packages/fe/a0/1d963686c1bff048f114f9273815cbac0fc7a5db471bd06697a71858bf86/dj_currencies-1.1.0.tar.gz",
"platform": null,
"description": "Documentation\n-------------\n\nThe full documentation is at https://dj-currencies.readthedocs.io.\n\nQuickstart\n----------\n\nFor Django 2 support, please use version 0.1.2.\nDjango 3 support added in version 1.0.\nDjango 4 support from version >=1.1.\n\nInstall djcurrencies::\n\n pip install dj-currencies\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'dj_currencies',\n ...\n )\n\nSettings\n========\n\n\n.. code-block:: python\n\n DJANGO_CURRENCIES = {\n 'DEFAULT_BACKEND': 'djmoney_rates.backends.OpenExchangeBackend',\n 'OPENEXCHANGE_APP_ID': '',\n 'BASE_CURRENCIES': ['USD'],\n 'MAX_CACHE_DAYS': 7\n }\n\n**DEFAULT_BACKEND**: The selected backend to sync exchange rates\n\n**OPENEXCHANGE_APP_ID**: Must be configured if you use **OpenExchangeBackend**\n\n**BASE_CURRENCIES**: A list of base currencies to use. At the time of this version, you will only be able to convert currency from any one of the base currency to target currency.\n\n**MAX_CACHE_DAYS**: Only use the cache within this time limit. If exchange rates was not synced within the time frame, an exception will thrown\n\n.. NOTE::\n You will need to have at least \"OPENEXCHANGE_APP_ID\" configured if you use **OpenExchangeBackend**\n\n\n\nFeatures\n--------\n\n* [open exchange rates](openexchangerates.org) integration\n* Extensible backend design, hook your own exchange rate sources\n* Multi base currencies support, no double conversion to lose precision\n* Store historical exchange rates\n* offline currency conversion\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source <YOURVIRTUALENV>/bin/activate\n (myenv) $ python runtests.py\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A reusable Django app that integrates https://openexchangerates.org/",
"version": "1.1.0",
"split_keywords": [
"currency",
"openexchangerates",
"django"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5475730b15923c97846ed81fd72de848e9e113916fe04d1a3e43e2f59a271cdf",
"md5": "7b132b53640c9bd6c9e65ee6425efa49",
"sha256": "0cb8a598a9e899ab1a0ec80037f4bed90aa5d84716cbd574cbfea5885d7efdfb"
},
"downloads": -1,
"filename": "dj_currencies-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7b132b53640c9bd6c9e65ee6425efa49",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 11348,
"upload_time": "2023-01-16T15:09:35",
"upload_time_iso_8601": "2023-01-16T15:09:35.916277Z",
"url": "https://files.pythonhosted.org/packages/54/75/730b15923c97846ed81fd72de848e9e113916fe04d1a3e43e2f59a271cdf/dj_currencies-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fea01d963686c1bff048f114f9273815cbac0fc7a5db471bd06697a71858bf86",
"md5": "3a97962e52599c51564f23ee31d4fd85",
"sha256": "14bbc702dc67afb725c7b5405b1960064ae5f8dbde652d0ccde3115004329c6b"
},
"downloads": -1,
"filename": "dj_currencies-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3a97962e52599c51564f23ee31d4fd85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 8222,
"upload_time": "2023-01-16T15:09:37",
"upload_time_iso_8601": "2023-01-16T15:09:37.061109Z",
"url": "https://files.pythonhosted.org/packages/fe/a0/1d963686c1bff048f114f9273815cbac0fc7a5db471bd06697a71858bf86/dj_currencies-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-16 15:09:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "CoverGenius",
"github_project": "dj-currencies",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "dj-currencies"
}