pythonbeid 0.1.0__tar.gz → 0.1.1__tar.gz
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-0.1.0 → pythonbeid-0.1.1}/PKG-INFO +1 -1
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/README.md +59 -59
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid/card_reader.py +3 -2
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid.egg-info/PKG-INFO +1 -1
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/setup.py +1 -1
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/LICENSE +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid/__init__.py +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid.egg-info/SOURCES.txt +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid.egg-info/dependency_links.txt +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid.egg-info/requires.txt +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/pythonbeid.egg-info/top_level.txt +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/setup.cfg +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/tests/__init__.py +0 -0
- {pythonbeid-0.1.0 → pythonbeid-0.1.1}/tests/test_card_reader.py +0 -0
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
# PythonBEID
|
|
3
|
-
|
|
4
|
-
PythonBEID est un module Python pour lire les informations essentielles des cartes d'identité belge à l'aide d'un lecteur de cartes et de la bibliothèque `pyscard`.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
Vous pouvez installer ce module via pip :
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
pip install pythonbeid
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Utilisation
|
|
15
|
-
|
|
16
|
-
Voici un exemple simple d'utilisation du module `pythonbeid` pour lire les informations d'une carte :
|
|
17
|
-
|
|
18
|
-
```python
|
|
19
|
-
from pythonbeid.card_reader import CardReader
|
|
20
|
-
from pprint import pprint
|
|
21
|
-
|
|
22
|
-
def main():
|
|
23
|
-
try:
|
|
24
|
-
cr = CardReader()
|
|
25
|
-
informations = cr.read_informations(photo=False)
|
|
26
|
-
pprint(informations)
|
|
27
|
-
except RuntimeError as e:
|
|
28
|
-
print(f"Erreur: {e}")
|
|
29
|
-
|
|
30
|
-
if __name__ == "__main__":
|
|
31
|
-
main()
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Dépendances
|
|
35
|
-
|
|
36
|
-
Ce module nécessite la bibliothèque suivante :
|
|
37
|
-
- `pyscard`
|
|
38
|
-
|
|
39
|
-
Vous pouvez installer les dépendances avec pip :
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
pip install -r requirements.txt
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Tests
|
|
46
|
-
|
|
47
|
-
Les tests unitaires sont situés dans le répertoire `tests`. Vous pouvez exécuter les tests avec `unittest` :
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
python -m unittest discover -s tests
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Contribuer
|
|
54
|
-
|
|
55
|
-
Les contributions et améliorations sont les bienvenues !
|
|
56
|
-
|
|
57
|
-
## Licence
|
|
58
|
-
|
|
59
|
-
Ce projet est sous licence MIT. Voir le fichier `LICENSE` pour plus de détails.
|
|
1
|
+
|
|
2
|
+
# PythonBEID
|
|
3
|
+
|
|
4
|
+
PythonBEID est un module Python pour lire les informations essentielles des cartes d'identité belge à l'aide d'un lecteur de cartes et de la bibliothèque `pyscard`.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Vous pouvez installer ce module via pip :
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install pythonbeid
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Utilisation
|
|
15
|
+
|
|
16
|
+
Voici un exemple simple d'utilisation du module `pythonbeid` pour lire les informations d'une carte :
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from pythonbeid.card_reader import CardReader
|
|
20
|
+
from pprint import pprint
|
|
21
|
+
|
|
22
|
+
def main():
|
|
23
|
+
try:
|
|
24
|
+
cr = CardReader()
|
|
25
|
+
informations = cr.read_informations(photo=False)
|
|
26
|
+
pprint(informations)
|
|
27
|
+
except RuntimeError as e:
|
|
28
|
+
print(f"Erreur: {e}")
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
main()
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Dépendances
|
|
35
|
+
|
|
36
|
+
Ce module nécessite la bibliothèque suivante :
|
|
37
|
+
- `pyscard`
|
|
38
|
+
|
|
39
|
+
Vous pouvez installer les dépendances avec pip :
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install -r requirements.txt
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Tests
|
|
46
|
+
|
|
47
|
+
Les tests unitaires sont situés dans le répertoire `tests`. Vous pouvez exécuter les tests avec `unittest` :
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python -m unittest discover -s tests
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Contribuer
|
|
54
|
+
|
|
55
|
+
Les contributions et améliorations sont les bienvenues !
|
|
56
|
+
|
|
57
|
+
## Licence
|
|
58
|
+
|
|
59
|
+
Ce projet est sous licence MIT. Voir le fichier `LICENSE` pour plus de détails.
|
|
@@ -14,7 +14,7 @@ Usage:
|
|
|
14
14
|
Author:
|
|
15
15
|
Your Name (youremail@example.com)
|
|
16
16
|
"""
|
|
17
|
-
|
|
17
|
+
import base64
|
|
18
18
|
from datetime import datetime
|
|
19
19
|
from pprint import pprint
|
|
20
20
|
from smartcard.System import readers
|
|
@@ -196,7 +196,8 @@ class CardReader:
|
|
|
196
196
|
|
|
197
197
|
if photo:
|
|
198
198
|
photo_data = self._read_photo()
|
|
199
|
-
|
|
199
|
+
base64_encoded = base64.b64encode(photo_data)
|
|
200
|
+
informations["photo"] = base64_encoded.decode('utf-8')
|
|
200
201
|
|
|
201
202
|
for attribute, value in informations.items():
|
|
202
203
|
setattr(self, attribute, value)
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="pythonbeid",
|
|
8
|
-
version="0.1.
|
|
8
|
+
version="0.1.1",
|
|
9
9
|
author="Fabien Toune",
|
|
10
10
|
author_email="fabien.toune@gmail.com",
|
|
11
11
|
description="Un module pour lire les informations des cartes d'identité belges",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|