def test_mrvb_generator(self): generator = MRVBCodeGenerator("V", "UTO", "ERIKSSON", "ANNA MARIA", "L8988901C", "Unknown", "400907", "F", "961210") result = ("V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<\n" "L8988901C4XXX4009078F9612109<<<<<<<<") self.assertEqual(str(generator), result)
def test_mrvb_generator(self): generator = MRVBCodeGenerator("VB", "D", "DEDIC", "SIDNAN", "D09174053", "BOS", "820113", "M", "970801", " 2020711", force=True) result = ("VBD<<DEDIC<<SIDNAN<<<<<<<<<<<<<<<<<<\n" "D091740530BOS8201135M9708011<2020711") self.assertEqual(str(generator), result)
#!/usr/bin/python3 # -*- coding: UTF-8 -*- # Adding mrz to PYTHONPATH to execute this example as script from os.path import dirname, join, pardir, realpath import sys sys.path.append(realpath(join(dirname(__file__), pardir, pardir))) ############################################################# from mrz.generator.mrvb import MRVBCodeGenerator from examples.functions.functions import open_image print(MRVBCodeGenerator( "V", # Document type For visas, the first letter must be 'V' "UTO", # Country 3 letters code or country name "ERIKSSON", # Surname(s) Special characters will be transliterated "ANNA MARIA", # Given name(s) Special characters will be transliterated "L8988901C", # Document number "Unknown", # Nationality 3 letter code or country name "400907", # Birth date YYMMDD "F", # Genre Male: 'M', Female: 'F' or Undefined 'X' "961210")) # Expiry date YYMMDD open_image("visas", "MRVB_ICAO_Example.png")
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Adding mrz to PYTHONPATH to execute this example as script from os.path import dirname, join, pardir, realpath import sys sys.path.append(realpath(join(dirname(__file__), pardir, pardir))) ############################################################# from mrz.generator.mrvb import MRVBCodeGenerator from examples.functions.functions import open_image print(MRVBCodeGenerator( "VB", # Document type For visas, the first letter must be 'V' "D", # Country 3 letters code or country name. Note: Germany it's an # exception. Only uses one letter "DEDIC", # Surname(s) Special characters will be transliterated "SIDNAN", # Given name(s) Special characters will be transliterated "D09174053", # Document number "BOS", # Nationality 3 letter code or country name "820113", # Birth date YYMMDD "M", # Genre Male: 'M', Female: 'F' or Undefined 'X' "970801", # Expiry date YYMMDD " 2020711", # Optional data Not mandatory field force=True)) # Force Disables checks for country, nationality and document_type # fields. Note: 'BOS' is deprecated or non-normative open_image("visas", "Germany.png")
from mrz.generator.mrvb import MRVBCodeGenerator from examples.functions.functions import open_image print( MRVBCodeGenerator( "VD", # Document type For visas, the first letter must be 'V' "GBR", # Country 3 letters code or country name "MUNIR", # Surname(s) Special characters will be transliterated "FAISAL", # Given name(s) Special characters will be transliterated "AD0725981", # Document number "PAK", # Nationality 3 letter code or country name "760815", # Birth date YYMMDD "M", # Genre Male: 'M', Female: 'F' or Undefined 'X' "061116")) # Expiry date YYMMDD open_image("visas", "United_Kingdom.png")
from mrz.generator.mrvb import MRVBCodeGenerator from examples.functions.functions import open_image print( MRVBCodeGenerator( "VC", # Document type For visas, the first letter must be 'V' "FRA", # Country 3 letters code or country name "SPECIMEN", # Surname(s) Special characters will be transliterated "SPECIMEN", # Given name(s) Special characters will be transliterated "F00000000", # Document number "UTO", # Nationality 3 letter code or country name "031106", # Birth date YYMMDD "M", # Genre Male: 'M', Female: 'F' or Undefined 'X' "140114", # Expiry date YYMMDD " M300703")) # Optional data Not mandatory field open_image("visas", "France.png")