Skip to content

Add dg2, dg7 and dg11 - #3

Open
arosasg wants to merge 6 commits into
ZeroPass:masterfrom
arosasg:add-dg2
Open

Add dg2, dg7 and dg11#3
arosasg wants to merge 6 commits into
ZeroPass:masterfrom
arosasg:add-dg2

Conversation

@arosasg

@arosasg arosasg commented May 18, 2024

Copy link
Copy Markdown
  •  Added dg2
  • Added dg7
  • Added dg11
  • Restructure ef code

@smlu

smlu commented May 19, 2024

Copy link
Copy Markdown
Member

Thank you for this PR! I'll be reviewing it shortly.

@nejc-skerjanc

Copy link
Copy Markdown
Contributor

Check this commit:
8023116

Do the same on your branch. Library has been changed and therefore it throws few errors.

@arosasg

arosasg commented May 21, 2024

Copy link
Copy Markdown
Author

Check this commit: 8023116

Do the same on your branch. Library has been changed and therefore it throws few errors.

Done

@arosasg arosasg changed the title Add dg2 Add dg2, dg7 and dg11 May 22, 2024
Comment thread src/pymrtd/ef/__init__.py Outdated
from .dg2 import DataGroup2

from .sod import SOD, SODError

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert include style back to original.

Comment thread src/pymrtd/ef/dg.py Outdated
("aa_info", ActiveAuthenticationInfo),
("chip_auth_info", ChipAuthenticationInfo),
("chip_auth_pub_key_info", ChipAuthenticationPublicKeyInfo),
# Note: Missing PACEDomainParameterInfo and PACEInfo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single quote mark.

Comment thread src/pymrtd/ef/dg.py
13: "EF.DG13",
14: "EF.DG14",
15: "EF.DG15",
16: "EF.DG16",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single quote mark.

Comment thread src/pymrtd/ef/dg.py
value = 4
elif value not in DataGroupNumber._map:
raise ValueError('Invalid data group number')
raise ValueError("Invalid data group number")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single quote mark.

Comment thread src/pymrtd/ef/dg.py Outdated
@property
def native(self):
return { 'mrz': self.mrz.native }
return {"mrz": self.mrz.native}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single quote mark.

Comment thread tests/ef/mrz_test.py
Comment on lines +133 to +151
assert mrz.dump() == tv
assert mrz.type == "td3"
assert mrz.documentCode == "P"
assert mrz.country == "D"
assert mrz.documentNumber == "C11T002JM"
assert mrz["document_number_cd"] == 4
assert mrz["optional_data"] == ""
assert mrz.additionalData == ""
assert mrz["optional_data_cd"] == 0
assert mrz.dateOfBirth == date(1996, 8, 12)
assert mrz["date_of_birth_cd"] == 2
assert mrz.gender == "F"
assert mrz.dateOfExpiry == date(2023, 10, 31)
assert mrz["date_of_expiry_cd"] == 4
assert mrz.nationality == "D"
assert mrz["composite_cd"] == 4
assert mrz["name_identifiers"] == ("MUSTERMANN", "ERIKA")
assert mrz.name == "ERIKA"
assert mrz.surname == "MUSTERMANN"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, align by equal sign to match the original style.

Comment thread tests/ef/mrz_test.py
Comment on lines +153 to +163
"type": "td3",
"doc_code": "P",
"doc_number": "C11T002JM",
"date_of_expiry": date(2023, 10, 31),
"surname": "MUSTERMANN",
"name": "ERIKA",
"date_of_birth": date(1996, 8, 12),
"gender": "F",
"country": "D",
"nationality": "D",
"additional_data": "",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, align by equal sign to match the original style.

Comment thread tests/ef/mrz_test.py
Comment on lines +113 to +123
"type": "td3",
"doc_code": "P",
"doc_number": "L898902C3",
"date_of_expiry": date(2012, 4, 15),
"surname": "ERIKSSON",
"name": "ANNA MARIA",
"date_of_birth": date(1974, 8, 12),
"gender": "F",
"country": "UTO",
"nationality": "UTO",
"additional_data": "ZE184226B",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, align by equal sign to match the original style.

Comment thread tests/ef/mrz_test.py
Comment on lines +75 to +85
"type": "td2",
"doc_code": "I",
"doc_number": "D23145890734",
"date_of_expiry": date(1995, 7, 12),
"surname": "STEVENSON",
"name": "PETER JOHN",
"date_of_birth": date(1934, 7, 12),
"gender": "M",
"country": "UTO",
"nationality": "UTO",
"additional_data": "",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, align by equal sign to match the original style.

Comment thread tests/ef/mrz_test.py
Comment on lines +38 to +48
"type": "td1",
"doc_code": "I",
"doc_number": "XI85935F8",
"date_of_expiry": date(2011, 8, 26),
"surname": "VAN DER STEEN",
"name": "MARIANNE LOUISE",
"date_of_birth": date(1972, 8, 14),
"gender": "F",
"country": "NLD",
"nationality": "NLD",
"additional_data": "999999990",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, align by equal sign to match the original style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants