allocine 0.1.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.
- allocine/__init__.py +56 -0
- allocine/api.py +132 -0
- allocine/cache.py +134 -0
- allocine/cli.py +153 -0
- allocine/client.py +241 -0
- allocine/models.py +233 -0
- allocine/nationalities.py +448 -0
- allocine/schedules.py +162 -0
- allocine-0.1.0.dist-info/METADATA +214 -0
- allocine-0.1.0.dist-info/RECORD +14 -0
- allocine-0.1.0.dist-info/WHEEL +5 -0
- allocine-0.1.0.dist-info/entry_points.txt +2 -0
- allocine-0.1.0.dist-info/licenses/LICENSE +22 -0
- allocine-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: allocine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Non official Python wrapper for allocine.fr
|
|
5
|
+
Author-email: Thibault Ducret <hello@tducret.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tducret/allocine-python
|
|
8
|
+
Keywords: allocine,api,parser,parsing,python-wrapper,scraper,scraping
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: backoff>=2.2.1
|
|
15
|
+
Requires-Dist: click>=8.5.0
|
|
16
|
+
Requires-Dist: diskcache<6,>=5.6
|
|
17
|
+
Requires-Dist: httpx2>=2.13.1
|
|
18
|
+
Requires-Dist: jmespath>=1.1.0
|
|
19
|
+
Requires-Dist: parsel>=1.10.0
|
|
20
|
+
Requires-Dist: platformdirs>=4.3
|
|
21
|
+
Requires-Dist: rich>=14.2.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: freezegun>=1.5.5; extra == "dev"
|
|
24
|
+
Requires-Dist: pre-commit>=4.6.2; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest>=9.1.1; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff>=0.16.9; extra == "dev"
|
|
28
|
+
Requires-Dist: syrupy>=6.1.1; extra == "dev"
|
|
29
|
+
Requires-Dist: ty>=0.0.84; extra == "dev"
|
|
30
|
+
Requires-Dist: vcrpy>=8.3.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# Allociné
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/allocine/)
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## Description
|
|
41
|
+
|
|
42
|
+
**Avec cet outil, vous récupérez les horaires des séances ciné directement dans le terminal**.
|
|
43
|
+
|
|
44
|
+
## Prérequis
|
|
45
|
+
|
|
46
|
+
- Python 3.10 ou une version ultérieure
|
|
47
|
+
- [uv](https://docs.astral.sh/uv/)
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
uv tool install --upgrade allocine
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Utilisation en ligne de commande
|
|
56
|
+
|
|
57
|
+
Commencez par rechercher l’identifiant de votre cinéma sur [allocine.fr](https://www.allocine.fr/).
|
|
58
|
+
|
|
59
|
+
Recherchez votre cinéma et relevez son identifiant dans l’URL. Dans cet exemple, il s’agit de `P0645`.
|
|
60
|
+
|
|
61
|
+

|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
#### Aide
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
seances --help
|
|
69
|
+
Usage: seances [OPTIONS] ID_CINEMA
|
|
70
|
+
|
|
71
|
+
Les séances de votre cinéma dans le terminal, avec ID_CINEMA : identifiant
|
|
72
|
+
du cinéma sur Allociné, ex: C0159 pour l’UGC Ciné Cité Les Halles. Se
|
|
73
|
+
trouve dans l’url :
|
|
74
|
+
http://allocine.fr/seance/salle_gen_csalle=<ID_CINEMA>.html
|
|
75
|
+
|
|
76
|
+
Options:
|
|
77
|
+
-j, --jour TEXT jour des séances souhaitées (au format DD/MM/YYYY ou +1
|
|
78
|
+
pour demain), par défaut : aujourd’hui
|
|
79
|
+
-s, --semaine affiche les séance pour les 7 prochains jours
|
|
80
|
+
-e, --entrelignes ajoute une ligne entre chaque film pour améliorer la
|
|
81
|
+
lisibilité
|
|
82
|
+
--help Show this message and exit.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### Utilisation simple
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
seances P2235
|
|
89
|
+
|
|
90
|
+
27/12/2018
|
|
91
|
+
┌──────────────────────────────────────────────────────────┬──────┬───────┬───────┬───────┬───────┐
|
|
92
|
+
│ Astérix - Le Secret de la Potion Magique... (VF) - 01h25 │ 4.1* │ 10:15 │ │ │ │
|
|
93
|
+
│ L’Empereur de Paris (VF) - 01h50 │ 3.4* │ │ │ 17:15 │ │
|
|
94
|
+
│ Ma mère est folle (VF) - 01h35 │ 3.0* │ │ 14:15 │ │ │
|
|
95
|
+
│ Marche ou crève (VF) - 01h25 │ 3.6* │ │ │ │ 20:15 │
|
|
96
|
+
└──────────────────────────────────────────────────────────┴──────┴───────┴───────┴───────┴───────┘
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Pour demain, avec des interlignes
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
seances P2235 -j+1 --entrelignes
|
|
103
|
+
|
|
104
|
+
28/12/2018
|
|
105
|
+
┌────────────────────────────────────────────────────┬──────┬───────┬───────┬───────┐
|
|
106
|
+
│ Casse-noisette et les quatre royaumes (VF) - 01h39 │ 3.1* │ │ │ 20:15 │
|
|
107
|
+
├────────────────────────────────────────────────────┼──────┼───────┼───────┼───────┤
|
|
108
|
+
│ Ma mère est folle (VF) - 01h35 │ 3.0* │ │ 17:15 │ │
|
|
109
|
+
├────────────────────────────────────────────────────┼──────┼───────┼───────┼───────┤
|
|
110
|
+
│ Marche ou crève (VF) - 01h25 │ 3.6* │ 14:15 │ │ │
|
|
111
|
+
└────────────────────────────────────────────────────┴──────┴───────┴───────┴───────┘
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Pour une date précise
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
seances P2235 --jour 29/12/2018
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Pour toute la semaine
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
seances P2235 --semaine
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Utilisation de la bibliothèque
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from allocine import Allocine
|
|
130
|
+
|
|
131
|
+
with Allocine() as allocine:
|
|
132
|
+
showtimes = allocine.get_showtimes("P2235")
|
|
133
|
+
|
|
134
|
+
for showtime in showtimes:
|
|
135
|
+
print(showtime)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Exemple de sortie :
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
27/12/2018 10:15 : Astérix - Le Secret de la Potion Magique [244560] (VF) (01h25)
|
|
142
|
+
27/12/2018 14:15 : Ma mère est folle [260370] (VF) (01h35)
|
|
143
|
+
27/12/2018 17:15 : L’Empereur de Paris [258914] (VF) (01h50)
|
|
144
|
+
27/12/2018 20:15 : Marche ou crève [258052] (VF) (01h25)
|
|
145
|
+
28/12/2018 14:15 : Marche ou crève [258052] (VF) (01h25)
|
|
146
|
+
28/12/2018 17:15 : Ma mère est folle [260370] (VF) (01h35)
|
|
147
|
+
28/12/2018 20:15 : Casse-noisette et les quatre royaumes [245656] (VF) (01h39)
|
|
148
|
+
29/12/2018 14:15 : Astérix - Le Secret de la Potion Magique [244560] (VF) (01h25)
|
|
149
|
+
[...]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Le cache est activé par défaut. Les réponses sont enregistrées dans le répertoire de cache utilisateur du système :
|
|
153
|
+
|
|
154
|
+
- macOS: `~/Library/Caches/allocine`
|
|
155
|
+
- Linux: `${XDG_CACHE_HOME:-~/.cache}/allocine`
|
|
156
|
+
- Windows: `%LOCALAPPDATA%\\allocine\\Cache`
|
|
157
|
+
|
|
158
|
+
Videz le cache en ligne de commande (aucun identifiant de cinéma n’est nécessaire) :
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
seances --clear-cache
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Développement
|
|
165
|
+
|
|
166
|
+
Créez l’environnement virtuel et installez le paquet avec ses dépendances de développement :
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
uv sync --extra dev
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Installez les hooks pre-commit une première fois, puis utilisez `make check` pour analyser, formater et vérifier les types
|
|
173
|
+
de l’ensemble du code :
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
uv run pre-commit install
|
|
177
|
+
make check
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Exécutez chaque vérification sans modifier les fichiers :
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
uv run ruff check .
|
|
184
|
+
uv run ruff format --check .
|
|
185
|
+
uv run ty check
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Exécutez manuellement tous les hooks pre-commit avec :
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
uv run pre-commit run --all-files
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Les utilisateurs de VS Code doivent accepter les recommandations d’extensions de l’espace de travail afin d’activer les
|
|
195
|
+
diagnostics Ruff et ty en temps réel, ainsi que le formatage Ruff à l’enregistrement.
|
|
196
|
+
|
|
197
|
+
## Publication
|
|
198
|
+
|
|
199
|
+
Le workflow de publication publie sur PyPI les tags de version tels que `0.0.13` grâce à Trusted Publishing, sans
|
|
200
|
+
stocker de jeton d’API. Avant la première publication :
|
|
201
|
+
|
|
202
|
+
1. Créez un environnement GitHub nommé `pypi`. Il est recommandé d’exiger une approbation avant tout déploiement.
|
|
203
|
+
2. Dans les paramètres de publication PyPI du projet `allocine`, ajoutez un Trusted Publisher GitHub avec le
|
|
204
|
+
propriétaire `tducret`, le dépôt `allocine-python`, le workflow `release.yml` et l’environnement `pypi`.
|
|
205
|
+
|
|
206
|
+
Le tag Git définit la version du paquet ; aucun fichier de version ne doit être mis à jour. Ajoutez le tag au commit à
|
|
207
|
+
publier. Le workflow rejette les distributions dont la version ne correspond pas au tag et effectue un test rapide du
|
|
208
|
+
wheel et de la distribution source avant leur publication :
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
VERSION=0.0.13
|
|
212
|
+
git tag -a ${VERSION} -m ${VERSION}
|
|
213
|
+
git push origin ${VERSION}
|
|
214
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
allocine/__init__.py,sha256=WsOc4DWBQGjjoOFWbXnIGi4kDOvV8GBhOawjhfWAf5s,1290
|
|
2
|
+
allocine/api.py,sha256=MZ9w1BvpbbEkK3Vp6GtIcx9aItOADCoCyvxk6XPBZZ8,4525
|
|
3
|
+
allocine/cache.py,sha256=hd7CYf6e7WxSBDaucZLVe6ZtBz_fhdiZBOb6pd2X2L8,4686
|
|
4
|
+
allocine/cli.py,sha256=VwCetHf_SH_dJe1Sn3eR3Ya1oGFTlb99RyhJvDKtnto,4792
|
|
5
|
+
allocine/client.py,sha256=Rg3TqTdhpw_ZIrrjn3nyTpl0aPoMI7OgWMV08QiPyrA,9884
|
|
6
|
+
allocine/models.py,sha256=yXAXm1ku1q-8jv2JM98mizVbu9EA_6ow3G1tMC5LYsk,6073
|
|
7
|
+
allocine/nationalities.py,sha256=gfU69Hft-ZggQZf2JIvMYryNvDu1cc6M0s8OSiYqlZM,14326
|
|
8
|
+
allocine/schedules.py,sha256=FPo-pkGT3UW5g5KGZdnShUtvnjLMbmpk9g9PcqGQxiM,6455
|
|
9
|
+
allocine-0.1.0.dist-info/licenses/LICENSE,sha256=Aykk6ZMnaLof0ZIHRluKuojQaDaiD_PVNjaKxptcD2Q,1074
|
|
10
|
+
allocine-0.1.0.dist-info/METADATA,sha256=2ufrjBtGdzqzczfxNgi8MtqQZVAcIon4WEqXn2A2VGY,8237
|
|
11
|
+
allocine-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
12
|
+
allocine-0.1.0.dist-info/entry_points.txt,sha256=uiNMPpR-BFKUkk2MVR_EMf86DRVyLTGvctzYoOnPCB0,46
|
|
13
|
+
allocine-0.1.0.dist-info/top_level.txt,sha256=q6b2qxRU5tp6X1LZ6cX9_v-b9JUV1Mqx1pak_wMVy8c,9
|
|
14
|
+
allocine-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018, Thibault Ducret
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
allocine
|