pythonbeid 0.3.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 CHANGED
@@ -1,13 +1,83 @@
1
- """pythonbeid — read information from Belgian eID cards."""
1
+ """pythonbeid: read and verify Belgian eID cards through PC/SC.
2
+
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
2
14
 
3
15
  from .card_reader import CardReader, list_readers
4
- from .exceptions import APDUError, CardCommunicationError, NoCardError, NoReaderError
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
- "list_readers",
9
- "NoReaderError",
62
+ "DocumentType",
63
+ "EidData",
64
+ "Identity",
10
65
  "NoCardError",
11
- "CardCommunicationError",
12
- "APDUError",
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",
13
83
  ]
pythonbeid/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())