
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Forex Python is a free library for foreign exchange rates and currency conversion, supporting Python 3.6 and above.
Note: Install the latest version (
forex-python>=1.6
) to avoidRatesNotAvailableError
.
theratesapi.com provides current and historical foreign exchange rates published by the European Central Bank. Rates are updated daily at 3PM CET.
Bitcoin prices are updated every minute. For more information, visit CoinDesk.
Install via pip:
pip install forex-python
Or clone the repository and install manually:
git clone https://github.com/MicroPyramid/forex-python.git
cd forex-python
python3 setup.py install
Initialize the class:
from forex_python.converter import CurrencyRates
c = CurrencyRates()
List all latest currency rates for "USD":
c.get_rates('USD')
# Example output: {'INR': 83.12, 'EUR': 0.92, ...}
Get conversion rate from USD to INR:
c.get_rate('USD', 'INR')
# Example output: 83.12
Convert amount from USD to INR:
c.convert('USD', 'INR', 10)
# Example output: 831.2
Force use of Decimal:
from decimal import Decimal
c = CurrencyRates(force_decimal=True)
c.convert('USD', 'INR', Decimal('10.45'))
# Example output: 868.75
Get latest Bitcoin price:
from forex_python.bitcoin import BtcConverter
b = BtcConverter()
b.get_latest_price('USD')
# Example output: 67000.0
Convert amount to Bitcoins:
b.convert_to_btc(400, 'USD')
# Example output: 0.00597
Get currency symbol using currency code:
from forex_python.converter import CurrencyCodes
codes = CurrencyCodes()
codes.get_symbol('GBP')
# Example output: '£'
For complete documentation, see the forex-python docs.
FAQs
Free foreign exchange rates and currency conversion.
We found that forex-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.