Skip to main content

Numbers-Extractor

Extract numbers from a string and return a list of int.

Install

pip install numbers_extractor

or

easy_install numbers_extractor

Usage

numbers_extractor(string[, multiple=True])

string must be a text that contains zero, one or # numbers. If multiple is set to True (default) return a list of # numbers that can be empty if no numbers are found. If False, return the first number found, or None.

Example:

>>> from numbers_extractor import numbers_extractor
>>> numbers_extractor("20 is 10 plus 10")
[20, 10, 10]
>>> numbers_extractor("20 is 10 plus 10", multiple=False)
20
>>> numbers_extractor("no numbers here")
[]
>>> numbers_extractor("no numbers here", multiple=False)
>>>

Metadata

Release files for numbers_extractor 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numbers_extractor 0.2.3
File Size Uploaded Provenance Actions
numbers_extractor-0.2.3.tar.gz 2.3 kB Without provenance Details for numbers_extractor-0.2.3.tar.gz

Release files / numbers_extractor-0.2.3.tar.gz

Download URL numbers_extractor-0.2.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4bcdb9f67295395865adfb8df47ad623449113e81b3f75b8e24a0b3babd079f0
BLAKE2b-256 checksum
How to use checksums
609aa9a51c7213099d2fef7c92978592833696c5c7d49fa3e6ee8b2ef0241df7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for numbers_extractor 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page