nsarchive 3.0.0b1__py3-none-any.whl → 3.0.0b2__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.
- nsarchive/__init__.py +3 -1
- nsarchive/errors/__init__.py +1 -0
- nsarchive/errors/_globals.py +29 -0
- nsarchive/interfaces/_economy.py +0 -252
- nsarchive/interfaces/_entities.py +100 -14
- nsarchive/interfaces/_justice.py +173 -21
- nsarchive/interfaces/_state.py +177 -34
- nsarchive/mandate.py +21 -2
- nsarchive/models/base.py +108 -69
- nsarchive/models/economy.py +80 -151
- nsarchive/models/entities.py +305 -68
- nsarchive/models/justice.py +23 -2
- nsarchive/models/republic.py +44 -4
- nsarchive/models/state.py +43 -4
- nsarchive-3.0.0b2.dist-info/METADATA +90 -0
- nsarchive-3.0.0b2.dist-info/RECORD +21 -0
- nsarchive-3.0.0b1.dist-info/METADATA +0 -21
- nsarchive-3.0.0b1.dist-info/RECORD +0 -19
- {nsarchive-3.0.0b1.dist-info → nsarchive-3.0.0b2.dist-info}/LICENSE +0 -0
- {nsarchive-3.0.0b1.dist-info → nsarchive-3.0.0b2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: nsarchive
|
3
|
+
Version: 3.0.0b2
|
4
|
+
Summary: API-wrapper pour récupérer des données liées à Nation
|
5
|
+
License: GPL-3.0
|
6
|
+
Author: happex
|
7
|
+
Author-email: 110610727+okayhappex@users.noreply.github.com
|
8
|
+
Requires-Python: >=3.10,<4.0
|
9
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
15
|
+
Requires-Dist: pillow (>=10.4,<11.0)
|
16
|
+
Requires-Dist: requests (>=2.31,<3.0)
|
17
|
+
Description-Content-Type: text/markdown
|
18
|
+
|
19
|
+
# NSArchive v3
|
20
|
+
|
21
|
+
## Pré-requis
|
22
|
+
|
23
|
+
- Python 3.10 ou + (Python 3.13 si possible)
|
24
|
+
- Un serveur avec [nation.db](https://github.com/1nserv/nation-db)
|
25
|
+
- Deux barres de Twix ou une tasse de thé
|
26
|
+
|
27
|
+
|
28
|
+
## Avant de démarrer
|
29
|
+
|
30
|
+
Dans la documentation, vous croiserez souvent des noms de classes comme `.User` ou autres similaires. Le «.» devant le nom de la classe signfie qu'elle appartient au module NSAv3, et qu'il faut donc les interprêter comme `nsarchive.User`. La seule exception est `NSID` qui ne sera pas précédé d'un point mais devra être interprêté de la même manière.
|
31
|
+
|
32
|
+
|
33
|
+
## Installation
|
34
|
+
|
35
|
+
L'installation de NSAv3 se fait via pip:
|
36
|
+
|
37
|
+
```sh
|
38
|
+
pip install nsarchive
|
39
|
+
```
|
40
|
+
|
41
|
+
La dernière version de nsarchive devrait s'installer. Les dépendances requises pour nsarchive sont `pillow` et `requests` mais celles-ci devraient s'installer en même temps que le module. Vous pourriez également avoir besoin des modules `bcrypt` et `python-dotenv`, ceux-ci devront être installés manuellement.
|
42
|
+
|
43
|
+
|
44
|
+
### Bonus: Environnement virtuel
|
45
|
+
|
46
|
+
Il est recommandé mais non obligatoire d'avoir un environnement virtuel (venv) pour votre projet. Sa création se fait comme ceci:
|
47
|
+
|
48
|
+
```sh
|
49
|
+
python -m venv .venv
|
50
|
+
```
|
51
|
+
|
52
|
+
N'oubliez pas de l'activer via cette commande pour powershell...
|
53
|
+
|
54
|
+
```ps1
|
55
|
+
.venv\Scripts\Activate
|
56
|
+
```
|
57
|
+
|
58
|
+
...ou cette commande pour les terminaux type UNIX (Bash par exemple)
|
59
|
+
|
60
|
+
```sh
|
61
|
+
source .venv/Scripts/Activate
|
62
|
+
```
|
63
|
+
|
64
|
+
## Prise en main
|
65
|
+
|
66
|
+
### Identifier les objets
|
67
|
+
|
68
|
+
Les objets sont tous identifiables sur NSAv3. Ils ont un identifiant commun appelé NSID (`from nsarchive import NSID`). Cet identifiant n'est rien de plus qu'un nombre hexadécimal. Il peut être utilisé comme un string, dans un print ou un f-string par exemple. Cet identifiant est communément basé sur plusieurs valeurs fixes ou universelles, dont les deux plus fréquentes sont:
|
69
|
+
- L'ID Discord de l'objet concerné, dans le cas d'un utilisateur par exemple
|
70
|
+
- Le timestamp (secondes depuis 1970) du moment où il a été créé, dans le cas de la plupart des autres objets
|
71
|
+
|
72
|
+
|
73
|
+
### Interfaces
|
74
|
+
|
75
|
+
Le module nsarchive est divisé en **4 interfaces**:
|
76
|
+
- [Entités](/docs/interfaces/entities.md) (membres, groupes, positions)
|
77
|
+
- [Économie](/docs/interfaces/economy.md) (comptes en banque, dettes)
|
78
|
+
- [Justice](/docs/interfaces/justice.md) (signalements, procès, sanctions)
|
79
|
+
- [État](/docs/interfaces/state.md) (votes, élections)
|
80
|
+
|
81
|
+
> Les interfaces État et Justice peuvent être confondues et désignées comme République, comme c'était le cas dans les versions précédentes.
|
82
|
+
|
83
|
+
|
84
|
+
Les interfaces ont toutes quatre rôles en commun:
|
85
|
+
- Vous authentifier
|
86
|
+
- Récupérer des objets
|
87
|
+
- Créer des objets
|
88
|
+
- Supprimer des objets (Entités uniquement)
|
89
|
+
|
90
|
+
Une documentation plus détaillée est disponible [ici](/docs/interfaces/README.md).
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nsarchive/__init__.py,sha256=8Cssxv2lkW3eJStVoTg0y84_E7mPm0y4-oLe_nA42A0,877
|
2
|
+
nsarchive/assets/default_avatar.png,sha256=n-4vG_WPke8LvbY3ZU6oA-H-OtRoIu7woKnRq9DCIlI,51764
|
3
|
+
nsarchive/errors/__init__.py,sha256=rjyE5B4WmJI-_ILUtCP6wk4HhpmvLahkFTFyWwTlulw,33
|
4
|
+
nsarchive/errors/_globals.py,sha256=e3EvZ2HoCwfKbRkn7uYmqFkyE3013b4jkaZCvoAErkU,749
|
5
|
+
nsarchive/interfaces/_economy.py,sha256=wkmPvj3GVy7Et2Z-cJMQ9BBem1tKcIfeJmNaB03xspc,3072
|
6
|
+
nsarchive/interfaces/_entities.py,sha256=oPGkcnpXLOQfQpoqrvhjXhQq6nDCQ-nKwYSwnb1lze8,9384
|
7
|
+
nsarchive/interfaces/_justice.py,sha256=J8rLJ9STAax7uvnuMqwO0RdbzrsQcFzjUwkQaEEA1kU,8683
|
8
|
+
nsarchive/interfaces/_state.py,sha256=CYnwLO5Ihv27tc5-bn_w6y7SjMZG3kQsv3AfozP4nfw,10462
|
9
|
+
nsarchive/mandate.py,sha256=-CF6HMbDge2JYZIHT4WtAkUo6Cvc5WrsYhbrdKrriyA,2117
|
10
|
+
nsarchive/models/base.py,sha256=Hl19C00pXD76KwcUsbfqZDxMfGghLxEAYTBSLUG_l34,10464
|
11
|
+
nsarchive/models/economy.py,sha256=EkGfwWlvNlF8Ho9oOYS-eXybiHjsmqBoJxNObeOMRPE,6715
|
12
|
+
nsarchive/models/entities.py,sha256=OQPgaqybw7dr1lbNplV-EsWqZH4MwBfYTWtI_Yt8ulo,27412
|
13
|
+
nsarchive/models/justice.py,sha256=aHlDQ04agLJDSr13NXq-0RUaICM3_ZUok3mtEGPXbPY,4301
|
14
|
+
nsarchive/models/republic.py,sha256=CRpZQEKM-nx_DFy1r0QPK3u9xTNQ7sdOsKw2zb75J4o,4997
|
15
|
+
nsarchive/models/scale.py,sha256=ukh6wiE4mBcqbqtAC9GvCyTVUnwYUp3jla03Nohnsck,751
|
16
|
+
nsarchive/models/state.py,sha256=KhEv1F9g6RBvdfuw-uO3ruyuTfn9PGdeA1nMMABN2qU,3652
|
17
|
+
nsarchive/utils.py,sha256=L37Dm8aO0Sm3FDLPf2tP6fo-1lodDq7JIz-WXttNuJg,684
|
18
|
+
nsarchive-3.0.0b2.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
19
|
+
nsarchive-3.0.0b2.dist-info/METADATA,sha256=f3WgdYrnXXYpuk7Df-8MaeM2UffweQgo0rIfQrmsMsg,3457
|
20
|
+
nsarchive-3.0.0b2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
21
|
+
nsarchive-3.0.0b2.dist-info/RECORD,,
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.3
|
2
|
-
Name: nsarchive
|
3
|
-
Version: 3.0.0b1
|
4
|
-
Summary: API-wrapper pour récupérer des données liées à Nation
|
5
|
-
License: GPL-3.0
|
6
|
-
Author: happex
|
7
|
-
Author-email: 110610727+okayhappex@users.noreply.github.com
|
8
|
-
Requires-Python: >=3.10,<4.0
|
9
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
13
|
-
Classifier: Programming Language :: Python :: 3.12
|
14
|
-
Classifier: Programming Language :: Python :: 3.13
|
15
|
-
Requires-Dist: pillow (>=10.4,<11.0)
|
16
|
-
Requires-Dist: requests (>=2.31,<3.0)
|
17
|
-
Description-Content-Type: text/markdown
|
18
|
-
|
19
|
-
# NSArchive
|
20
|
-
|
21
|
-
Documentation pas disponible pour l'instant
|
@@ -1,19 +0,0 @@
|
|
1
|
-
nsarchive/__init__.py,sha256=Sh9eQ1alsA-fnFr3AHeMEQ5PZ1r4h_XtCBii3FlkUDs,853
|
2
|
-
nsarchive/assets/default_avatar.png,sha256=n-4vG_WPke8LvbY3ZU6oA-H-OtRoIu7woKnRq9DCIlI,51764
|
3
|
-
nsarchive/interfaces/_economy.py,sha256=54TpYKRw07HIryd3EDifA9Hs3s6O7aHcrtV4P8qY0QY,9348
|
4
|
-
nsarchive/interfaces/_entities.py,sha256=9iSw_AAMmdh7VY8BgQkRoZ0RIMsi7ZYYLB3_PJXMbOU,6399
|
5
|
-
nsarchive/interfaces/_justice.py,sha256=AOuPLgja1D1_MU6oll5JOdb0yjLknd7QIdxyStDNhBM,3708
|
6
|
-
nsarchive/interfaces/_state.py,sha256=7cGYnkjUXLnkGnZiYNfhq4QraZ_lqMXdlBriV-SUQng,5515
|
7
|
-
nsarchive/mandate.py,sha256=U0RE9Gpr3XawSWyr99X__GUoiwJAwKbOP4v_I2Z97Oc,1609
|
8
|
-
nsarchive/models/base.py,sha256=UBpM4B1nOPJCPJmPAkbumGYxGxBtQUY7omh8uEczsCc,8763
|
9
|
-
nsarchive/models/economy.py,sha256=GD1G2fOyIZxquC7F6Rawy0V1gmXN0keTh-r4xvcGl6Y,7681
|
10
|
-
nsarchive/models/entities.py,sha256=UP3jFS-KDIER8-K1EVdjgCge7qeCtJ3106XBNrhDKLE,17429
|
11
|
-
nsarchive/models/justice.py,sha256=RuFmPi6mK-8APc-_WSPz4bYfnC46WYwdEnzGsZcdXDw,3420
|
12
|
-
nsarchive/models/republic.py,sha256=hZA9XB-jHQjscBzuk7vfB_CjtU2Yb8AFM3TxFM6RF5k,3260
|
13
|
-
nsarchive/models/scale.py,sha256=ukh6wiE4mBcqbqtAC9GvCyTVUnwYUp3jla03Nohnsck,751
|
14
|
-
nsarchive/models/state.py,sha256=gxxUu-E6t2tEx70vXT5XQ17JppP2JKpk4MWclWoqUSM,1963
|
15
|
-
nsarchive/utils.py,sha256=L37Dm8aO0Sm3FDLPf2tP6fo-1lodDq7JIz-WXttNuJg,684
|
16
|
-
nsarchive-3.0.0b1.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
17
|
-
nsarchive-3.0.0b1.dist-info/METADATA,sha256=gQ9hFbAZ6cf_xXRJnx1h36io5qfafhGJ1s6lH4zng6c,746
|
18
|
-
nsarchive-3.0.0b1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
19
|
-
nsarchive-3.0.0b1.dist-info/RECORD,,
|
File without changes
|
File without changes
|