https://github.com/kalebu/nida
Unofficial package for fetching users information based on National ID Number (Tanzania)
https://github.com/kalebu/nida
national-id-libary nida-api nida-api-tanzania python python-nida python-tanzania tanzania
Last synced: 3 months ago
JSON representation
Unofficial package for fetching users information based on National ID Number (Tanzania)
- Host: GitHub
- URL: https://github.com/kalebu/nida
- Owner: Kalebu
- Created: 2021-04-20T09:22:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T11:06:06.000Z (about 2 years ago)
- Last Synced: 2024-12-17T06:17:21.468Z (10 months ago)
- Topics: national-id-libary, nida-api, nida-api-tanzania, python, python-nida, python-tanzania, tanzania
- Language: Python
- Homepage: https://kalebu.github.io/Nida/
- Size: 2.02 MB
- Stars: 81
- Watchers: 7
- Forks: 22
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# [Nida](https://kalebu.github.io/Nida/)
Unofficial package for fetching users information based on National ID Number made by [kalebu](https://github.com/Kalebu/)
[](https://github.com/Kalebu/nida)
[](https://pepy.tech/project/nida)
[](https://pepy.tech/project/nida)
[](https://pepy.tech/project/nida)
[](https://opensource.org/licenses/MIT)## Installation
You can install it directly or using pip
Here how to install directly
```bash
git clone https://github.com/Kalebu/Nida
cd Nida
Nida -> python setup.y install
```Here how to install from pip
```bash
pip install nida
```## Usage
To fetch user information based on ID number do this;
```python
>>> from nida import load_user
>>> user_detail = load_user(national_id='XXXXXXXXX')
>>> print(user_detail)
user
{'Nin': 'XXXXXX', 'Firstname': 'XXXXXX', 'Middlename': 'XXXXXX', 'Surname': 'XXXXXX', 'Othernames': 'XXXXXX', 'Sex': 'XXXXXX', 'Dateofbirth': 'XXXXXX', 'Residentregion': 'XXXXXX', 'Residentdistrict': 'XXXXXX', 'Residentward': 'XXXXXX', 'Residentvillage': 'XXXXXX', 'Residentstreet': 'XXXXXX', 'Residentpostcode': 'XXXXXX', 'Permanentregion': 'XXXXXX', 'Permanentdistrict': 'XXXXXX', 'Permanentward': 'XXXXXX', 'Permanentvillage': 'XXXXXX', 'Permanentstreet': 'XXXXXX', 'Birthcountry': 'XXXXXX', 'Birthregion': 'XXXXXX', 'Birthdistrict': 'XXXXXX', 'Birthward': 'XXXXXX', 'Nationality': 'XXXXXX', 'Phonenumber': 'XXXXXX', 'Maritalstatus': 'XXXXXX', 'Occupation': 'XXXXXX', 'Primaryschooleducation': 'XXXXXX', 'Primaryschooldistrict': 'XXXXXX', 'Primaryschoolyear': 'XXXXXX', 'Photo': 'XXXXXX', 'Signature': 'XXXXXX', 'Nationalidnumber': 'XXXXXX', 'Lastname': 'XXXXXX'}
```You can access user infromation by using keys and attributes just as shown below;
```python
>>> user_detetail['Firstname']
'XXXXXX'
>>> user_detail.get('Middlename')
'XXXXXX'
>>> user_detail.Lastname
'XXXXXX'
```## Image and Signature are currently not supported (Depreciated !!)
National ID Photo and Signature are auto converted into PIL Images and you can easily save just as shown below;
```python
>>> user_detail.Photo.save('National_ID.png')
>>> user_detail.Signature.save('Signature.png')
```If you want the data to be in the same from an API without any side effect preprocessing do this instead while loading user;
```python
>>> user_detail = load_user('xxxxxxxxxx', json = True)
>>> print(user_detail)
{
....
}
```## Give it star
Did you find this repository useful to you ? Well then give it a star so as more people can get to know about it;
## Issues
Are you facing any issue with usage of the package, just raise an issue and I looking to fixing it as soon as I can.
## Contributions
If there is anything yould would like to add warmly welcome, Just fork it
## Disclaimers
This is not an official package, therefore I'm not responsible for any misinformation or misuse of the package of any kind !!!
## Credits
All the credits to [Kalebu](https://github.com/Kalebu/) and [StackOverflow comment](https://stackoverflow.com/questions/53369396/how-to-integrate-national-identification-authority-nida-api-for-tanzania) from [dbrax](https://stackoverflow.com/users/6131960/emanuel-paul-mnzava)