Skip to content

Commit

Permalink
publish 0.0.0b1 to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
microdataxyz committed Dec 18, 2022
1 parent 4e4b000 commit 1cb8b1c
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ venv/
ENV/
env.bak/
venv.bak/
publish_env/
prepublish_test/


# Spyder project settings
.spyderproject
Expand Down
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# idnumbers
National ID verification libs

[![PyPI version](https://badge.fury.io/py/idnumbers.svg)](https://badge.fury.io/py/idnumbers)

This project in early phase. We might change the interface. Please wait our changelogs for more information.

## Verify National IDs

All modules under nationalid package support the `validate` function.

```python
from idnumbers.nationalid import AUS, NGA, ZAF

# verify AUS tax file number (with checksum code)
AUS.TaxFileNumber.validate('32547689')

# verify AUS driver license number
AUS.DriverLicenseNumber.validate('12 345 678')

# verify AUS Medicare number (with checksum code)
AUS.MedicareNumber.validate('2123 45670 1')

# verify NGA national id number
NGA.NationalID.validate('12345678901')

# verify ZAF nation id number
ZAF.NationalID.validate('7605300675088')
```

## Parse National IDs

Some modules whose `METADATA.parsable == true` support the `parse` function. It unpacks the detail data from the
national id.

```python
from idnumbers.nationalid import ZAF

assert ZAF.NationalID.METADATA.parsable == True
# parse the national id
id_data = ZAF.NationalID.parse('7605300675088')
# access the date of birth, gender, and citizenship
print(id_data['yyyymmdd'])
print(id_data['gender'])
print(id_data['citizenship'])
```
46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import os
from setuptools import setup, find_packages


# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(filename):
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), filename), 'r') as fin:
return fin.read()


setup(
name='idnumbers',
version='0.0.0b1',
author='MicrodataXYZ',
author_email='[email protected]',
description='id numbers verification toolkits',
long_description=read('README.md'),
long_description_content_type='text/markdown',
license='MIT',
url='https://github.com/microdataxyz/idnumbers',
project_urls={
'Source': 'https://github.com/microdataxyz/idnumbers',
'Tracker': 'https://github.com/microdataxyz/idnumbers/issues',
},
packages=find_packages(exclude=['test_*']),
python_requires='>=3.7',
install_requires=[],
setup_requires=[],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Typing :: Typed'
], )

0 comments on commit 1cb8b1c

Please sign in to comment.