About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconccy Publisher's description

A useful python module for currencies. Not all currencies in the world are supported yet. You are welcome to join and add more.

A useful python module for currencies. Not all currencies in the world are supported yet. You are welcome to join and add more.

The module compile a dictionary of currency objects containing information useful in financial analysis.

The module depends on pytz the Olson tz database for Python and on python-dateutil].

For downloads goto the Python package index http://pypi.python.org/pypi/ccy/.

Any comments are welcome.

easy_install ccy


pip install ccy

or download, uncompress and type

python setup.py install

Running tests¶

From version 0.3.8 onwards

>>> from ccy import runtests
>>> runtests()
Ran 21 tests in 0.002s



>>> from ccy import test
>>> test.run()

Currency object¶

To use it:

>>> import ccy
>>> c = ccy.currency('aud')
>>> c.printinfo()
code: AUD
twolettercode: AD
roundoff: 4
default_country: AU
isonumber: 036
order: 3
name: Australian Dollar
>>> c.as_cross()
>>> c.as_cross('/')

a currency object has the following properties:

* code: the ISO 4217 code.
* twolettercode: two letter code (can't remeber the ISO number). Very useful for financial data providers such as Bloomberg.
* default_country: the default ISO 3166-1 alpha-2 country code for the currency.
* isonumber: the ISO 4217 number.
* name: the name of the currency.
* order: default ordering in currency pairs (more of this below).
* roundoff: number of decimal places

Some short cuts

>>> import ccy
>>> ccy.cross('aud')
>>> ccy.crossover('eur')
>>> ccy.crossover('chf')

Note, the Swiss franc cross is represented as 'USD/CHF', while the Aussie Dollar and Euro crosses are represented with the USD as denominator. This is the market convention which is handled by the order property of a currency object.
Country information¶

To use it:

>>> import ccy
>>> c = ccy.country('us')
>>> c
u'United States'
>>> ccy.countryccy('us')

Not all the country codes are standard ISO 3166-1 alpha-2. There is a function for adding extra pseudo-countries

import ccy

Set a new country with code 'EU', currency 'EUR' named 'Eurozone'. This country is set in the library already.


System Requirements:

No special requirements.
Program Release Status:
Program Install Support: Install and Uninstall

Is ccy your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)