An open API service indexing awesome lists of open source software.

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.

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.~
- ...