{"id":24197254,"url":"https://github.com/stared/currex","last_synced_at":"2025-09-21T22:30:40.364Z","repository":{"id":270734448,"uuid":"911305156","full_name":"stared/currex","owner":"stared","description":"A Pythonic currency calculator with real-time exchange rates","archived":false,"fork":false,"pushed_at":"2025-01-26T09:42:21.000Z","size":38,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-15T23:15:47.040Z","etag":null,"topics":["calculator","currency","currency-converter"],"latest_commit_sha":null,"homepage":"https://colab.research.google.com/github/stared/currex/blob/main/currex.ipynb","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-02T17:50:30.000Z","updated_at":"2025-07-23T21:49:00.000Z","dependencies_parsed_at":"2025-01-25T12:32:59.506Z","dependency_job_id":null,"html_url":"https://github.com/stared/currex","commit_stats":null,"previous_names":["stared/currex"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/stared/currex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stared%2Fcurrex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stared%2Fcurrex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stared%2Fcurrex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stared%2Fcurrex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stared","download_url":"https://codeload.github.com/stared/currex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stared%2Fcurrex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276083218,"owners_count":25582289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator","currency","currency-converter"],"created_at":"2025-01-13T19:58:25.853Z","updated_at":"2025-09-21T22:30:40.356Z","avatar_url":"https://github.com/stared.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Currex\n\n[![currex version - PyPI](https://img.shields.io/pypi/v/currex)](https://pypi.org/project/currex/)\n![PyPI status](https://img.shields.io/pypi/status/currex.svg)\n![MIT license - PyPI](https://img.shields.io/pypi/l/currex.svg)\n![Python version - PyPI](https://img.shields.io/pypi/pyversions/currex.svg)\n[![GitHub Actions: Build](https://img.shields.io/github/actions/workflow/status/stared/currex/test.yml?branch=main)](https://github.com/stared/currex/actions)\n[![GitHub Actions: Linting](https://img.shields.io/github/actions/workflow/status/stared/currex/lint.yml?branch=main\u0026label=linting)](https://github.com/stared/currex/actions)\n[![Downloads](https://pepy.tech/badge/currex)](https://pepy.tech/project/currex)\n[![Twitter @pmigdal](https://img.shields.io/twitter/follow/pmigdal)](https://twitter.com/pmigdal)\n\nA Pythonic currency calculator that makes working with currencies and exchange rates simple and smooth - by [Piotr Migdał](https://p.migdal.pl/). [See it in action in Colab](https://colab.research.google.com/github/stared/currex/blob/main/currex.ipynb) - no need to install anything.\n\nI often use Python as a command-line calculator. However, I frequently found myself going back to Google Search to convert between currencies. So, I created this library to make it easy to add, multiply, and convert between currencies. One of its core features is autocasting - when working with multiple currencies, it automatically converts them to match the first currency used.\n\nThis library is designed for use in interactive Python sessions (such as Jupyter Notebook, Jupyter Lab, or IPython) to quickly get ballpark price estimates - perfect for travel planning or online shopping. I personally use it through IPython on the command line.\n\nRight now it uses [HexaRate](https://hexarate.paikama.co/) for exchange rates.\n\nIt is a new package, so [I'm open to suggestions](https://github.com/stared/currex/issues).\n\n## Disclaimer\n\nIt is **NOT intended to be used in production code**. Every API design decision was made to optimize for interactive sessions. Some decisions consciously go against best practices for production libraries. For example, the main namespace defines all currencies as constants, and the example code uses `from currex import *` - practices I believe are appropriate for interactive sessions only.\n\n**EVEN MORE IMPORTANT**: Never use it for any important decisions - taxes, investments, etc. There is no guarantee that the exchange rates are up-to-date and correct. Note that even major players make mistakes, e.g. [Google Glitch Undervalues Poland's Zloty By A Fifth](https://www.barrons.com/news/google-glitch-undervalues-poland-s-zloty-by-a-fifth-b4d695e7). Always use the official exchange rates.\n\n## Installation\n\n```bash\npip install currex\n```\n\n## Usage\n\n```python\nfrom currex import *\n\n# use currencies as if they were numbers\n100 * USD  # USD(100.00)\n12 * USD(100)  # USD(1200.00)\n\n# convert currencies to other currencies\nUSD(100).to(EUR)  # EUR(85.30)\nUSD(100).to(PLN)  # PLN(430.50)\n\n# this syntax is also supported\nPLN(EUR(12))  # PLN(51.33)\n\n# add different currencies\nUSD(100) + EUR(100)  # USD(203.42)\nEUR(100) - USD(100)  # EUR(3.22)\n\n# divide currencies\nUSD(2) / JPY(14)  # 22.531428526365715\n\n# configure decimal digits (default is 2)\ncurrex_config.set_decimal_digits(3)  # show 3 decimal places\nUSD(123.456789)  # USD(123.457)\ncurrex_config.set_decimal_digits(None)  # show full precision\nUSD(123.456789)  # USD(123.456789)\n```\n\nFor a slightly more advanced use, there is a general `Currency` class:\n\n```python\nfrom currex import Currency\n\nUSD = Currency(\"USD\")  # one dollar\n\nmoney = Currency(\"USD\", 100)  # USD(100.00)\nmoney.to(\"EUR\")  # EUR(95.30)\n```\n\n## Features\n\n- Arithmetic operations with currencies\n- Currency conversion\n- Autocasting - when using a few currencies, automatically convert them to the first one\n- Configurable decimal places for currency representation\n\n## Requirements\n\n- Python 3.9 or higher\n- Internet connection for real-time exchange rates\n\n## Development\n\nTo set up the development environment:\n\n```bash\ngit clone git@github.com:stared/currex.git\ncd currex\npip install -e .[dev]\n```\n\n## TODO\n\n- Mock API for testing\n- More backends for exchange rates, see [e.g. this list](https://publicapis.dev/category/currency-exchange)\n- Support for cryptocurrencies\n\n## License\n\nMIT License by [Piotr Migdał](https://p.migdal.pl/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstared%2Fcurrex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstared%2Fcurrex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstared%2Fcurrex/lists"}