All Projects → Arg0s1080 → Mrz

Arg0s1080 / Mrz

Licence: gpl-3.0
Machine Readable Zone generator and checker for official travel documents sizes 1, 2, 3, MRVA and MRVB (Passports, Visas, national id cards and other travel documents)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mrz

Mern Stack Authentication
Secure MERN Stack CRUD Web Application using Passport.js Authentication
Stars: ✭ 60 (-49.58%)
Mutual labels:  passport
Constantine
A plugin for Clang compiler
Stars: ✭ 89 (-25.21%)
Mutual labels:  checker
Nodejs Mysql Links
A CRUD Web Application with authentication using Nodejs, Mysql and other Javascript technologies
Stars: ✭ 110 (-7.56%)
Mutual labels:  passport
Reactnativelaravellogin
Sample App for login using laravel 5.5 React Native and Redux
Stars: ✭ 75 (-36.97%)
Mutual labels:  passport
Poetryclub Backend
基于 laravel + vue.js 的诗词小筑网站后台页面与后端代码
Stars: ✭ 87 (-26.89%)
Mutual labels:  passport
Chat.io
A Real Time Chat Application built using Node.js, Express, Mongoose, Socket.io, Passport, & Redis.
Stars: ✭ 1,325 (+1013.45%)
Mutual labels:  passport
Laravel Janitor
🔑 Easily add login proxy to your Laravel API
Stars: ✭ 54 (-54.62%)
Mutual labels:  passport
Atlantr
Fastes Email:Pass Checker on the planet.
Stars: ✭ 115 (-3.36%)
Mutual labels:  checker
Koa Starter
🐨 A starter kit for a slightly opinionated koa project.
Stars: ✭ 87 (-26.89%)
Mutual labels:  passport
Laravel Tenancy Passport Demo
Laravel demo with Passport and Tenancy
Stars: ✭ 107 (-10.08%)
Mutual labels:  passport
Lipika Ime
Input Method Engine (IME) for Mac OS X with built-in support for all Indic Languages
Stars: ✭ 76 (-36.13%)
Mutual labels:  transliteration
Node Express Mongoose
A boilerplate application for building web apps using node and mongodb
Stars: ✭ 1,221 (+926.05%)
Mutual labels:  passport
Fork Ts Checker Webpack Plugin
Webpack plugin that runs typescript type checker on a separate process.
Stars: ✭ 1,343 (+1028.57%)
Mutual labels:  checker
Ssl Checker
A tiny NodeJS module to check SSL expiry 🔒
Stars: ✭ 62 (-47.9%)
Mutual labels:  checker
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (-5.88%)
Mutual labels:  passport
Codice Fiscale
A PHP library to calculate and check the italian tax code (codice fiscale).
Stars: ✭ 57 (-52.1%)
Mutual labels:  checker
Cyrillic To Translit Js
Ultra-lightweight JavaScript library for converting Cyrillic symbols to Translit and vice versa
Stars: ✭ 91 (-23.53%)
Mutual labels:  transliteration
Laravel Passport Android
Laravel + Passport for an Android App
Stars: ✭ 116 (-2.52%)
Mutual labels:  passport
Passport Social Grant
Stars: ✭ 114 (-4.2%)
Mutual labels:  passport
Burp Unauth Checker
burpsuite extension for check unauthorized vulnerability
Stars: ✭ 99 (-16.81%)
Mutual labels:  checker

MRZ Generator & MRZ Checker

Description:

Machine Readable Zone generator and checker for official travel documents sizes 1, 2, 3, MRVA and MRVB (Passports, Visas, national id cards and other travel documents)

MRZ Generator and MRZ Checker are built according to International Civil Aviation Organization specifications (ICAO 9303):

See all 9303 ICAO docs (البيت العربي, 中文, English, Français, Русский and Español)

Fields Distribution of Official Travel Documents:

image

Usage Generator:

TD1's (id cards):

