MouseTools 3.0.0.dev1__py3-none-any.whl → 3.1.0.dev1__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.
@@ -1,15 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MouseTools
3
- Version: 3.0.0.dev1
3
+ Version: 3.1.0.dev1
4
4
  Summary: An unofficial Python wrapper for Disney's API
5
5
  Author: Scott Caratozzolo
6
6
  Project-URL: repository, https://gitlab.com/caratozzoloxyz/public/MouseTools
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
12
- Requires-Dist: requests
13
+ Requires-Dist: httpx >=0.27.2
14
+ Requires-Dist: tzdata >=2024.1
13
15
 
14
16
  # MouseTools
15
17
  [![PyPI version](https://badge.fury.io/py/MouseTools.svg)](https://badge.fury.io/py/MouseTools) [![Downloads](https://pepy.tech/badge/mousetools)](https://pepy.tech/project/mousetools)
@@ -17,7 +19,7 @@ Requires-Dist: requests
17
19
 
18
20
  An unofficial Python wrapper for the Disney API. Data is pulled directly from Disney. This package supports Walt Disney World and Disneyland.
19
21
 
20
- Read the [documentation](https://caratozzoloxyz.gitlab.io/public/MouseTools/)/
22
+ Read the [documentation](https://caratozzoloxyz.gitlab.io/public/MouseTools/).
21
23
 
22
24
 
23
25
  ### Installation
@@ -30,6 +32,42 @@ You can also install directly from this repo in case of any changes not uploaded
30
32
  pip install git+https://gitlab.com/caratozzoloxyz/public/MouseTools
31
33
  ```
32
34
 
35
+ ### Quick Start
36
+
37
+ Define an entity object directly.
38
+
39
+ ```python
40
+ from mousetools.entities import Attraction
41
+
42
+ big_thunder = Attraction("80010110")
43
+
44
+ print(big_thunder.name)
45
+ #> 'Big Thunder Mountain Railroad'
46
+
47
+ print(big_thunder.ancestor_theme_park_id)
48
+ #> '80007944'
49
+
50
+ print(big_thunder.get_status())
51
+ #> 'OPERATING'
52
+
53
+ print(big_thunder.get_wait_time())
54
+ #> 45
55
+
56
+ ```
57
+
58
+ Use the already created destination objects to get children entities.
59
+
60
+ ```python
61
+ from mousetools.entities import WALT_DISNEY_WORLD_DESTINATION, DISNEYLAND_RESORT_DESTINATION
62
+ from mousetools.ids import FacilityServiceEntityTypes
63
+
64
+ print(WALT_DISNEY_WORLD_DESTINATION.get_children_entity_ids(FacilityServiceEntityTypes.ENTERTAINMENT_VENUES))
65
+ #> ['10460', '80008033', '80008259']
66
+
67
+ print(DISNEYLAND_RESORT_DESTINATION.get_children_entity_ids(FacilityServiceEntityTypes.RESORT_AREAS))
68
+ #> ['330338', '15597760']
69
+ ```
70
+
33
71
  ### License
34
72
  This project is distributed under the MIT license. For more information see [LICENSE](https://gitlab.com/caratozzoloxyz/public/MouseTools/-/blob/master/LICENSE?ref_type=heads)
35
73
 
@@ -0,0 +1,32 @@
1
+ mousetools/__init__.py,sha256=_2d-7eIVKOj36JQQygsloKaR6h4TBn17Ujt1gMV0ivM,199
2
+ mousetools/auth.py,sha256=ogbssFgG4Fmjuce2ppH96nlh3BJNXjOTWuSVbVM4XGQ,2372
3
+ mousetools/exceptions.py,sha256=0omdWcFu99r1XgVWQpn2jemgR34-lkfOeXvWFyCFILM,536
4
+ mousetools/ids.py,sha256=Gsnb9tkQ7uyDacbGJHGdYVv-4-FyfEI3BplMrYW67PY,4248
5
+ mousetools/urls.py,sha256=2WQMnUo080QxwFXOs5t9X5893QofQ5z3by_vkQsCDpo,233
6
+ mousetools/entities/__init__.py,sha256=hn2vBG7h9sxvRVhEptgh6aZ-Pzg8O9gkt2vMRiwQ8N8,1493
7
+ mousetools/entities/attraction.py,sha256=ACKNG_5xMM2kXws_76SmcfqaqErxRRzEER2XGsMtUpA,366
8
+ mousetools/entities/base.py,sha256=aHR7aLO5nfjO4JlzoCWo7EinsARYhiDNTKjC6PjtRQg,16554
9
+ mousetools/entities/character.py,sha256=ifdzEZC9r3W_ZBoYzjgsKMWbT3TmmDo98wg7letqaoU,363
10
+ mousetools/entities/destination.py,sha256=MsQ713DRoWlBoEHSKqtt4qctArHXUqk1ukYU_tnNh5o,520
11
+ mousetools/entities/dining_event.py,sha256=9aa7MF5FPQdLcwHDgm77KT6kmba3IVBx_KyhEPXu9XU,370
12
+ mousetools/entities/dinner_show.py,sha256=Hbdg0rOmH9d5QOSxcArG594rfFnTLKLnw5uhtjnWO9w,368
13
+ mousetools/entities/entertainment.py,sha256=NYHcZlU1odPsobQJMdV3s82zREfqD8ZbNQXl0uRw21Q,375
14
+ mousetools/entities/entertainment_venue.py,sha256=53WzFLnjoKZYaz3GV-B9km2UNiMYKX7Ir07w1TwYSn8,391
15
+ mousetools/entities/event.py,sha256=_u_IYJM55FwPpf_RVlqYK2ryaWq-5gznhBqRlSwnepg,351
16
+ mousetools/entities/guest_services.py,sha256=p1NP1vnkEXOv1OMKRiWPhQ77Cikok3jXAOu3PJQXV_o,376
17
+ mousetools/entities/land.py,sha256=oT8wSBuLyBe34kRhl2O-DJyA1np1O-X-YsJoRnqVhFI,348
18
+ mousetools/entities/menu.py,sha256=FvNfuk4DDWZBlcY7xwXm03TlTsCaq3LHMZplUxCOQYw,6145
19
+ mousetools/entities/merchandise_facility.py,sha256=xtU_yuhGi4seS7e2ClMtsaqmw-SBIs5N_7gFz1FxgcA,395
20
+ mousetools/entities/park.py,sha256=ZtXo4hyyJFIRQ7l-GMmBj9rMH14KUQ84f5RVZ0VLBcI,1221
21
+ mousetools/entities/point_of_interest.py,sha256=h-CroI3QwuLGvGmGHRS3yQO8OQB-5lplLmQHlvLHDNo,385
22
+ mousetools/entities/resort.py,sha256=aKNrLVa_KRTHPLbY2IHMp7sgSesBT2gR0u6XJBaEt14,354
23
+ mousetools/entities/resort_area.py,sha256=COiwcB8aXOFWmjw_RYOYgJ35SHb8z_QaBKyTHA2OGZQ,368
24
+ mousetools/entities/restaurant.py,sha256=j0Lk_F01A4jOTkUSyHm98gccbn1d52VK70KctU0ErpU,1654
25
+ mousetools/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ mousetools/mixins/disney.py,sha256=9EW_TPl3LQy9EHyivxVSOKJ1TWjfPHHdwnDQJK4c-b0,1854
27
+ mousetools/mixins/themeparksapi.py,sha256=gxep2vBXMSSVh1c3Yjt7oaIyCjhQfGtbSHXysbhazbs,4321
28
+ MouseTools-3.1.0.dev1.dist-info/LICENSE,sha256=xX4HoDU-zdafl3yEfIaspkvqHPaaXhuDwkJ6qhDMUIo,1074
29
+ MouseTools-3.1.0.dev1.dist-info/METADATA,sha256=NKozUIYipaOkFtM9MT0sQF0b4yjUqWpQlwKi9QSeCac,2496
30
+ MouseTools-3.1.0.dev1.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
31
+ MouseTools-3.1.0.dev1.dist-info/top_level.txt,sha256=7nanLN103J_xJn6HK6yuyqqlDgltCsQY2-ArRXx1Ukk,11
32
+ MouseTools-3.1.0.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.1)
2
+ Generator: setuptools (74.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
mousetools/__init__.py CHANGED
@@ -1,13 +1,7 @@
1
1
  import logging
2
- from mousetools.ids import ancestor_entities, DestinationIds
3
2
 
4
3
  logger = logging.getLogger(__name__)
5
4
  logger.addHandler(logging.NullHandler())
6
5
 
7
- __version__ = "3.0.0-dev.1" # will be set at runtime
6
+ __version__ = "3.1.0-dev.1" # will be set at runtime
8
7
  logger.info(f"MouseTools version: {__version__}")
9
-
10
- WALT_DISNEY_WORLD_ENTITIES = ancestor_entities(DestinationIds.WALT_DISNEY_WORLD)
11
- logger.debug("%s Walt Disney World Entities", len(WALT_DISNEY_WORLD_ENTITIES))
12
- DISNEYLAND_RESORT_ENTITIES = ancestor_entities(DestinationIds.DISNEYLAND_RESORT)
13
- logger.debug("%s Disneyland Resort Entities", len(DISNEYLAND_RESORT_ENTITIES))
mousetools/auth.py CHANGED
@@ -1,7 +1,8 @@
1
1
  import typing
2
- import requests
3
2
  from datetime import datetime, timedelta
4
3
 
4
+ import httpx
5
+
5
6
 
6
7
  class Authentication:
7
8
  def __init__(self):
@@ -26,11 +27,20 @@ class Authentication:
26
27
  "Proxy-Connection": "keep-alive",
27
28
  "Accept-Encoding": "gzip, deflate",
28
29
  }
29
- response = requests.get(
30
- "https://disneyworld.disney.go.com/authentication/get-client-token",
30
+
31
+ body = {
32
+ "grant_type": "assertion",
33
+ "assertion_type": "public",
34
+ "client_id": "TPR-DLR-LBSDK.AND-PROD",
35
+ }
36
+
37
+ response = httpx.post(
38
+ "https://authorization.go.com/token",
31
39
  headers=headers,
40
+ params=body,
32
41
  timeout=10,
33
42
  )
43
+ response.raise_for_status()
34
44
  auth = response.json()
35
45
 
36
46
  return auth["access_token"], int(auth["expires_in"])
@@ -1,13 +1,43 @@
1
1
  from mousetools.entities.attraction import Attraction
2
- from mousetools.entities.entertainment import Entertainment
2
+ from mousetools.entities.character import Character
3
3
  from mousetools.entities.destination import Destination
4
- from mousetools.entities.park import Park
4
+ from mousetools.entities.dining_event import DiningEvent
5
+ from mousetools.entities.dinner_show import DinnerShow
6
+ from mousetools.entities.entertainment import Entertainment
5
7
  from mousetools.entities.entertainment_venue import EntertainmentVenue
8
+ from mousetools.entities.event import Event
9
+ from mousetools.entities.guest_services import GuestServices
10
+ from mousetools.entities.land import Land
6
11
  from mousetools.entities.merchandise_facility import MerchandiseFacility
7
- from mousetools.entities.restaurant import Restaurant
12
+ from mousetools.entities.park import ThemePark, WaterPark
13
+ from mousetools.entities.point_of_interest import PointOfInterest
8
14
  from mousetools.entities.resort import Resort
9
- from mousetools.entities.dining_event import DiningEvent, DinnerShow
10
- from mousetools.entities.event import Event
15
+ from mousetools.entities.resort_area import ResortArea
16
+ from mousetools.entities.restaurant import Restaurant
17
+ from mousetools.entities.menu import Menus
18
+ from mousetools.ids import DestinationIds
19
+
20
+ WALT_DISNEY_WORLD_DESTINATION = Destination(DestinationIds.WALT_DISNEY_WORLD)
21
+ DISNEYLAND_RESORT_DESTINATION = Destination(DestinationIds.DISNEYLAND_RESORT)
11
22
 
12
23
 
13
- __all__ = ["Attraction", "Entertainment", "Destination", "Park", "EntertainmentVenue" ,"MerchandiseFacility", "Restaurant", "Resort", "DiningEvent", "DinnerShow", "Event"]
24
+ __all__ = [
25
+ "Attraction",
26
+ "Character",
27
+ "GuestServices",
28
+ "Entertainment",
29
+ "Destination",
30
+ "ThemePark",
31
+ "WaterPark",
32
+ "EntertainmentVenue",
33
+ "MerchandiseFacility",
34
+ "Restaurant",
35
+ "Resort",
36
+ "ResortArea",
37
+ "DiningEvent",
38
+ "DinnerShow",
39
+ "Event",
40
+ "Land",
41
+ "PointOfInterest",
42
+ "Menus",
43
+ ]
@@ -1,8 +1,12 @@
1
- from mousetools.entities.base import Entity
1
+ from mousetools.entities.base import EntityBase
2
+ from mousetools.ids import FacilityServiceEntityTypes
2
3
 
3
4
 
4
- class Attraction(Entity):
5
+ class Attraction(EntityBase):
5
6
  """Class for Attraction Entities."""
6
7
 
7
- def __repr__(self) -> str:
8
- return f"Attraction(id='{self.id}')"
8
+ def __init__(self, entity_id: str):
9
+ super().__init__(
10
+ entity_id=entity_id,
11
+ facility_service_entity_type=FacilityServiceEntityTypes.ATTRACTIONS,
12
+ )