numerize

raw JSON →
0.12 verified Fri May 01 auth: no python

Convert large numbers into readable numbers for humans (e.g., 1M, 2.5B). Version 0.12 is stable and mature, with low release cadence (last release 2020).

pip install numerize
error ModuleNotFoundError: No module named 'numerize'
cause The library is not installed or the import path is wrong.
fix
Run 'pip install numerize' and use 'from numerize import numerize'.
error AttributeError: module 'numerize' has no attribute 'numerize'
cause Using 'import numerize' and then 'numerize.numerize()' fails if the function is not imported directly.
fix
Use 'from numerize import numerize' then call numerize().
deprecated The library has not been updated since 2020. It still works but may not support newer Python versions or edge cases (e.g., very large numbers).
fix Consider alternatives like humanize or custom formatting for active maintenance.
gotcha The function returns strings like '1.23M' without a space, which may not be ideal for all UI contexts.
fix Use string formatting or postprocess if spaces are needed.

Basic usage: convert an integer to a human-readable string.

from numerize import numerize

print(numerize(1234567))  # Output: 1.23M
print(numerize(1000000000))  # Output: 1B
print(numerize(999000, 2))  # Output: 999K