Normalizing phone numbers
The phones app enriches phone number annotations by:
- Normalizing local phone numbers by resolving land lines depending on city or countries it has encountered in the document
- Collecting all phone numbers present in the document
The application performs a resolution lookup each time a PhoneNr entity is found.
You can find this in the contact-info domain or you can make your own custom domain with this entity.
Options
PhonesOptions
interface PhonesOptions {
countries?: string[];
distance?: string[];
}
with:
| Property | Description |
|---|---|
countries |
Country names to try to resolve a local phone number |
distance |
Maximum distance between a location and the phone number to be resolved |
Results
PhonesResults
type PhonesResults = PhoneResult[];
PhoneResult
interface PhoneResult {
phone_nr: string;
country_code: string;
country: string;
location?: string;
}
with:
| Property | Description |
|---|---|
phone_nr |
Normalized phone number |
country_code |
Country phone code of the phone number, e.g. +32 |
country |
Country code of the phone number, e.g. 'Belgium' |
location |
Precise location, if available |
Examples
Normalizing phone numbers
The phones app enriches phone number annotations by:
- Normalizing local phone numbers by resolving land lines depending on city or countries it has encountered in the document
- Collecting all phone numbers present in the document
The application performs a resolution lookup each time a PhoneNr entity is found.
You can find this in the contact-info domain or you can make your own custom domain with this entity.
Options
PhonesOptions
interface PhonesOptions {
countries?: string[];
distance?: string[];
}
with:
| Property | Description |
|---|---|
countries |
Country names to try to resolve a local phone number |
distance |
Maximum distance between a location and the phone number to be resolved |
Results
PhonesResults
type PhonesResults = PhoneResult[];
PhoneResult
interface PhoneResult {
phone_nr: string;
country_code: string;
country: string;
location?: string;
}
with:
| Property | Description |
|---|---|
phone_nr |
Normalized phone number |
country_code |
Country phone code of the phone number, e.g. +32 |
country |
Country code of the phone number, e.g. 'Belgium' |
location |
Precise location, if available |
API
Examples
You will need to install the english language module to run the sample. pip install wowool-english
Extracting and normalizing phone numbers
The script extracts and normalizes a Belgian phone number from the text, identifies its country and location, and prints this structured information.
from wowool.sdk import Pipeline
from wowool.phones.app_id import APP_ID
text = "I live in Antwerp and my phone number is 03/230 30 46."
pipeline = Pipeline(
[
"english",
"contact-info",
"phones.app",
]
)
document = pipeline(text)
print(document.results(APP_ID))
results:
[
{
"phone_nr": "+3232303046",
"country_code": 32,
"country": "Belgium",
"location": "Antwerp"
}
]
License
In both cases you will need to acquirer a license file at https://www.wowool.com
Non-Commercial
This library is licensed under the GNU AGPLv3 for non-commercial use.
For commercial use, a separate license must be purchased.
Commercial license Terms
1. Grants the right to use this library in proprietary software.
2. Requires a valid license key
3. Redistribution in SaaS requires a commercial license.
Metadata
Release files for wowool-phones 2.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wowool_phones-2.1.4-py3-none-any.whl | Python 3 | none | any | Details for wowool_phones-2.1.4-py3-none-any.whl |
Release files / wowool_phones-2.1.4-py3-none-any.whl
| Download URL | wowool_phones-2.1.4-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa926ed762f97589e92ab65d8f1f9a2c622255e3d7be8668be15a1515c2fce09
|
|
BLAKE2b-256 checksum How to use checksums |
c25704ab6e3bf0e8ebde324c2e90794fa725480ef63a69b97d8b790f53a7e24f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for wowool-phones 2.1.4
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.