fastnumbers
Super-fast and clean conversions to numbers.
Decision gist · record as of 2026-08-14
Yes, if numeric parsing is a measurable bottleneck in your application. The package is stable (Production/Stable status, active maintenance, no known vulnerabilities), has zero runtime dependencies, and offers genuine performance gains for string-to-number conversions and batch operations. Install with caution if you rely on undocumented corner-case behavior of Python's int/float, as the documentation warns of specific differences; otherwise, it is a safe, low-friction upgrade.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.9; compiled wheels available for common platforms but source build may require a C compiler on unsupported architectures.
- Medium install friction due to compiled wheels for multiple platforms and Python versions (3.9–3.14).
- Active maintenance with recent release (48 days old) and steady repository activity (112 stars) suggests reliable ongoing support.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
last release 2026-06-27 (48 days) · last repo commit 2026-07-12 · 112 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 240,745 downloads/mo, #8,900 on PyPI
Alternatives
Verify before relying
from fastnumbers import try_float, try_int
# Convert string to float, return original on failure
result = try_float('56.07')
# Convert with fallback value
result = try_float('bad input', on_fail=0)
# Batch convert with map option
items = try_float(['5', '4.5', '34567.6'], map=list)- Whether the claimed 2x–10x speedups hold for typical real-world workloads in your use case
- Exact behavior differences from built-in int/float in corner cases mentioned in documentation
- Performance of numpy array conversion (try_array) relative to alternatives in your data pipeline
What it is and what it does
fastnumbers is a Python module that wraps and accelerates conversions from strings and other types to int, float, or real numbers. It provides three categories of functions: error-handling functions (try_float, try_int, try_real, try_forceint) that return a fallback value or original input on failure, checking functions (check_float, check_int, etc.) to validate whether input could be converted, and drop-in replacements for Python's built-in int() and float() that aim for speed parity or better. The module handles edge cases like unicode numerals, inf/nan substitution, and batch operations on iterables via a map option.
The package is built as a compiled extension (wheels for Python 3.9–3.14 on common platforms) with no runtime dependencies, making it lightweight to install. It targets use cases where numeric parsing is a bottleneck—data processing pipelines, financial calculations, scientific computing, and bulk string-to-number conversions where the speed gains (claimed up to 5x for floats, 10x for error handling) justify the added dependency.
Use it for
- Parsing CSV or JSON data with numeric fields where conversion speed or robust error handling is critical
- Validating user input or API payloads for numeric types before processing
- Batch converting lists of strings to floats or ints with a single call and 2x speedup over list comprehensions
- Handling unicode numerals (e.g., Roman numerals, circled digits) in text-to-number pipelines
- Replacing Python's built-in int/float in performance-sensitive numeric parsing loops
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if numeric parsing is a measurable bottleneck in your application.
The package is stable (Production/Stable status, active maintenance, no known vulnerabilities), has zero runtime dependencies, and offers genuine performance gains for string-to-number conversions and batch operations. Install with caution if you rely on undocumented corner-case behavior of Python's int/float, as the documentation warns of specific differences; otherwise, it is a safe, low-friction upgrade.
Install
fastnumbers on PyPI
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.9–3.14). Active maintenance with recent release (48 days old) and steady repository activity (112 stars) suggests reliable ongoing support.
Requires Python >= 3.9; compiled wheels available for common platforms but source build may require a C compiler on unsupported architectures.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
from fastnumbers import try_float, try_int
# Convert string to float, return original on failure
result = try_float('56.07')
# Convert with fallback value
result = try_float('bad input', on_fail=0)
# Batch convert with map option
items = try_float(['5', '4.5', '34567.6'], map=list)
Verify before relying
- Whether the claimed 2x–10x speedups hold for typical real-world workloads in your use case
- Exact behavior differences from built-in int/float in corner cases mentioned in documentation
- Performance of numpy array conversion (try_array) relative to alternatives in your data pipeline
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 48 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 240,745 / month, #8,900 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Information AnalysisTopic :: Text ProcessingTopic :: Text Processing :: FiltersTopic :: Utilities |
Evidence: fastnumbers-5.2.0-cp310-cp310-macosx_10_9_x86_64.whl; fastnumbers-5.2.0-cp310-cp310-macosx_11_0_arm64.whl; fastnumbers-5.2.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; fastnumbers-5.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; fastnumbers-5.2.0-cp310-cp310-musllinux_1_2_aarch64.whl; fastnumbers-5.2.0-cp310-cp310-musllinux_1_2_x86_64.whl; fastnumbers-5.2.0-cp310-cp310-win32.whl; fastnumbers-5.2.0-cp310-cp310-win_amd64.whl; fastnumbers-5.2.0-cp310-cp310-win_arm64.whl; fastnumbers-5.2.0-cp311-cp311-macosx_10_9_x86_64.whl; fastnumbers-5.2.0-cp311-cp311-macosx_11_0_arm64.whl; fastnumbers-5.2.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; fastnumbers-5.2.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; fastnumbers-5.2.0-cp311-cp311-musllinux_1_2_aarch64.whl; fastnumbers-5.2.0-cp311-cp311-musllinux_1_2_x86_64.whl; fastnumbers-5.2.0-cp311-cp311-win32.whl; fastnumbers-5.2.0-cp311-cp311-win_amd64.whl; fastnumbers-5.2.0-cp311-cp311-win_arm64.whl; fastnumbers-5.2.0-cp312-cp312-macosx_10_13_x86_64.whl; fastnumbers-5.2.0-cp312-cp312-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fast string to number conversion”
- fastnumbersConverts strings and other inputs to numbers (int, float, or real)…
- python-baseconvConverts integers to and from strings in arbitrary bases (binary,…
- base36Converts integers to and from base36 representation, a compact…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also typepy · infinity · roman-numerals-py · dicttoxml · ml-dtypes · roman · django-phonenumber-field · DataProperty · bnunicodenormalizer · cheap-repr