Skip to main content

North American Numbering Plan Administration (NANPA) API Client

Project description

NANPA API Client

A Python client for interacting with the North American Numbering Plan Administration (NANPA) public API system.

Overview

The North American Numbering Plan (NANP) is the unified telephone numbering system used by the United States, Canada, and many Caribbean territories. Established in 1997, NANPA serves as the administrator for this system, managing the allocation and assignment of area codes, central office codes, and other numbering resources to ensure efficient telecommunications routing and prevent number exhaustion.

This client provides a simple interface to NANPA's public API endpoints, allowing developers to programmatically access critical numbering plan data and network information.

Installation

pip install nanpa

or...

git clone https://github.com/acidvegas/nanpa
cd nanpa
python setup.py install

API Documentation

State & Area Code Information

The foundation of the NANP system revolves around geographic numbering assignments. The get_states() method returns all participating regions in the NANP, including US states and territories, Canadian provinces, and Caribbean nations. For more granular information, get_area_codes_by_state(state) provides all area codes assigned to a specific region, while get_area_code_info(npa) delivers detailed information about individual area codes including their service boundaries, implementation dates, and relief planning status.

Rate Center Operations

Rate centers form the geographic backbone of telephone billing and routing. Using get_rate_centers(state), you can retrieve information about these fundamental units within any state, including their coordinates, associated area codes, and operating companies. The get_rate_center_changes(start_date, end_date) method tracks modifications to these configurations over time, such as consolidations, splits, and boundary adjustments.

Number Block Management

The NANP manages telephone numbers in blocks of 1,000 consecutive numbers. The get_thousands_blocks(state, npa, report_type) method provides information about these blocks, including carrier assignments and availability. For future planning, get_pooling_forecast(state, npa) projects number utilization and exhaust dates, while get_current_pool_tracking(state, npa) monitors active pool sizes and carrier participation.

Network Infrastructure

Location Routing Numbers (LRNs) are crucial for number portability in modern networks. The get_lrn_forecast(state, npa) method helps plan for routing efficiency and port capacity. Central office code assignments can be monitored through get_co_code_forecast(state, npa), while get_pstn_activation(state) provides status updates on Public Switched Telephone Network readiness.

Specialty Number Resources

Beyond geographic numbers, NANPA manages special purpose codes. The 5XX NPA code family, accessed through various methods like get_specialty_codes_available(), get_specialty_codes_assigned(), and get_specialty_codes_aging(), serves non-geographic services. The 9YY codes, retrieved via get_9yy_codes(), are reserved for premium services, emergency preparedness, and network testing.

Usage Example

from nanpa import NanpaAPI

client = NanpaAPI()

# Get rate centers in Florida
fl_centers = client.get_rate_centers('FL')

# Check thousands blocks for area code 239
blocks = client.get_thousands_blocks('FL', '239')

# Monitor rate center changes
changes = client.get_rate_center_changes(
    '2024-12-01T00:00:00.000-05:00',
    '2024-12-31T23:59:59.999-05:00'
)

Mirrors: acid.vegasSuperNETsGitHubGitLabCodeberg

Project details


Download files

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

Source Distribution

nanpa-1.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

nanpa-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file nanpa-1.0.1.tar.gz.

File metadata

  • Download URL: nanpa-1.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for nanpa-1.0.1.tar.gz
Algorithm Hash digest
SHA256 19eb0f2789f98ab4f82c5d3bb63ce1a4d6f5ea9d5f81553fae1520e704799305
MD5 caf5cd6ab20ab05c4ffd99352766efcc
BLAKE2b-256 3330dd8718a15bb4b3874b00679c90d826c6aa9600478aea707cd1753829d14b

See more details on using hashes here.

File details

Details for the file nanpa-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nanpa-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for nanpa-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 344ba0f8bb426e0c54503228d93cd5f7a0b68d5eafe08a3289456eb61343237c
MD5 6509e0c043b1e18396ba9742fa70ee77
BLAKE2b-256 25cf178188c0c65ed01be39ca04f8895fd907aeade0dbafb167bdf5264e7c6a0

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