pythonbeid 0.2.0__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pythonbeid/__init__.py +77 -6
- pythonbeid/__main__.py +3 -0
- pythonbeid/card_reader.py +846 -256
- pythonbeid/cli.py +176 -0
- pythonbeid/exceptions.py +73 -30
- pythonbeid/integrity.py +455 -0
- pythonbeid/models.py +593 -0
- pythonbeid/parser.py +472 -89
- pythonbeid/py.typed +0 -0
- pythonbeid/trust/belgium_root_ca2.pem +22 -0
- pythonbeid/trust/belgium_root_ca3.pem +32 -0
- pythonbeid/trust/belgium_root_ca4.pem +32 -0
- pythonbeid/trust/belgium_root_ca6.pem +21 -0
- pythonbeid-1.0.0.dist-info/METADATA +293 -0
- pythonbeid-1.0.0.dist-info/RECORD +19 -0
- {pythonbeid-0.2.0.dist-info → pythonbeid-1.0.0.dist-info}/WHEEL +1 -1
- pythonbeid-1.0.0.dist-info/entry_points.txt +2 -0
- {pythonbeid-0.2.0.dist-info → pythonbeid-1.0.0.dist-info}/licenses/LICENSE +21 -21
- pythonbeid-0.2.0.dist-info/METADATA +0 -104
- pythonbeid-0.2.0.dist-info/RECORD +0 -9
- {pythonbeid-0.2.0.dist-info → pythonbeid-1.0.0.dist-info}/top_level.txt +0 -0
pythonbeid/__init__.py
CHANGED
|
@@ -1,12 +1,83 @@
|
|
|
1
|
-
"""pythonbeid
|
|
1
|
+
"""pythonbeid: read and verify Belgian eID cards through PC/SC.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Quick start::
|
|
4
|
+
|
|
5
|
+
from pythonbeid import CardReader
|
|
6
|
+
|
|
7
|
+
with CardReader() as reader:
|
|
8
|
+
eid = reader.read()
|
|
9
|
+
print(eid.identity.last_name, eid.identity.birth_date)
|
|
10
|
+
print(reader.verify(eid).is_valid) # needs pythonbeid[verify]
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
14
|
+
|
|
15
|
+
from .card_reader import CardReader, list_readers
|
|
16
|
+
from .exceptions import (
|
|
17
|
+
APDUError,
|
|
18
|
+
BeidError,
|
|
19
|
+
CardCommunicationError,
|
|
20
|
+
CardDataError,
|
|
21
|
+
NoCardError,
|
|
22
|
+
NoReaderError,
|
|
23
|
+
PCSCServiceError,
|
|
24
|
+
UnsupportedCardError,
|
|
25
|
+
)
|
|
26
|
+
from .integrity import verify_eid, verify_photo
|
|
27
|
+
from .models import (
|
|
28
|
+
Address,
|
|
29
|
+
CardFile,
|
|
30
|
+
CardInfo,
|
|
31
|
+
DocumentType,
|
|
32
|
+
EidData,
|
|
33
|
+
Identity,
|
|
34
|
+
PartialDate,
|
|
35
|
+
Sex,
|
|
36
|
+
SpecialStatus,
|
|
37
|
+
VerificationReport,
|
|
38
|
+
)
|
|
39
|
+
from .parser import (
|
|
40
|
+
decode_tlv,
|
|
41
|
+
is_valid_national_number,
|
|
42
|
+
parse_address,
|
|
43
|
+
parse_birth_date,
|
|
44
|
+
parse_card_data,
|
|
45
|
+
parse_identity,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
try:
|
|
49
|
+
__version__ = version("pythonbeid")
|
|
50
|
+
except PackageNotFoundError: # pragma: no cover - running from a source tree
|
|
51
|
+
__version__ = "0+unknown"
|
|
5
52
|
|
|
6
53
|
__all__ = [
|
|
54
|
+
"APDUError",
|
|
55
|
+
"Address",
|
|
56
|
+
"BeidError",
|
|
57
|
+
"CardCommunicationError",
|
|
58
|
+
"CardDataError",
|
|
59
|
+
"CardFile",
|
|
60
|
+
"CardInfo",
|
|
7
61
|
"CardReader",
|
|
8
|
-
"
|
|
62
|
+
"DocumentType",
|
|
63
|
+
"EidData",
|
|
64
|
+
"Identity",
|
|
9
65
|
"NoCardError",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
66
|
+
"NoReaderError",
|
|
67
|
+
"PCSCServiceError",
|
|
68
|
+
"PartialDate",
|
|
69
|
+
"Sex",
|
|
70
|
+
"SpecialStatus",
|
|
71
|
+
"UnsupportedCardError",
|
|
72
|
+
"VerificationReport",
|
|
73
|
+
"__version__",
|
|
74
|
+
"decode_tlv",
|
|
75
|
+
"is_valid_national_number",
|
|
76
|
+
"list_readers",
|
|
77
|
+
"parse_address",
|
|
78
|
+
"parse_birth_date",
|
|
79
|
+
"parse_card_data",
|
|
80
|
+
"parse_identity",
|
|
81
|
+
"verify_eid",
|
|
82
|
+
"verify_photo",
|
|
12
83
|
]
|
pythonbeid/__main__.py
ADDED