Metadata-Version: 2.0
Name: currency-open-exchange
Version: 0.0.5
Summary: Currency conversion
Home-page: https://github.com/MaistrenkoAnton/Currency-Open-Exchange
Author: Anton Maistrenko
Author-email: it2015maistrenko@gmail.com
License: BSD
Keywords: currency-open-exchange
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10

=============================
currency-open-exchange
=============================

Currency conversion

# WORK IN PROGRESS.


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',


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 Euros to Brazilian Reais:

.. code-block:: python

    from moneyed import Money
    from currency_open_exchange.utils import convert
    amount, currency = convert(10, "EUR", "BRL")