Params:                      Case insensitive

    document_type    (str):  The first letter shall be 'I', 'A' or 'C'
    country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
    document_number  (str):  Document number
    birth_date       (str):  YYMMDD
    sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined: 'X', "<" or ""
    expiry_date      (str):  YYMMDD
    nationality      (str):  3 letters code (ISO 3166-1) or country name (in English)
    surname          (str):  Holder primary identifier(s). This field will be transliterated
    given_names      (str):  Holder secondary identifier(s). This field will be transliterated
    optional_data1   (str):  Optional personal data at the discretion of the issuing State.
                             Non-mandatory field. Empty string by default
    optional_data2   (str):  Optional personal data at the discretion of the issuing State.
                             Non-mandatory field. Empty string by default
    transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
    force           (bool):  Disables checks for country, nationality and document_type fields.
                             Allows to use 3-letter-codes not included in the countries dictionary
                             and to use document_type codes without restrictions.

TD2

Params:                      Case insensitive

    document_type    (str):  The first letter shall be 'I', 'A' or 'C'
    country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
    surname          (str):  Holder primary identifier(s). This field will be transliterated.
    given_names      (str):  Holder secondary identifier(s). This field will be transliterated.
    document_number  (str):  Document number.
    nationality      (str):  3 letters code (ISO 3166-1) or country name
    birth_date       (str):  YYMMDD
    sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined: 'X', "<" or ""
    expiry_date      (str):  YYMMDD
    optional_data    (str):  Optional personal data at the discretion of the issuing State.
                             Non-mandatory field. Empty string by default
    transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
    force           (bool):  Disables checks for country, nationality and document_type fields.
                             Allows to use 3-letter-codes not included in the countries dictionary
                             and to use document_type codes without restrictions.

TD3 (Passports)

Params:                      Case insensitive

    document_type    (str):  Normally 'P' for passport
    country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
    surname          (str):  Primary identifier(s)
    given_names      (str):  Secondary identifier(s)
    document_number  (str):  Document number
    nationality      (str):  3 letters code (ISO 3166-1) or country name
    birth_date       (str):  YYMMDD
    sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined: 'X', "<" or ""
    expiry_date      (str):  YYMMDD
    optional data    (str):  Personal number. In some countries non-mandatory field. Empty string by default
    transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
    force           (bool):  Disables checks for country, nationality and document_type fields.
                             Allows to use 3-letter-codes not included in the countries dictionary
                             and to use document_type codes without restrictions.

MRVA (Visas type A)

Params:                      Case insensitive

    document_type    (str):  The First letter must be 'V'
    country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
    surname          (str):  Primary identifier(s)
    given_names      (str):  Secondary identifier(s)
    document_number  (str):  Document number
    nationality      (str):  3 letters code (ISO 3166-1) or country name
    birth_date       (str):  YYMMDD
    sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined: 'X', "<" or ""
    expiry_date      (str):  YYMMDD
    optional_data    (str):  Optional personal data at the discretion of the issuing State.
                             Non-mandatory field. Empty string by default.
    transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
    force           (bool):  Disables checks for country, nationality and document_type fields.
                             Allows to use 3-letter-codes not included in the countries dictionary
                             and to use document_type codes without restrictions.

MRVB (Visas type B)

Params:                      Case insensitive

    document_type    (str):  The First letter must be 'V'
    country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
    surname          (str):  Primary identifier(s)
    given_names      (str):  Secondary identifier(s)
    document_number  (str):  Document number
    nationality      (str):  3 letters code (ISO 3166-1) or country name
    birth_date       (str):  YYMMDD
    sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined: 'X', "<" or ""
    expiry_date      (str):  YYMMDD
    optional_data    (str):  Optional personal data at the discretion of the issuing State.
                             Non-mandatory field. Empty string by default.
    transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
    force           (bool):  Disables checks for country, nationality and document_type fields.
                             Allows to use 3-letter-codes not included in the countries dictionary
                             and to use document_type codes without restrictions.
Passport generator example (ICAO9303 Specimen):

image

TD3CodeGenerator -> str:
from mrz.generator.td3 import TD3CodeGenerator

code = TD3CodeGenerator("P", "UTO", "Eriksson", "Anna María", "L898902C3", "UTO", "740812", "F", "120415","ZE184226B")

print(code)
Output:
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
Note: See other uses in mrz.generator examples folder

Usage Checker:

TD1's (id cards):

Params:

    mrz_string        (str):  MRZ string of TD1. Must be 90 uppercase characters long (3 lines)
    check_expiry     (bool):  If it's set to True, it is verified and reported as warning that the
                              document is not expired and that expiry_date is not greater than 10 years
    compute_warnings (bool):  If it's set True, warnings compute as False

