Skip to main content

Normalize and convert mixed-currency columns in pandas using a simple accessor.

Project description

normalize_currency

A Python package to normalize and convert multi-currency columns in pandas.

Features

  • Extract currency symbols or codes from messy strings
  • Map to ISO 4217 currency codes
  • Convert to a target currency using live exchange rates (forex-python)
  • Use as a pandas accessor: .currency.normalize(to='USD')

Installation

pip install git+https://github.com/IamUsmanBro/normalize_currency.git

Usage

import pandas as pd
df = pd.DataFrame({'Pay': ['$1000', '€800', '₹70000']})
df['Pay_USD'] = df['Pay'].currency.normalize(to='USD')

License

MIT

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

normalize_currency-0.3.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

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

normalize_currency-0.3-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file normalize_currency-0.3.tar.gz.

File metadata

  • Download URL: normalize_currency-0.3.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for normalize_currency-0.3.tar.gz
Algorithm Hash digest
SHA256 a575c86172a08025f5fac15a21df1cd348f934b6e2695ad5220be6de64a31bef
MD5 4b01524722fe95226b72031d84f240f7
BLAKE2b-256 a681980143a4095440a58e326f56202382984e47a18547db6c30db6d71438384

See more details on using hashes here.

File details

Details for the file normalize_currency-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for normalize_currency-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d017d6dc630e889665ea2769fc8d4d4cdcb1b7380b714656b8dc6fbaac3c771
MD5 7fb6261a45e8f08ecc8710b67506fb69
BLAKE2b-256 e311b81f5c8466760ff3e1972c0141507eff463b0ac22be4e5ddf7a414e13b41

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