Skip to main content

Module for exchanging monetary values and inflation adjustment.

Project description

Forschungszentrum Juelich 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 existing 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. 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, is a tutorial notebook 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 was 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.5.tar.gz (18.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.5-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cucopy-1.2.5.tar.gz
  • Upload date:
  • Size: 18.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.5.tar.gz
Algorithm Hash digest
SHA256 65ef166f838b808fa1128215ccfe6b6c5ba58890dcfad47f2aac179f9517e243
MD5 527826ca1b8a2bfdabd2b3cbab4647b3
BLAKE2b-256 68d582d676eb684fef34f3e9d8d2a9174674eb1fefeb869a1a53fc501a57bd18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cucopy-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 15.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec068af18cf2a3c39c6c158a20e07956ea282d7b43ec0dc917988eb6fce8743
MD5 4d79bc27abee1ecae08a410bf43b1b21
BLAKE2b-256 21e9edbb277d4066e07932cb472d218937819b6c0895988a16858da5f9b6f8ea

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