TD2:

Params:

    mrz_string        (str):  MRZ string of TD2. Must be 72 characters long (uppercase) (2 lines)
    check_expiry     (bool):  If it's set to True, it is verified and reported as warning that the
                              document is not expired and that expiry_date is not greater than 10 years
    compute_warnings (bool):  If it's set True, warnings compute as False

TD3 (Passports):

Params:

    mrz_string        (str):  MRZ string of TD3. Must be 88 characters long (uppercase) (2 lines)
    check_expiry     (bool):  If it's set to True, it is verified and reported as warning that the
                              document is not expired and that expiry_date is not greater than 10 years
    compute_warnings (bool):  If it's set True, warnings compute as False

MRVA:

Params:

    mrz_string        (str):  MRZ string of Visas type A. Must be 88 characters long (uppercase) (2 lines)
    check_expiry     (bool):  If it's set to True, it is verified and reported as warning that the
                              document is not expired and that expiry_date is not greater than 10 years
    compute_warnings (bool):  If it's set True, warnings compute as False

MRVB:

Params:

    mrz_string        (str):  MRZ string of Visas type B. Must be 72 characters long (uppercase) (2 lines)
    check_expiry     (bool):  If it's set to True, it is verified and reported as warning that the
                              document is not expired and that expiry_date is not greater than 10 years
    compute_warnings (bool):  If it's set True, warnings compute as False
Id Card Checker example

image

TD1CodeChecker -> bool
from mrz.checker.td1 import TD1CodeChecker
    
check = TD1CodeChecker("I<SWE59000002<8198703142391<<<\n"
                       "8703145M1701027SWE<<<<<<<<<<<8\n"
                       "SPECIMEN<<SVEN<<<<<<<<<<<<<<<<")
result = bool(check)
print(result)
Output
True
Note: See other uses in mrz.checker examples folder
Fields extraction example (valid for td1, td2, td3 and visas)
from mrz.checker.td1 import TD1CodeChecker, get_country

td1_check = TD1CodeChecker("IDLIEID98754015<<<<<<<<<<<<<<<\n"
                           "8205122M1906224LIE<<<<<<<<<<<6\n"
                           "OSPELT<BECK<<MARISA<<<<<<<<<<<")

fields = td1_check.fields()

print(fields.name, fields.surname)
print(get_country(fields.country))

Output
MARISA OSPELT BECK
Liechtenstein
Note: See other uses in mrz.checker examples folder and this issue

Installation:

From Pypi repo (It may not be the latest version):

pip install mrz 

Cloning this repo (It may not work fine):

git clone https://github.com/Arg0s1080/mrz.git
cd mrz
sudo python3 setup.py install

Features:

  • [x] Transliteration of special Latin characters (acutes, tildes, diaeresis, graves, circumflex, etc)
  • [x] Arabic chars transliteration
  • [x] Several variations of Cyrillic added: Serbian, Macedonian, Belarusian, Ukrainian and Bulgarian
  • [x] Transliteration of modern Greek (experimental)
  • [x] Transliteration of modern Hebrew (without vowels) (experimental)
  • [x] Generation of the country code from its name in English (Ex.: "Netherlands" -> "NLD")
  • [x] Name truncation detection
  • [x] Error report, warnings report and full report in Checker.
  • [x] Possibility that warnings compute as errors using compute_warnings keyword in Checker.
  • [x] Possibility of disabling checks for country code, nationality and type of document, allowing to use 3-letter-codes not included in the countries dictionary and to use document_type codes without restrictions in Generator.
  • [x] Added new checks for periods of time in Checker.
  • [x] Visas support
  • [x] Fields extraction in checker (name, surname, country, sex, etc) (version 0.5.0)
TODO:
  • [ ] Automatic name truncation in Generator
  • [ ] Possibility of disabling checks for country code, nationality, type of document and the others fields in Checker.
  • [ ] Add logging

IMPORTANT:

  • MRZ is a Python module to be used as library in other programs. So, its intended audience are developers. MRZ will never have a user interface nor will have CLI support. (Of course.. if someone wants, can do it) However, if someone is curious and wants to generate or check the mrz code of a passport or ID card, can modify any of the examples.

  • Right now I am very busy and have very little free time. Please, before creating an issue or consulting by email, read this issue

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].