Skip to main content

Simple Currency Converter

A simple Python package for currency conversion using the Currency API.

Installation

pip install simple_currency_converter

Usage

As a Python module

from simple_currency_converter import convert

# Convert 100 USD to AUD
result = convert("usd", "aud", 100)
print(f"100 USD = {result:.2f} AUD")

Available currencies

You can access currency code dictionaries:

from simple_currency_converter import common_codes, crypto_codes, all_codes

# Print available common currencies
print(common_codes)

As a command-line tool

Basic conversion:

currency-convert usd aud 100

This will output something like:

100.0 USD = 152.34 AUD

List available currencies:

# List common currencies
currency-convert --list-common

# List cryptocurrency codes
currency-convert --list-crypto

# List all supported currencies
currency-convert --list-all

Development

Running tests

The project includes a comprehensive test suite using pytest. To run the tests:

  1. Clone the repository
  2. Install the package in development mode:
# Install package in development mode
pip install -e .

# Install test dependencies
pip install pytest pytest-cov
  1. Run the tests:
# Run all tests
pytest

# Run tests with coverage report
pytest --cov=simple_currency_converter

GitHub Actions

This project uses GitHub Actions for continuous integration. Tests are automatically run on push and pull requests to the main branch, across multiple Python versions.

License

MIT

Metadata

Release files for simple-currency-converter 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-currency-converter 0.1.2
File Size Uploaded
simple_currency_converter-0.1.2.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-currency-converter 0.1.2
File Interpreter ABI Platform
simple_currency_converter-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / simple_currency_converter-0.1.2.tar.gz

Download URL simple_currency_converter-0.1.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b936149f34e3b7cbadb853c5951e5afaedb06a0c5441fbda7b6423a30611be5e
BLAKE2b-256 checksum
How to use checksums
648efab5abdddb743d2c97c3ed07d694ef244713af32a8778a058f1f2bafd9fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / simple_currency_converter-0.1.2-py3-none-any.whl

Download URL simple_currency_converter-0.1.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50d4810bff93eef2c8981aefb6ffcde2988e5fdf6919b3aa08f80f5072ff58a9
BLAKE2b-256 checksum
How to use checksums
4ae0ab17942123eb4e27a6609b62e1a1919ad64e6da65fc2d7322e8ce1069cbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page