A Pythonic currency calculator with real-time exchange rates
Project description
Currex
A Pythonic currency calculator that makes working with currencies and exchange rates simple and smooth.
I often use Python as a command-line calculator. Yet, I need to go back to Google Search to convert between curriencies. So, for my own convenience, I created this library.
It is inteded to be used interactive python sessions (such as Jupyter Notebook, IPython, etc.) to get ballpark estimates of prices - e.g. when travelling, buying online, etc.
It is NOT intended to be used in production code. Every API design decision I made was to make it as simple as possible to use it in interactive sessions.
EVEN MORE IMPORTANT: Never use it for any important decisions - taxes, investments, etc. There is not quarantee that the exchange rates are correct.
Installation
pip install currex
Usage
from currex import *
# use currencies as if they were numbers
100 * USD # USD(100)
12 * USD(100) # USD(1200)
# convert currencies to other currencies
USD(100).to(EUR) # EUR(85.3)
USD(100).to(PLN) # PLN(430.5)
# this syntax is also supported
PLN(EUR(12)) # PLN(51.3312)
# add different currencies
USD(100) + EUR(100) # USD(203.50500)
EUR(100) - USD(100) # EUR(2.60500)
# divide currencies
USD(2) / JPY(14) # 22.531428526365715
Features
- Arithmetic operations with currencies
- Currency conversion
- Autocasting - when using a few currencies, automatically convert them to the first one
Requirements
- Python 3.10 or higher
- Internet connection for real-time exchange rates - it uses HexaRate
TODO
- Installation with PyPI
- Mock API for testing
- More backends for exchange rates
License
MIT License by Piotr Migdał
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file currex-0.1.1.tar.gz.
File metadata
- Download URL: currex-0.1.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b3c30a842a2e17c6090fba086302c0928c713955dca2ae8fa3f6daa28afa206
|
|
| MD5 |
7b7f3d2092e60539cb2a6d5ba249fede
|
|
| BLAKE2b-256 |
ac6028175263ef67b55db1a0354997a34e98d5c7815812a53f567a2ca93007c7
|
Provenance
The following attestation bundles were made for currex-0.1.1.tar.gz:
Publisher:
publish.yml on stared/currex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
currex-0.1.1.tar.gz -
Subject digest:
5b3c30a842a2e17c6090fba086302c0928c713955dca2ae8fa3f6daa28afa206 - Sigstore transparency entry: 160658970
- Sigstore integration time:
-
Permalink:
stared/currex@3df010059ace11fd040ab01fd1a4fa40a3bd6935 -
Branch / Tag:
refs/tags/v0.1.1a - Owner: https://github.com/stared
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3df010059ace11fd040ab01fd1a4fa40a3bd6935 -
Trigger Event:
release
-
Statement type:
File details
Details for the file currex-0.1.1-py3-none-any.whl.
File metadata
- Download URL: currex-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b48c571797e4f52a91af69d6249f2cee72c1b966c5b7f1bb010c31ef4563b0f
|
|
| MD5 |
4d1127f11b7983ff3e9ea633851aea43
|
|
| BLAKE2b-256 |
01d89c157797ddcbc7c5a54c3bbf29c7544ba203e0855084d1ec672aaf61cea0
|
Provenance
The following attestation bundles were made for currex-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on stared/currex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
currex-0.1.1-py3-none-any.whl -
Subject digest:
4b48c571797e4f52a91af69d6249f2cee72c1b966c5b7f1bb010c31ef4563b0f - Sigstore transparency entry: 160658971
- Sigstore integration time:
-
Permalink:
stared/currex@3df010059ace11fd040ab01fd1a4fa40a3bd6935 -
Branch / Tag:
refs/tags/v0.1.1a - Owner: https://github.com/stared
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3df010059ace11fd040ab01fd1a4fa40a3bd6935 -
Trigger Event:
release
-
Statement type: