themeparks 2.0.1__tar.gz → 3.0.0__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.
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.0] - 2026-09-08
4
+
5
+ ### Fixed
6
+
7
+ - **Schedule entries now carry `purchases`.** The upstream spec described a
8
+ park's schedule two different ways: precisely when nested under a
9
+ destination, loosely when fetched directly. This client uses the direct
10
+ path, so `purchases` was absent from the model entirely. Magic Kingdom
11
+ serves 26 entries carrying purchases.
12
+
13
+ ```python
14
+ sched = client.entity(park_id).schedule()
15
+ for day in sched.schedule or []:
16
+ for p in day.purchases or []:
17
+ print(p.name, p.price.amount, p.price.currency)
18
+ ```
19
+
20
+ - **A null price on a schedule purchase no longer rejects the response.**
21
+ 2.0.1 made `PriceData.amount` nullable, but the schedule path used a
22
+ second, inline price model that kept `amount` non-nullable. Both now use
23
+ `PriceData`. Tokyo Disneyland serves six Premier Access rows with a null
24
+ amount, and this client raised `ValidationError` on every one of them.
25
+
26
+ - Schedule entries gained the `description` field the API has always sent.
27
+
28
+ ### Changed
29
+
30
+ - **BREAKING — `ScheduleEntry.type` is an enum, not a `str`.** It was
31
+ `type: str`; it is now a `Type` enum. This breaks *silently*: the comparison
32
+ does not raise, it just stops being true.
33
+
34
+ ```python
35
+ # before: True. now: False, with no error.
36
+ if day.type == "OPERATING":
37
+ ...
38
+
39
+ # use one of these instead
40
+ if day.type.value == "OPERATING":
41
+ ...
42
+ from themeparks._generated.models import Type
43
+ if day.type is Type.OPERATING:
44
+ ...
45
+ ```
46
+
47
+ Audit any comparison of `.type` against a string literal before upgrading.
48
+ This is the one change here that will not announce itself.
49
+
50
+ - **BREAKING — the `PricedScheduleEntry` and `Price` models are gone.**
51
+ `PricedScheduleEntry` is now `ScheduleEntry`, and the inline `Price` model
52
+ is replaced by `PriceData`. Neither was exported from the package root, so
53
+ this only affects code importing from `themeparks._generated.models`
54
+ directly — a private module.
55
+
56
+ - The duplicate `EntityType1` and `EntityType2` enums collapse into
57
+ `EntityType`. Same members, same values.
58
+
3
59
  ## [2.0.1] - 2026-09-01
4
60
  ### Fixed
5
61
  - `PriceData.amount` is now nullable. The API returns `null` when a paid queue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: themeparks
3
- Version: 2.0.1
3
+ Version: 3.0.0
4
4
  Summary: Official SDK for the ThemeParks.wiki API
5
5
  Project-URL: Homepage, https://api.themeparks.wiki
6
6
  Project-URL: Source, https://github.com/ThemeParks/ThemeParks_Python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "themeparks"
7
- version = "2.0.1"
7
+ version = "3.0.0"
8
8
  description = "Official SDK for the ThemeParks.wiki API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -6,7 +6,7 @@ from __future__ import annotations
6
6
  from enum import Enum
7
7
  from typing import Annotated, Any
8
8
 
9
- from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
9
+ from pydantic import AwareDatetime, BaseModel, Field
10
10
 
11
11
 
12
12
  class BoardingGroupState(Enum):
@@ -41,49 +41,6 @@ class EntityLocation(BaseModel):
41
41
  """
42
42
 
43
43
 
44
- class ScheduleEntry(BaseModel):
45
- """
46
- Represents a single schedule entry
47
- """
48
-
49
- model_config = ConfigDict(
50
- extra="allow",
51
- )
52
- date: str
53
- """
54
- The date of the schedule entry
55
- """
56
- type: str
57
- """
58
- Type of schedule entry e.g. OPERATING, EXTRA_HOURS, etc.
59
- """
60
- description: str | None = None
61
- """
62
- Optional description of the schedule entry
63
- """
64
- openingTime: str
65
- """
66
- Opening time for this schedule entry
67
- """
68
- closingTime: str
69
- """
70
- Closing time for this schedule entry
71
- """
72
-
73
-
74
- class EntityType1(Enum):
75
- """
76
- Type of entity
77
- """
78
-
79
- DESTINATION = "DESTINATION"
80
- PARK = "PARK"
81
- ATTRACTION = "ATTRACTION"
82
- RESTAURANT = "RESTAURANT"
83
- HOTEL = "HOTEL"
84
- SHOW = "SHOW"
85
-
86
-
87
44
  class EntityType(Enum):
88
45
  """
89
46
  Type of entity in the theme park system
@@ -175,19 +132,6 @@ class Park(BaseModel):
175
132
  """
176
133
 
177
134
 
178
- class EntityType2(Enum):
179
- """
180
- Type of entity
181
- """
182
-
183
- DESTINATION = "DESTINATION"
184
- PARK = "PARK"
185
- ATTRACTION = "ATTRACTION"
186
- RESTAURANT = "RESTAURANT"
187
- HOTEL = "HOTEL"
188
- SHOW = "SHOW"
189
-
190
-
191
135
  class PriceData(BaseModel):
192
136
  amount: float | None = None
193
137
  """
@@ -203,18 +147,6 @@ class PriceData(BaseModel):
203
147
  """
204
148
 
205
149
 
206
- class Type(Enum):
207
- """
208
- Type of schedule entry
209
- """
210
-
211
- OPERATING = "OPERATING"
212
- TICKETED_EVENT = "TICKETED_EVENT"
213
- PRIVATE_EVENT = "PRIVATE_EVENT"
214
- EXTRA_HOURS = "EXTRA_HOURS"
215
- INFO = "INFO"
216
-
217
-
218
150
  class ReturnTimeState(Enum):
219
151
  """
220
152
  State of return time availability
@@ -225,20 +157,17 @@ class ReturnTimeState(Enum):
225
157
  FINISHED = "FINISHED"
226
158
 
227
159
 
228
- class Price(BaseModel):
229
- amount: float
230
- """
231
- Price amount
232
- """
233
- currency: str
234
- """
235
- Currency code
236
- """
237
- formatted: str | None = None
160
+ class Type(Enum):
238
161
  """
239
- Formatted price string
162
+ Type of schedule entry
240
163
  """
241
164
 
165
+ OPERATING = "OPERATING"
166
+ TICKETED_EVENT = "TICKETED_EVENT"
167
+ PRIVATE_EVENT = "PRIVATE_EVENT"
168
+ EXTRA_HOURS = "EXTRA_HOURS"
169
+ INFO = "INFO"
170
+
242
171
 
243
172
  class SchedulePriceType(Enum):
244
173
  """
@@ -404,7 +333,10 @@ class SchedulePriceObject(BaseModel):
404
333
  """
405
334
  Name of the price object
406
335
  """
407
- price: Price | None = None
336
+ price: PriceData | None = None
337
+ """
338
+ Price of this purchase option
339
+ """
408
340
  available: bool | None = None
409
341
  """
410
342
  Whether this price option is available
@@ -449,7 +381,7 @@ class EntityLiveDataResponse(BaseModel):
449
381
  liveData: list[EntityLiveData] | None = None
450
382
 
451
383
 
452
- class PricedScheduleEntry(BaseModel):
384
+ class ScheduleEntry(BaseModel):
453
385
  date: str
454
386
  """
455
387
  Schedule date
@@ -466,6 +398,10 @@ class PricedScheduleEntry(BaseModel):
466
398
  """
467
399
  Type of schedule entry
468
400
  """
401
+ description: str | None = None
402
+ """
403
+ Optional description of the schedule entry
404
+ """
469
405
  purchases: list[SchedulePriceObject] | None = None
470
406
  """
471
407
  Available purchases for this schedule entry
@@ -481,7 +417,7 @@ class ParkSchedule(BaseModel):
481
417
  """
482
418
  Entity name
483
419
  """
484
- entityType: EntityType2 | None = None
420
+ entityType: EntityType | None = None
485
421
  """
486
422
  Type of entity
487
423
  """
@@ -489,7 +425,7 @@ class ParkSchedule(BaseModel):
489
425
  """
490
426
  Entity timezone
491
427
  """
492
- schedule: list[PricedScheduleEntry] | None = None
428
+ schedule: list[ScheduleEntry] | None = None
493
429
 
494
430
 
495
431
  class EntityScheduleResponse(BaseModel):
@@ -501,7 +437,7 @@ class EntityScheduleResponse(BaseModel):
501
437
  """
502
438
  Entity name
503
439
  """
504
- entityType: EntityType1 | None = None
440
+ entityType: EntityType | None = None
505
441
  """
506
442
  Type of entity
507
443
  """
File without changes
File without changes
File without changes
File without changes