Skip to main content

Validira i ispisuje osnovne podatke o JMBGu. EN: Validates and displays basic UMCN data.

Project description

jmbg-validator

(README in English available below)

Program validira i ispisuje osnovne podatke o JMBGu.

Privatnost

Program ne čuva JMBG ni u kakvoj bazi niti ga šalje trećim stranama.

Instalacija

pip install jmbg-validator

Dolazi sa alatom za komandnu liniju (CLI) po imenu jmbg-validator i Python modulom jmbg_validator

Upotreba

Matični broj 1234567890123 nije validan i koristi se samo kao primer.

U komandnoj liniji (CLI)

Alat za komandnu liniju se može koristiti na sledeći način:

$ jmbg-validator 1234567890123
Pol                     Validan         Datum rođenja           Region
Muški                   Da              11.12.1989.             Vojvodina, Novi Sad

$ jmbg-validator 1234567890123 -o json
{"pol": "ženski", "datum_rodjenja": "06.09.1992.", "validan": true, "region": "Bosna i Hercegovina, Tuzla"}

Pregled svih dostupnih opcija:

usage: jmbg-validator [-h] [--output {table,text,json}] jmbg

Validira i ispisuje osnovne podatke o JMBGu

positional arguments:
  jmbg                  13 karaktera JMBGa

optional arguments:
  -h, --help            show this help message and exit
  --output {table,text,json}, -o {table,text,json}

Kao Python modul

>>> from jmbg_validator import validate
>>> validate("1234567890123")
JMBG(pol='muški', datum_rodjenja='11.12.1989.', validan=True, region='Vojvodina, Novi Sad')
>>> print(validate("1234567890123"))
Pol: Muški, Validan: Da, Datum rođenja: 11.12.1989., Region: Vojvodina, Novi Sad
>>> validate("1234567890123")
>>> rezultat = JMBG(pol='muški', datum_rodjenja='11.12.1989.', validan=True, region='Vojvodina, Novi Sad')
>>> rezultat.validan
True

Za developere

$ python -m venv venv
$ source venv/bin/activate
$ pip install -e .
$ pip install -r dev_requirements.txt

Testiranje

$ python -m unittest discover
....................................................................
----------------------------------------------------------------------
Ran 68 tests in 0.001s

OK

Licenca

Mozilla Public License 2.0 ili ukratko


jmbg-validator

This program validates and displays basic UMCN data. UMCN was/still is in use in former Yugoslav republics as a way to uniquely identify citizens.

Privacy

This program does not store the UMCN and it does not share it with 3rd parties.

Installation

pip install jmbg-validator

Comes with a CLI tool jmbg-validator and a Python module named jmbg_validator

Usage

UMCN 1234567890123 used below is not valid and is used for demonstration purposes only.

As a CLI tool

CLI tool can be used in this way:

$ jmbg-validator 1234567890123
Pol                     Validan         Datum rođenja           Region
Muški                   Da              11.12.1989.             Vojvodina, Novi Sad

$ jmbg-validator 1234567890123 -o json
{"pol": "ženski", "datum_rodjenja": "06.09.1992.", "validan": true, "region": "Bosna i Hercegovina, Tuzla"}

Overview of available arguments:

usage: jmbg-validator [-h] [--output {table,text,json}] jmbg

Validira i ispisuje osnovne podatke o JMBGu

positional arguments:
  jmbg                  13 karaktera JMBGa

optional arguments:
  -h, --help            show this help message and exit
  --output {table,text,json}, -o {table,text,json}

As a Python module

>>> from jmbg_validator import validate
>>> validate("1234567890123")
JMBG(pol='muški', datum_rodjenja='11.12.1989.', validan=True, region='Vojvodina, Novi Sad')
>>> print(validate("1234567890123"))
Pol: Muški, Validan: Da, Datum rođenja: 11.12.1989., Region: Vojvodina, Novi Sad
>>> validate("1234567890123")
>>> rezultat = JMBG(pol='muški', datum_rodjenja='11.12.1989.', validan=True, region='Vojvodina, Novi Sad')
>>> rezultat.validan
True

For developers

$ python -m venv venv
$ source venv/bin/activate
$ pip install -e .
$ pip install -r dev_requirements.txt

Running tests

$ python -m unittest discover
....................................................................
----------------------------------------------------------------------
Ran 68 tests in 0.001s

OK

License

Mozilla Public License 2.0 or in short

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

JMBG Validator-1.0.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

JMBG_Validator-1.0.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file JMBG Validator-1.0.2.tar.gz.

File metadata

  • Download URL: JMBG Validator-1.0.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for JMBG Validator-1.0.2.tar.gz
Algorithm Hash digest
SHA256 b8c6bd57d768adede322908300fb547198ac9e36f7a97a5a76d1d76a472b705d
MD5 2e497b89cab0c6a849ab3e4e342b0fcf
BLAKE2b-256 21a1adf56548aa35ad0e1efc7f79456f043620da0f6b0f89503867cd83455de1

See more details on using hashes here.

File details

Details for the file JMBG_Validator-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: JMBG_Validator-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for JMBG_Validator-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efb119c940a229640a5084155fdb952e95ee6e4439a304638b12a7ab5cecc137
MD5 cafb389b0bbcaced225b1470ba99376f
BLAKE2b-256 50d7c8274a4e1c13a388384cd3cb210d84426d681c50374a9a5b06985556803d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page