-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: master
Are you sure you want to change the base?
Conversation
arosasg
commented
May 18, 2024
•
edited
Loading
edited
- Added dg2
- Added dg7
- Added dg11
- Restructure ef code
Thank you for this PR! I'll be reviewing it shortly. |
Check this commit: Do the same on your branch. Library has been changed and therefore it throws few errors. |
Done |
src/pymrtd/ef/__init__.py
Outdated
from .dg2 import DataGroup2 | ||
|
||
from .sod import SOD, SODError | ||
|
There was a problem hiding this comment.
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.
src/pymrtd/ef/dg.py
Outdated
("aa_info", ActiveAuthenticationInfo), | ||
("chip_auth_info", ChipAuthenticationInfo), | ||
("chip_auth_pub_key_info", ChipAuthenticationPublicKeyInfo), | ||
# Note: Missing PACEDomainParameterInfo and PACEInfo |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use single quote mark.
src/pymrtd/ef/dg.py
Outdated
@@ -178,7 +181,20 @@ def mrz(self) -> MachineReadableZone: | |||
|
|||
@property | |||
def native(self): | |||
return { 'mrz': self.mrz.native } | |||
return {"mrz": self.mrz.native} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use single quote mark.
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" |
There was a problem hiding this comment.
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.
"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": "", |
There was a problem hiding this comment.
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.
"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", |
There was a problem hiding this comment.
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.
"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": "", |
There was a problem hiding this comment.
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.
"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", |
There was a problem hiding this comment.
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.