Giter Club home page Giter Club logo

django-exchange's Introduction

django-exchange

Currency, exchange rate and conversions support for django projects.

Install

django-exchange is available on pypi repositories so youre free to use pip or easy_install:

$ pip install django-exchange

Or you might want to install from source:

$ wget https://github.com/metglobal/django-exchange/archive/django-exchange-xxx.zip
$ unzip django-exchange-xxx.zip
$ cd django-exchange-xxx
$ python setup.py install

Add exchange into your INSTALLED_APPS settings of your django project:

INSTALLED_APPS += [
    'exchange',
]

Don't forget to sync your db to create corresponding database tables:

$ python manage.py syncdb

Populating Data

django-exchange supports populating currency and exchange rates using a service provider automatically. Currently it has built in support for openexchangerates.org service. It is only a matter of supplying an api key obtained from http://openexchangerates.org as django settings using the key OPENEXCHANGERATES_API_KEY:

OPENEXCHANGERATES_API_KEY = '<YOU_API_KEY_HERE>'

Now you can populate you currency and exchange rates magically by typing:

$ python manage.py update_rates

Quickstart

Currency conversions is dead easy. There are auxilaray methods helps you calculate conversions using populated exchange rates under exchange.conversions module.

Take a look at the example below:

>>> from exchange.conversion import Price, convert
>>> my_price = Price(50, 'USD')
>>> convert(my_price, 'EUR')
<Price(value=Decimal('36.68585000'), currency='EUR')>

Documentation

Coming soon...

Todo

  • Convenient template tags
  • Django price field implementation supporting currency conversions
  • Easier api with convenient refaactorings
  • A few more builtin exchange rate provider

django-exchange's People

Contributors

kadirpekel avatar baratrion avatar fergalwalsh avatar huseyinyilmaz avatar tatterdemalion avatar cordery avatar rvause avatar zekzekus avatar cagatay avatar titusz avatar

Watchers

Greg McCoy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.