Skip to content

Commit 88c0106

Browse files
author
ravi
committed
Readme & docs for symboles currency names functions
1 parent 9b479b7 commit 88c0106

2 files changed

Lines changed: 38 additions & 5 deletions

File tree

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ forex-python
44
[![Coverage Status](https://coveralls.io/repos/github/MicroPyramid/forex-python/badge.svg?branch=master)](https://coveralls.io/github/MicroPyramid/forex-python?branch=master)
55
[![Code Health](https://landscape.io/github/MicroPyramid/forex-python/master/landscape.svg?style=plastic)](https://landscape.io/github/MicroPyramid/forex-python/master)
66

7+
[![Python Support](https://img.shields.io/badge/python-2.7%2C%203.3%2C%203.4%2C%203.5-blue.svg)](https://pypi.python.org/pypi/forex-python)
8+
9+
710
Free Foreign exchange rates and currency conversion.
811

912
Features:
@@ -68,12 +71,19 @@ Convert amount from USD to INR based on 2010-03-01 rates
6871

6972
RatesNotAvailableError for invalid currency codes and missing currency code from source:
7073
```python
71-
>>> c.get_rate('XYZ', 'INR')
72-
Traceback (most recent call last):
73-
RatesNotAvailableError: Currency XYZ => INR rate not available for Date latest.
74+
>>> c.get_rate('XYZ', 'INR')
75+
Traceback (most recent call last):
76+
RatesNotAvailableError: Currency XYZ => INR rate not available for Date latest.
77+
```
78+
79+
Get currency symbol using currency code
80+
```python
81+
>>> from forex_python.converter import CurrencyCodes
82+
>>> c = CurrencyCodes()
83+
>>> print c.get_symbol('GBP')
84+
£
7485
```
7586

76-
Compleate [Documentation](http://forex-python.readthedocs.org/en/latest/?badge=latest)
87+
Complete [Documentation](http://forex-python.readthedocs.org/en/latest/?badge=latest)
7788

7889
We welcome your feedback and support. found bug raise github issue.
79-

docs/source/usage.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Usage Examples:
22
===============
33

4+
Currency Rates
5+
--------------
46
1. list all latest currency rates for "USD"::
57
>>> from forex_python.converter import CurrencyRates
68
>>> c = CurrencyRates()
@@ -32,3 +34,24 @@ Usage Examples:
3234
datetime.datetime(2014, 5, 23, 18, 36, 28, 151012)
3335
>>> c.convert('USD', 'INR', 10, date_obj)
3436
585.09
37+
38+
Currency Symboles & Codes
39+
-------------------------
40+
1. Get Currency symbol Using currency code::
41+
>>> from forex_python.converter import CurrencyCodes
42+
>>> c = CurrencyCodes()
43+
>>> c.get_symbol('GBP')
44+
u'\xa3'
45+
>>> print c.get_symbol('GBP')
46+
£
47+
>>> print c.get_symbol('EUR')
48+
49+
50+
2. Get Currency Name using currency code::
51+
>>> c.get_currency_name('EUR')
52+
u'European Euro'
53+
>>> c.get_currency_name('INR')
54+
u'Indian rupee'
55+
56+
57+

0 commit comments

Comments
 (0)