Metadata-Version: 2.4
Name: currex
Version: 0.1.0
Summary: A Pythonic currency calculator with real-time exchange rates
Project-URL: Homepage, https://github.com/stared/currex
Author: Piotr Migdał
License-Expression: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Requires-Dist: pytest>=7.4.0
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# 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

```bash
pip install git+https://github.com/stared/currex.git
```

## Usage

```python
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](https://hexarate.paikama.co/)

## TODO

- Installation with PyPI
- Mock API for testing
- More backends for exchange rates

## License

MIT License by [Piotr Migdał](https://p.migdal.pl/)
