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.0.tar.gz (3.7 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.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nanpa-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 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.0.tar.gz
Algorithm Hash digest
SHA256 b2d7a31733007d37c4dad23f2d51384ade99cfa6d63315fb164e0f2935739c90
MD5 a2ed89b94314f79572aa061c1a8cd67b
BLAKE2b-256 2947337a1da65838d5ff42e34ca2d5a38677e1914a63f01916940b310c924a53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nanpa-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3605ff2c408752f09d4a596848439be2da606f61eb5d3cc0706b59baa780efa9
MD5 1f71afe2d51596d592eb86653c4134ae
BLAKE2b-256 e8e14ef9bd154a884aec77ec851319210fa6989a5510751317010c059aba72b2

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