• Stars
    star
    596
  • Rank 75,095 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io

forex-python

travis-ci

coveralls

Code Health

pypi

Forex Python is a Free Foreign exchange rates and currency conversion.

Note: Install latest forex-python==1.6 to avoid RatesNotAvailableError

RunCode

Features of Forex Python: ---------- List all currency rates. - BitCoin price for all currencies. - Converting amount to BitCoins. - Get historical rates for any day since 1999. - Conversion rate for one currency(ex; USD to INR). - Convert amount from one currency to other.('USD 10$' to INR). - Currency symbols. - Currency names.

Currency Source:

https://theforexapi.com is a free API for current and historical foreign exchange rates published by European Central Bank. The rates are updated daily 3PM CET.

BitCoin Price Source:

Bitcoin prices calculated every minute. For more information visit [CoinDesk](http://www.coindesk.com).

Installation

  • Install using python package

    pip install forex-python
    
        Or directly cloning the repo:
    
    python setup.py install

Usage Examples:

  • Initialize class

    python
    >>> from forex_python.converter import CurrencyRates
    >>> c = CurrencyRates()
  • list all latest currency rates for "USD"

    python
    >>> c.get_rates('USD')
    {u'IDR': 13625.0, u'BGN': 1.7433, u'ILS': 3.8794, u'GBP': 0.68641, u'DKK': 6.6289, u'CAD': 1.3106, u'JPY': 110.36, u'HUF': 282.36, u'RON': 4.0162, u'MYR': 4.081, u'SEK': 8.3419, u'SGD': 1.3815, u'HKD': 7.7673, u'AUD': 1.3833, u'CHF': 0.99144, u'KRW': 1187.3, u'CNY': 6.5475, u'TRY': 2.9839, u'HRK': 6.6731, u'NZD': 1.4777, u'THB': 35.73, u'EUR': 0.89135, u'NOK': 8.3212, u'RUB': 66.774, u'INR': 67.473, u'MXN': 18.41, u'CZK': 24.089, u'BRL': 3.5473, u'PLN': 3.94, u'PHP': 46.775, u'ZAR': 15.747}
  • Get conversion rate from USD to INR

    python
    >>> c.get_rate('USD', 'INR')
    67.473
  • Convert amount from USD to INR

    python
    >>> c.convert('USD', 'INR', 10)
    674.73
  • Force use of Decimal

    python
    >>> from forex_python.converter import CurrencyRates
    >>> c = CurrencyRates(force_decimal=True)
    >>> c.convert('USD', 'INR', Decimal('10.45'))
    705.09
    >>> c.convert('USD', 'INR', 10)
    DecimalFloatMismatchError: convert requires amount parameter is of type Decimal when use_decimal=True
  • Detect use of Decimal

    python
    >>> from forex_python.converter import CurrencyRates
    >>> c = CurrencyRates()
    >>> c.convert('USD', 'INR', Decimal('10.45'))
    705.09
    >>> c.convert('USD', 'INR', 10)
    674.73
  • Get latest Bitcoin price.

    python
    >>> from forex_python.bitcoin import BtcConverter
    >>> b = BtcConverter() # force_decimal=True to get Decimal rates
    >>> b.get_latest_price('USD')
    533.913
  • Convert Amount to Bitcoins based on latest exchange price.

    python
    >>> b.convert_to_btc(400, 'USD')
    0.7492699301118473
  • Get currency symbol using currency code

    python
    >>> from forex_python.converter import CurrencyCodes
    >>> c = CurrencyCodes()
    >>> print c.get_symbol('GBP')
    £

You can view the complete Documentation Here

Visit our Python Development page Here

We welcome your feedback and support, raise github ticket if you want to report a bug. Need new features? Contact us here

More Repositories

1

Django-CRM

Open Source CRM based on Django
Python
1,541
star
2

opensource-job-portal

opensource jobportal in python django
HTML
311
star
3

django-blog-it

django blog - complete customization and ready to use with one click installer
HTML
224
star
4

django-mfa

Django-mfa (Multi Factor Authentication) is a simple package to add extra layer of security to your django web application. It gives web app a randomly changing password as an extra protection and supports u2f too
Python
174
star
5

docker-box

Web Interface to manage full blown docker containers and images.
Python
111
star
6

MicroSite

Full featured and completely customizable django site for organizations.
CSS
79
star
7

django-web-profiler

Django package to log request values such as device, IP address, user CPU time, system CPU time, No of queries, SQL time, no of cache calls, missing, setting data cache calls for a particular URL with a basic UI.
Python
79
star
8

micro-finance

Free Micro Finance Software
Python
75
star
9

django-webpacker

A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.
Python
73
star
10

django-simple-forum

full featured forum, easy to integrate and use.
Python
67
star
11

forex-rates-mobile-app

Foreign exchange rates, Currency converter mobile app using ReactNative
JavaScript
50
star
12

react-crm

CRM UI developed in reactjs for Django-CRM
JavaScript
44
star
13

microurl

python library for url minification.
Python
44
star
14

django-simple-pagination

django pagination as you want it to be
Python
44
star
15

django-payu

payu payment gateway integration for django projects
Python
39
star
16

flutter-crm

CRM app developed in flutter for Django-CRM
Dart
35
star
17

django-email-gateway

A django package which act as a gateway to send and receive email with amazon SES.
Python
28
star
18

deploy-python

deploy python, django flask projects with fabric
Python
26
star
19

knol-bits

A curated list of awesome Linux, Django, Python, flutter, react, salesforce, AWS, VAPT and other programming languages or resources that we use internally.
22
star
20

microsocial

Collection of Social APIs (Facebbok, Twitter, Linkedin, GitHub)
Python
20
star
21

fetch-tweets

Fetch tweets using javascript
JavaScript
17
star
22

RaspIce

DarkIce on RaspberryPI
C++
16
star
23

Mongo-Slice

CSS
16
star
24

ngo-cms

Free opensource CMS for non profit organisations.
CSS
8
star
25

cicd-tutorial

This Sample Django project is used in youtube video to demonstrate CI/CD using Gitlab and Docker
Python
8
star
26

git-daily-reports

Python
6
star
27

django-url-shortener

Python
6
star
28

Responsive-Advert-Slider

CSS
4
star
29

react-radio-player

Opensource online radio player UI developed in react. For learning purpose.
JavaScript
4
star
30

django-tutorial

Django hands on tutorial
HTML
3
star
31

salesforce-b2b-commerce

Apex
3
star
32

angular-jobportal-ui

PeelJobs UI in angular
HTML
2
star
33

flutter-radio-player

Radio player app
Dart
2
star
34

micropyramid.github.io

MicroPyramid Opensource projects
HTML
2
star
35

meetup

Python
1
star
36

angular-crm

Angular CRM UI for bottleCRM
TypeScript
1
star
37

CI-CD

CI/CD Templates
1
star