skillfed

forex-python

Free foreign exchange rates and currency conversion.

forex-python v1.9.2 554.5K downloads/30d#6,033 on PyPI709
Permissive license AGING released

What it is and what it does

Forex-python is a library that wraps public foreign exchange and cryptocurrency price APIs to provide currency conversion and rate lookup in Python. It queries theratesapi.com for current and historical forex rates (published by the European Central Bank) and CoinDesk for Bitcoin prices, then exposes them through a simple object-oriented interface. You instantiate a CurrencyRates or BtcConverter class and call methods like get_rate(), convert(), or get_latest_price() to retrieve or transform currency values.

The library supports converting between any currency pair, looking up historical rates back to 1999, fetching Bitcoin prices in any fiat currency, and converting fiat amounts to Bitcoin. It also provides currency symbol and name lookup. Because it depends only on requests and simplejson, it has minimal install friction, though it does require live internet connectivity to the upstream APIs and is subject to their availability and rate limits.

Use it for:

  • Build a web application that displays real-time currency exchange rates or allows users to convert between currencies.
  • Fetch historical exchange rates for financial analysis or reconciliation of past transactions.
  • Convert prices in an e-commerce system from one currency to another based on live rates.
  • Retrieve Bitcoin prices in multiple fiat currencies for a cryptocurrency tracking or portfolio app.
  • Generate reports that include currency conversions using historical rates from a specific date.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Fetches current and historical foreign exchange rates and Bitcoin prices from public APIs, and converts between currencies or to Bitcoin.

Yes, with conditions. The package is straightforward to install and has no known vulnerabilities. However, it is aging (449 days since last release) and depends entirely on external APIs for data. Use it if you need simple, lightweight currency conversion without building your own API integration, but be aware that upstream API availability and rate limits are outside the maintainer's control. For production systems, verify the reliability of theratesapi.com and CoinDesk before committing.

Install

forex-python on PyPI

pip

pip install forex-python

uv

uv add forex-python

poetry

poetry add forex-python

Installing forex-python

Before you install

Low friction install with only two lightweight runtime dependencies (requests and simplejson). Maintenance is aging—last release was 449 days ago—but the repository remains active with a recent commit on 2025-05-22 and no archived status.

License in practice

MIT license (permissive) allows commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

pip install forex-python

from forex_python.converter import CurrencyRates
c = CurrencyRates()
rate = c.get_rate('USD', 'INR')
converted = c.convert('USD', 'INR', 10)

Requires internet access to theratesapi.com (for forex rates) and CoinDesk (for Bitcoin prices); rates are updated daily at 3PM CET and Bitcoin prices every minute.

Verify before relying

  • Whether the package's data sources (theratesapi.com and CoinDesk) have SLAs or uptime guarantees relevant to production use.
  • Current status of the RatesNotAvailableError mentioned in the description—whether upgrading to 1.6+ fully resolves it or if it can still occur.

Package facts

License not declared (permissive)
Python support supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,<4,>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — requests, simplejson
Maintenance aging — 449 days since the last release
Last repo commit
First released
Downloads 554,527/month — #6,033 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: forex_python-1.9.2-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Internationalization

Tags

currency conversionforex ratesexchange ratesbitcoin pricecurrency converterhistorical exchange ratesfiat to crypto conversion
currency-conversionforex-ratesbitcoin-prices

More Internationalization packages