Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dg2, dg7 and dg11 #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add dg2, dg7 and dg11 #3

wants to merge 6 commits into from

Conversation

arosasg
Copy link

@arosasg arosasg commented May 18, 2024

  •  Added dg2
  • Added dg7
  • Added dg11
  • Restructure ef code

@smlu
Copy link
Member

smlu commented May 19, 2024

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

@nejc-skerjanc
Copy link
Contributor

Check this commit:
8023116

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

@arosasg
Copy link
Author

arosasg commented May 21, 2024

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
from .dg2 import DataGroup2

from .sod import SOD, SODError

Copy link
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.

("aa_info", ActiveAuthenticationInfo),
("chip_auth_info", ChipAuthenticationInfo),
("chip_auth_pub_key_info", ChipAuthenticationPublicKeyInfo),
# Note: Missing PACEDomainParameterInfo and PACEInfo
Copy link
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.

13: "EF.DG13",
14: "EF.DG14",
15: "EF.DG15",
16: "EF.DG16",
Copy link
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.

value = 4
elif value not in DataGroupNumber._map:
raise ValueError('Invalid data group number')
raise ValueError("Invalid data group number")
Copy link
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.

@@ -178,7 +181,20 @@ def mrz(self) -> MachineReadableZone:

@property
def native(self):
return { 'mrz': self.mrz.native }
return {"mrz": self.mrz.native}
Copy link
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 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
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 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
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 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
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 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
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 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
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