Skip to main content

Module for exchanging monetary values and inflation adjustment.

Project description

FZJ Logo

CuCoPy - Currency Conversion for Python

The CuCoPy package provides methods for exchanging currencies and adjusting monetary values for inflation until 1960 on a yearly basis.

Features

Note on the Euro: For countries using the Euro (EUR), CuCoPy assumes the harmonized inflation value for the Euro Area.

Missing countries: If the ER or CPI of a country's currency is missing for your conversion, please contact the developers to request support.

Installation

Installation from conda-forge

CuCoPy can be installed into a new environment with the following command

mamba create -n -c conda-forge cucopy_env cucopy

Or can be installed into an exisitng and activated environment with

mamba install -c conda-forge cucopy

Note on Mamba vs.Conda: mamba commands can be substitued with conda. We highly recommend using (Micro-)Mamba instead of Conda. The recommended way to use Mamba on your system is to install the Miniforge distribution. They offer installers for Windows, Linux and OS X. In principle, Conda and Mamba are interchangeable. The commands and concepts are the same. The distributions differ in the methodology for determining dependencies when installing Python packages. Mamba relies on a more modern methodology, which (with the same result) leads to very significant time savings during the installation of ETHOS.FINE. Switching to Mamba usually does not lead to any problems, as it is virtually identical to Conda in terms of operation.

Installation from pypi into a conda envrionment

First create a new environment that contains python and pip

mamba create -n cucopy_env python pip

Activate the environment

mamba activate cucopy_env

CuCoPy can be installed directly via pip:

pip install cucopy

Note on using pip within a conda environment To install packages within a conda environment pip must already be installed in that environment. Please see this Stack Overflow post and this Anaconda Article.

Local installation for Development

Alternatively, it can also be installed via git - this will preserve the connection to the GitHub repository:

git clone https://github.com/FZJ-IEK3-VSA/CuCoPy

Change the directory into the new repository

cd cucopy

Installation with Conda Dependencies

Create a new environment with all necessary conda depenendcies

mamba env create -f env.yml

Install the local package in development mode

pip install -e . --no-deps

Installation with PyPi Dependencies

Then install CuCoPy via python as follows

pip install -e .

Example

In the following code section, the value in 2020 Euro is converted to the value in 2025 USD.

from cucopy import Currency
cur = Currency()

cur.convert_currency(value=100, base_year="2020", base_currency="EUR", target_year="2025", target_currency="USD", operation_order="inflation_first")
>> 137.41

For a deeper look into the features of CuCoPy, there a tutorial notebook is available.

License

MIT License

Copyright (C) 2021-2026 FZJ-ICE-2

Active Developers: Maxime Gorres, Jan Göpfert, Patrick Kuckertz, Jann Weinand

Alumni: Julian Schönau, Leander Kotzur, Detlef Stolten

You should have received a copy of the MIT License along with this program. If not, see https://opensource.org/licenses/MIT

About Us

Institut ICE-2

We are the Institute of Climate and Energy Systems (ICE) - Jülich Systems Analysis belonging to the Forschungszentrum Jülich. Our interdisciplinary department's research is focusing on energy-related process and systems analyses. Data searches and system simulations are used to determine energy and mass balances, as well as to evaluate performance, emissions and costs of energy systems. The results are used for performing comparative assessment studies between the various systems. Our current priorities include the development of energy strategies, in accordance with the German Federal Government’s greenhouse gas reduction targets, by designing new infrastructures for sustainable and secure energy supply chains and by conducting cost analysis studies for integrating new technologies into future energy market frameworks.

Acknowledgements

The CuCoPy package relies heavily on the datasets made available by the International Monetary Fund (IMF), but is neither affiliated with or endorsed by either parties.

The IMF API provides information on international exchange rates as well as consumer price indices and is used for research purposes. Their terms can be accessed here: https://www.imf.org/external/terms.htm

This work is supported by the Federal Ministry for Economic Affairs and Climate Action (BMWK) with a grant for the project LOD-GEOSS (03EI1005B).

BMWK Logo

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

cucopy-1.2.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cucopy-1.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file cucopy-1.2.0.tar.gz.

File metadata

  • Download URL: cucopy-1.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cucopy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 03fd84f209bdc9a6600684f514c020e957cf84043a175eb9c37fb0d79d602448
MD5 755b2ea93561e191e36afe0a11425507
BLAKE2b-256 61283cc6c1ebe82a4b9a43b952b46a0e7869fab9ab09391634475a3c85c5af06

See more details on using hashes here.

File details

Details for the file cucopy-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: cucopy-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cucopy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef78aac6b4bf7bc347f9b685e4799bf7492c002a4404636d7bcf203b9e499f67
MD5 d537bf4625447038a77ed530866b64f2
BLAKE2b-256 474a80699d77c2ec0b1d8f4569f7641ea0bc856c43bd7078ff383d8eff392986

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page