MouseTools 2.1.2.dev2__py3-none-any.whl → 3.0.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.
- {MouseTools-2.1.2.dev2.dist-info → MouseTools-3.0.0.dist-info}/LICENSE +1 -1
- MouseTools-3.0.0.dist-info/METADATA +77 -0
- MouseTools-3.0.0.dist-info/RECORD +32 -0
- {MouseTools-2.1.2.dev2.dist-info → MouseTools-3.0.0.dist-info}/WHEEL +1 -1
- mousetools/__init__.py +5 -25
- mousetools/auth.py +70 -42
- mousetools/entities/__init__.py +41 -0
- mousetools/entities/attraction.py +12 -0
- mousetools/entities/base.py +487 -0
- mousetools/entities/character.py +12 -0
- mousetools/entities/destination.py +16 -0
- mousetools/entities/dining_event.py +12 -0
- mousetools/entities/dinner_show.py +12 -0
- mousetools/entities/entertainment.py +12 -0
- mousetools/entities/entertainment_venue.py +12 -0
- mousetools/entities/event.py +12 -0
- mousetools/entities/guest_services.py +12 -0
- mousetools/entities/land.py +12 -0
- mousetools/entities/menu.py +12 -0
- mousetools/entities/merchandise_facility.py +12 -0
- mousetools/entities/park.py +42 -0
- mousetools/entities/point_of_interest.py +12 -0
- mousetools/entities/resort.py +12 -0
- mousetools/entities/resort_area.py +12 -0
- mousetools/entities/restaurant.py +12 -0
- mousetools/exceptions.py +17 -0
- mousetools/ids.py +96 -44
- mousetools/mixins/__init__.py +0 -0
- mousetools/mixins/disney.py +55 -0
- mousetools/mixins/themeparksapi.py +128 -0
- mousetools/urls.py +4 -0
- MouseTools-2.1.2.dev2.dist-info/METADATA +0 -101
- MouseTools-2.1.2.dev2.dist-info/RECORD +0 -16
- mousetools/attractions.py +0 -370
- mousetools/characters.py +0 -241
- mousetools/destinations.py +0 -400
- mousetools/entertainments.py +0 -470
- mousetools/entertainmentvenues.py +0 -264
- mousetools/facilities.py +0 -248
- mousetools/parks.py +0 -446
- mousetools/pointsofinterest.py +0 -186
- {MouseTools-2.1.2.dev2.dist-info → MouseTools-3.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: MouseTools
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: An unofficial Python wrapper for Disney's API
|
|
5
|
+
Author: Scott Caratozzolo
|
|
6
|
+
Project-URL: repository, https://gitlab.com/caratozzoloxyz/public/MouseTools
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: httpx >=0.27.2
|
|
14
|
+
Requires-Dist: tzdata >=2024.1
|
|
15
|
+
|
|
16
|
+
# MouseTools
|
|
17
|
+
[](https://badge.fury.io/py/MouseTools) [](https://pepy.tech/project/mousetools)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
An unofficial Python wrapper for the Disney API. Data is pulled directly from Disney. This package supports Walt Disney World and Disneyland.
|
|
21
|
+
|
|
22
|
+
Read the [documentation](https://caratozzoloxyz.gitlab.io/public/MouseTools/).
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Installation
|
|
26
|
+
You can install using pip:
|
|
27
|
+
```bash
|
|
28
|
+
pip install MouseTools
|
|
29
|
+
```
|
|
30
|
+
You can also install directly from this repo in case of any changes not uploaded to Pypi.
|
|
31
|
+
```bash
|
|
32
|
+
pip install git+https://gitlab.com/caratozzoloxyz/public/MouseTools
|
|
33
|
+
```
|
|
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
|
+
|
|
71
|
+
### License
|
|
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)
|
|
73
|
+
|
|
74
|
+
### Disclaimer
|
|
75
|
+
This project is in no way affiliated with The Walt Disney Company and all use of Disney Services is subject to the [Disney Terms of Use](https://disneytermsofuse.com/).
|
|
76
|
+
|
|
77
|
+
This package uses the [ThemeParks.wiki API](https://themeparks.wiki/).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
mousetools/__init__.py,sha256=S--2ZSxhyURuaycgXIvm3J4PvkdonoBAzZaDBs_oNmM,193
|
|
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=6UCrjuEJ_DboUhQHYrn16GL2VdCPw13or4fuU85Q4hM,1437
|
|
7
|
+
mousetools/entities/attraction.py,sha256=ACKNG_5xMM2kXws_76SmcfqaqErxRRzEER2XGsMtUpA,366
|
|
8
|
+
mousetools/entities/base.py,sha256=G7i8WQhRoWAp7eDx3_c9I_A9rejnC9TwKchRAtL00_c,16570
|
|
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=sZPanyB7zuznRC-B4wIJbKWRyM_gwVAAVnLKsBjG5-A,353
|
|
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=QTWPhmQb0kqRUNdLwqCpc3LGpQ35DvXdWFXQXgtgCBo,366
|
|
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.0.0.dist-info/LICENSE,sha256=xX4HoDU-zdafl3yEfIaspkvqHPaaXhuDwkJ6qhDMUIo,1074
|
|
29
|
+
MouseTools-3.0.0.dist-info/METADATA,sha256=_JnEyRTQkzO-Y7Fz0ms5_nxc0nT8Fy6hNbY2o_bfAYo,2491
|
|
30
|
+
MouseTools-3.0.0.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
31
|
+
MouseTools-3.0.0.dist-info/top_level.txt,sha256=7nanLN103J_xJn6HK6yuyqqlDgltCsQY2-ArRXx1Ukk,11
|
|
32
|
+
MouseTools-3.0.0.dist-info/RECORD,,
|
mousetools/__init__.py
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
init
|
|
3
|
-
expose classes and modules
|
|
4
|
-
"""
|
|
5
|
-
from mousetools.parks import Park
|
|
6
|
-
from mousetools.entertainmentvenues import EntertainmentVenue
|
|
7
|
-
from mousetools.attractions import Attraction
|
|
8
|
-
from mousetools.entertainments import Entertainment
|
|
9
|
-
from mousetools.characters import Character
|
|
10
|
-
from mousetools.facilities import Facility
|
|
11
|
-
from mousetools.pointsofinterest import PointOfInterest
|
|
12
|
-
from mousetools.destinations import Destination
|
|
13
|
-
import mousetools.ids as ids
|
|
1
|
+
import logging
|
|
14
2
|
|
|
15
|
-
|
|
3
|
+
logger = logging.getLogger(__name__)
|
|
4
|
+
logger.addHandler(logging.NullHandler())
|
|
16
5
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"Destination",
|
|
20
|
-
"Park",
|
|
21
|
-
"EntertainmentVenue",
|
|
22
|
-
"Attraction",
|
|
23
|
-
"Entertainment",
|
|
24
|
-
"Facility",
|
|
25
|
-
"Character",
|
|
26
|
-
"PointOfInterest",
|
|
27
|
-
]
|
|
6
|
+
__version__ = "3.0.0" # will be set at runtime
|
|
7
|
+
logger.info(f"MouseTools version: {__version__}")
|
mousetools/auth.py
CHANGED
|
@@ -1,42 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
import typing
|
|
2
|
+
from datetime import datetime, timedelta
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Authentication:
|
|
8
|
+
def __init__(self):
|
|
9
|
+
self.time_of_expire: typing.Optional[datetime] = None
|
|
10
|
+
self.access_token: typing.Optional[str] = None
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def authenticate() -> typing.Tuple[str, int]:
|
|
14
|
+
"""Gets an access token from Disney and the token's expiration time
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
(typing.Tuple[str, int]): Access token to the api and how long until it expires
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
headers = {
|
|
21
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
|
|
22
|
+
"Accept-Language": "en-US,en;q=0.9",
|
|
23
|
+
"Cache-Control": "max-age=0",
|
|
24
|
+
"Accept": "application/json",
|
|
25
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
26
|
+
"Connection": "keep-alive",
|
|
27
|
+
"Proxy-Connection": "keep-alive",
|
|
28
|
+
"Accept-Encoding": "gzip, deflate",
|
|
29
|
+
}
|
|
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",
|
|
39
|
+
headers=headers,
|
|
40
|
+
params=body,
|
|
41
|
+
timeout=10,
|
|
42
|
+
)
|
|
43
|
+
response.raise_for_status()
|
|
44
|
+
auth = response.json()
|
|
45
|
+
|
|
46
|
+
return auth["access_token"], int(auth["expires_in"])
|
|
47
|
+
|
|
48
|
+
def get_headers(self) -> typing.Dict[str, str]:
|
|
49
|
+
"""Creates the headers to send during the request
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
(typing.Dict[str, str]): Headers for the request
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
if self.time_of_expire is None or (datetime.now() > self.time_of_expire):
|
|
56
|
+
access_token, expires_in = self.authenticate()
|
|
57
|
+
self.time_of_expire = datetime.now() + timedelta(seconds=(expires_in - 10))
|
|
58
|
+
self.access_token = access_token
|
|
59
|
+
|
|
60
|
+
headers = {
|
|
61
|
+
"Authorization": f"BEARER {self.access_token}",
|
|
62
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
"Accept": "*/*",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return headers
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
auth_obj = Authentication()
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from mousetools.entities.attraction import Attraction
|
|
2
|
+
from mousetools.entities.character import Character
|
|
3
|
+
from mousetools.entities.destination import Destination
|
|
4
|
+
from mousetools.entities.dining_event import DiningEvent
|
|
5
|
+
from mousetools.entities.dinner_show import DinnerShow
|
|
6
|
+
from mousetools.entities.entertainment import Entertainment
|
|
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
|
|
11
|
+
from mousetools.entities.merchandise_facility import MerchandiseFacility
|
|
12
|
+
from mousetools.entities.park import ThemePark, WaterPark
|
|
13
|
+
from mousetools.entities.point_of_interest import PointOfInterest
|
|
14
|
+
from mousetools.entities.resort import Resort
|
|
15
|
+
from mousetools.entities.resort_area import ResortArea
|
|
16
|
+
from mousetools.entities.restaurant import Restaurant
|
|
17
|
+
from mousetools.ids import DestinationIds
|
|
18
|
+
|
|
19
|
+
WALT_DISNEY_WORLD_DESTINATION = Destination(DestinationIds.WALT_DISNEY_WORLD)
|
|
20
|
+
DISNEYLAND_RESORT_DESTINATION = Destination(DestinationIds.DISNEYLAND_RESORT)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"Attraction",
|
|
25
|
+
"Character",
|
|
26
|
+
"GuestServices",
|
|
27
|
+
"Entertainment",
|
|
28
|
+
"Destination",
|
|
29
|
+
"ThemePark",
|
|
30
|
+
"WaterPark",
|
|
31
|
+
"EntertainmentVenue",
|
|
32
|
+
"MerchandiseFacility",
|
|
33
|
+
"Restaurant",
|
|
34
|
+
"Resort",
|
|
35
|
+
"ResortArea",
|
|
36
|
+
"DiningEvent",
|
|
37
|
+
"DinnerShow",
|
|
38
|
+
"Event",
|
|
39
|
+
"Land",
|
|
40
|
+
"PointOfInterest",
|
|
41
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from mousetools.entities.base import EntityBase
|
|
2
|
+
from mousetools.ids import FacilityServiceEntityTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Attraction(EntityBase):
|
|
6
|
+
"""Class for Attraction Entities."""
|
|
7
|
+
|
|
8
|
+
def __init__(self, entity_id: str):
|
|
9
|
+
super().__init__(
|
|
10
|
+
entity_id=entity_id,
|
|
11
|
+
facility_service_entity_type=FacilityServiceEntityTypes.ATTRACTIONS,
|
|
12
|
+
)
|