Skip to content

Commit ae9994e

Browse files
committed
Prepair for release 1.0.0
1 parent a4c8b9d commit ae9994e

File tree

6 files changed

+119
-3
lines changed

6 files changed

+119
-3
lines changed

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
ENV/
26+
env/
27+
28+
# IDE
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
34+
# OS
35+
.DS_Store
36+
Thumbs.db

LICENSE

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2025, acidvegas <acid.vegas@acid.vegas>
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ The North American Numbering Plan *(NANP)* is the unified telephone numbering sy
66

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

9+
## Installation
10+
```bash
11+
pip install nanpa
12+
```
13+
14+
or...
15+
16+
```bash
17+
git clone https://github.com/acidvegas/nanpa
18+
cd nanpa
19+
python setup.py install
20+
```
21+
922
## API Documentation
1023

1124
### State & Area Code Information
@@ -41,3 +54,7 @@ changes = client.get_rate_center_changes(
4154
'2024-12-31T23:59:59.999-05:00'
4255
)
4356
```
57+
58+
---
59+
60+
###### Mirrors: [acid.vegas](https://git.acid.vegas/nanpa)[SuperNETs](https://git.supernets.org/acidvegas/nanpa)[GitHub](https://github.com/acidvegas/nanpa)[GitLab](https://gitlab.com/acidvegas/nanpa)[Codeberg](https://codeberg.org/acidvegas/nanpa)

nanpa/nanpa/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .client import NanpaAPI
2+
3+
__version__ = '1.0.0'
4+
__author__ = 'acidvegas'
5+
__all__ = ['NanpaAPI']

nanpa.py renamed to nanpa/nanpa/client.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def __init__(self):
1414

1515
self.base_url = 'https://api.nanpa.com/reports/public'
1616

17-
1817
def _make_request(self, endpoint: str, params: dict = None) -> dict:
1918
'''
2019
Make a request to the NANPA API.
@@ -48,6 +47,7 @@ def get_area_code_info(self, npa: str) -> dict:
4847
4948
:param npa: Area code to lookup
5049
'''
50+
5151
params = {'npa': npa}
5252

5353
return self._make_request('npa/areaCodeListing', params)
@@ -71,6 +71,7 @@ def get_co_code_forecast(self, state: str, npa: str) -> dict:
7171
7272
:param state: Two-letter state code
7373
:param npa: Area code
74+
7475
'''
7576

7677
params = {'state': state, 'npa': npa}
@@ -190,14 +191,16 @@ def get_thousands_blocks(self, state: str, npa: str, report_type: str = 'AS') ->
190191
:param npa: Area code
191192
:param report_type: Report type (default: AS)
192193
'''
193-
194+
194195
params = {'state': state, 'npa': npa, 'reportType': report_type}
196+
195197
return self._make_request('tbco/thousandsBlocks', params)
196198

197199

198200

199201
def main():
200202
'''Example usage of the NANPA API client.'''
203+
201204
client = NanpaAPI()
202205

203206
# Example API calls
@@ -212,4 +215,4 @@ def main():
212215

213216

214217
if __name__ == '__main__':
215-
main()
218+
main()

setup.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python
2+
# North American Numbering Plan Administration (NANPA) API Client - Developed by acidvegas in Python (https://git.acid.vegas/nanpa)
3+
# setup.py
4+
5+
from setuptools import setup, find_packages
6+
7+
8+
with open('README.md', encoding='utf-8') as fh:
9+
long_description = fh.read()
10+
11+
setup(
12+
name='nanpa',
13+
version='1.0.0',
14+
author='acidvegas',
15+
author_email='acid.vegas@acid.vegas',
16+
description='North American Numbering Plan Administration (NANPA) API Client',
17+
long_description=long_description,
18+
long_description_content_type='text/markdown',
19+
url='https://github.com/acidvegas/nanpa',
20+
project_urls={
21+
'Source Code': 'https://github.com/acidvegas/nanpa',
22+
},
23+
classifiers=[
24+
'Development Status :: 4 - Beta',
25+
'Intended Audience :: Developers',
26+
'License :: OSI Approved :: MIT License',
27+
'Operating System :: OS Independent',
28+
'Programming Language :: Python :: 3',
29+
'Programming Language :: Python :: 3.6',
30+
'Programming Language :: Python :: 3.7',
31+
'Programming Language :: Python :: 3.8',
32+
'Programming Language :: Python :: 3.9',
33+
'Programming Language :: Python :: 3.10',
34+
'Programming Language :: Python :: 3.11',
35+
'Topic :: Software Development :: Libraries :: Python Modules',
36+
'Topic :: Communications :: Telephony',
37+
],
38+
packages=find_packages(),
39+
python_requires='>=3.6',
40+
)

0 commit comments

Comments
 (0)