Metadata-Version: 2.4
Name: dj-currencies
Version: 1.8.0
Summary: A reusable Django app that integrates https://openexchangerates.org/
License: MIT
License-File: LICENSE
Keywords: currency,openexchangerates,django
Author: Lihan
Author-email: lihan@covergenius.com
Maintainer: Lihan Li
Maintainer-email: lihan@covergenius.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: django (>=3.2)
Requires-Dist: psycopg2-binary (>=2.7)
Project-URL: Documentation, https://dj-currencies.readthedocs.io
Project-URL: Homepage, https://github.com/CoverGenius/dj-currencies
Project-URL: Repository, https://github.com/CoverGenius/dj-currencies
Description-Content-Type: text/x-rst

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

