{"id":6336,"library":"currency-symbols","title":"Currency Symbols","description":"A tiny Python library (version 2.0.4) that provides currency symbols by their ISO 4217 currency codes. It's actively maintained with a focus on simple lookups and no external dependencies, making it suitable for applications needing quick access to currency symbols.","status":"active","version":"2.0.4","language":"en","source_language":"en","source_url":"https://github.com/arshadkazmi42/currency-symbols","tags":["currency","symbol","ISO 4217"],"install":[{"cmd":"pip install currency-symbols","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Prior to v1.0.0, the import or access pattern for the main functionality might have been different, possibly via a top-level function or direct module import. The current API requires importing the `CurrencySymbols` class.","wrong":"import currency_symbols; currency_symbols.get_symbol('USD')","symbol":"CurrencySymbols","correct":"from currency_symbols import CurrencySymbols"}],"quickstart":{"code":"from currency_symbols import CurrencySymbols\n\ndollar_symbol = CurrencySymbols.get_symbol('USD')\neuro_symbol = CurrencySymbols.get_symbol('EUR')\n\nprint(f\"USD: {dollar_symbol}\")\nprint(f\"EUR: {euro_symbol}\")\n\n# Handling an invalid currency code\ninvalid_symbol = CurrencySymbols.get_symbol('XXX')\nprint(f\"XXX: {invalid_symbol} (Expected None for invalid code)\")","lang":"python","description":"This example demonstrates how to import the `CurrencySymbols` class and use its `get_symbol` method to retrieve the Unicode symbol for a given ISO 4217 currency code. It also shows the behavior for an unknown currency code."},"warnings":[{"fix":"Update your import statements to `from currency_symbols import CurrencySymbols` and access symbols via `CurrencySymbols.get_symbol('CODE')`.","message":"Version 1.0.0 (released August 2021) introduced a breaking change by switching from a default export to a named export. For Python users, this means ensuring you explicitly import the `CurrencySymbols` class (`from currency_symbols import CurrencySymbols`) rather than relying on previous module-level access patterns.","severity":"breaking","affected_versions":"Before 1.0.0"},{"fix":"Use specialized libraries for formatting (`locale`, `Babel`) or conversion (`forex-python`) if you need more than just the raw currency symbol.","message":"This library is designed solely to retrieve the Unicode symbol for a given currency code. It does NOT provide functionality for currency formatting (e.g., adding thousands separators, decimal precision, locale-specific symbol placement), currency conversion, or exchange rates. For such features, consider libraries like `locale`, `Babel`, or `forex-python`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the Python-specific usage examples on the PyPI page or within the Python code itself, or carefully distinguish between Python and JavaScript examples in the GitHub README.","message":"The project's GitHub README contains usage examples for both Python and JavaScript. Always ensure you are following the Python-specific examples and import patterns to avoid confusion, which consistently use `from currency_symbols import CurrencySymbols`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add checks for `None` when calling `CurrencySymbols.get_symbol()` (e.g., `if symbol is not None: ... else: handle_missing_symbol()`).","message":"When an invalid or unknown currency code is provided to `CurrencySymbols.get_symbol()`, the method returns `None`. Your application code should handle this `None` return value gracefully to prevent errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}