https://github.com/chehanr/nic_parser
A python package to parse Sri Lankan national identity card numbers.
https://github.com/chehanr/nic_parser
identity national nic nic-parser parser python python-library python3 sri-lanka
Last synced: 8 months ago
JSON representation
A python package to parse Sri Lankan national identity card numbers.
- Host: GitHub
- URL: https://github.com/chehanr/nic_parser
- Owner: chehanr
- License: gpl-3.0
- Created: 2018-06-04T08:59:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-05T15:02:31.000Z (over 6 years ago)
- Last Synced: 2025-06-22T17:08:04.564Z (about 1 year ago)
- Topics: identity, national, nic, nic-parser, parser, python, python-library, python3, sri-lanka
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nic_parser
A python library to parse Sri Lankan national identity card numbers.
## Features
- Supports both new and old NIC types.
## Installation
git clone https://github.com/chehanr/nic_parser.git && cd nic_parser
python setup.py install
Or
pip install nic-parser
## Usage
>>> from nic_parser.parser import Parser
>>> nic = Parser('952903022V')
>>> nic.birth_date
datetime.datetime(1995, 10, 16, 0, 0)
>>> nic.gender
>>> nic.serial_number
302
>>> nic.check_digit
2
>>> nic.special_letter
'V'
>>> nic.id_type
>>>
## TODO
- ~Add NIC number generation.~
- ...