semvec/pypi-packages huggingface dataset:
django-xe-currencies 0.0.1
Django-based currency exchange app synced with XE datafeed API.
Keywords: django currency XE sync

django-xe-currencies
====================


.. image:: https://pypip.in/v/django-xe-currencies/badge.png
    :target: https://crate.io/packages/django-xe-currencies/
    :alt: Latest PyPI version

.. image:: https://pypip.in/d/django-xe-currencies/badge.png
    :target: https://crate.io/packages/django-xe-currencies/
    :alt: Number of PyPI downloads


**django-xe-currencies** allows you to create your own currency exchange
API synced with XE datafeed service.

Quickstart:
===========

Install django-xe-currencies:

::

    $ pip install django-xe-currencies

Add tinymce and xe\_currencies to INSTALLED\_APPS in settings.py for
your project:

::

    INSTALLED_APPS = (
        ...
        'xe_currencies',
    )

Add xe\_currencies.urls to urls.py for your project:

::

    urlpatterns = patterns('',
        ...
        url(r'^currencies/', include('xe_currencies.urls'))
    )

Specify XE\_DATAFEED\_URL in your settings.py:

::

    XE_DATAFEED_URL = 'http://www.xe.com/dfs/datafeed2.cgi?xeuser'

To make a synchronization with XE datafeed run:

::

    python manage.py xe_sync

Access api at the next url:

::

    http://yourdomain.com/currencies/api/v1/currencies/exchange/?from=EUR&to=USD&amount=100&format=json

This example will return exchange data in JSON format:

::

    {"from": "EUR", "to": "USD", "result": "143.45 USD"}

To retrieve currencies list use:

::

    http://example.com/currencies/api/v1/currencies/?format=json

Using exchange in your code:

::

    from xe_currencies.api.resources import exchange

    exchange('EUR', 'USD', 100)