Skip to main content

The Wowool Phones Package

Project description

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.  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wowool_phones-2.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file wowool_phones-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: wowool_phones-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for wowool_phones-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a93612dc51ac3e7e353aaa445bfe4e159fe68606b400370c10e76fcc0cfe007
MD5 5bc169e188b36ceb588c91ad0d5a31e1
BLAKE2b-256 9d32af40dfde028433c238478663437bc9ba50dab6b226b83217ecd7396b188b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page