MouseTools 2.1.3__tar.gz → 3.0.0.dev2__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.
Files changed (56) hide show
  1. {mousetools-2.1.3 → mousetools-3.0.0.dev2}/LICENSE +1 -1
  2. mousetools-3.0.0.dev2/MouseTools.egg-info/PKG-INFO +77 -0
  3. mousetools-3.0.0.dev2/MouseTools.egg-info/SOURCES.txt +38 -0
  4. mousetools-3.0.0.dev2/MouseTools.egg-info/requires.txt +2 -0
  5. mousetools-3.0.0.dev2/PKG-INFO +77 -0
  6. mousetools-3.0.0.dev2/README.md +62 -0
  7. mousetools-3.0.0.dev2/mousetools/__init__.py +7 -0
  8. mousetools-3.0.0.dev2/mousetools/auth.py +70 -0
  9. mousetools-3.0.0.dev2/mousetools/entities/__init__.py +41 -0
  10. mousetools-3.0.0.dev2/mousetools/entities/attraction.py +12 -0
  11. mousetools-3.0.0.dev2/mousetools/entities/base.py +487 -0
  12. mousetools-3.0.0.dev2/mousetools/entities/character.py +12 -0
  13. mousetools-3.0.0.dev2/mousetools/entities/destination.py +16 -0
  14. mousetools-3.0.0.dev2/mousetools/entities/dining_event.py +12 -0
  15. mousetools-3.0.0.dev2/mousetools/entities/dinner_show.py +12 -0
  16. mousetools-3.0.0.dev2/mousetools/entities/entertainment.py +12 -0
  17. mousetools-3.0.0.dev2/mousetools/entities/entertainment_venue.py +12 -0
  18. mousetools-3.0.0.dev2/mousetools/entities/event.py +12 -0
  19. mousetools-3.0.0.dev2/mousetools/entities/guest_services.py +12 -0
  20. mousetools-3.0.0.dev2/mousetools/entities/land.py +12 -0
  21. mousetools-3.0.0.dev2/mousetools/entities/menu.py +12 -0
  22. mousetools-3.0.0.dev2/mousetools/entities/merchandise_facility.py +12 -0
  23. mousetools-3.0.0.dev2/mousetools/entities/park.py +42 -0
  24. mousetools-3.0.0.dev2/mousetools/entities/point_of_interest.py +12 -0
  25. mousetools-3.0.0.dev2/mousetools/entities/resort.py +12 -0
  26. mousetools-3.0.0.dev2/mousetools/entities/resort_area.py +12 -0
  27. mousetools-3.0.0.dev2/mousetools/entities/restaurant.py +12 -0
  28. mousetools-3.0.0.dev2/mousetools/exceptions.py +17 -0
  29. mousetools-3.0.0.dev2/mousetools/ids.py +96 -0
  30. mousetools-3.0.0.dev2/mousetools/mixins/__init__.py +0 -0
  31. mousetools-3.0.0.dev2/mousetools/mixins/disney.py +55 -0
  32. mousetools-3.0.0.dev2/mousetools/mixins/themeparksapi.py +128 -0
  33. mousetools-3.0.0.dev2/mousetools/urls.py +4 -0
  34. {mousetools-2.1.3 → mousetools-3.0.0.dev2}/pyproject.toml +47 -7
  35. mousetools-3.0.0.dev2/tests/test_auth.py +8 -0
  36. mousetools-3.0.0.dev2/tests/test_entities.py +236 -0
  37. mousetools-3.0.0.dev2/tests/test_ids.py +103 -0
  38. mousetools-2.1.3/PKG-INFO +0 -101
  39. mousetools-2.1.3/README.md +0 -87
  40. mousetools-2.1.3/src/MouseTools.egg-info/PKG-INFO +0 -101
  41. mousetools-2.1.3/src/MouseTools.egg-info/SOURCES.txt +0 -19
  42. mousetools-2.1.3/src/MouseTools.egg-info/requires.txt +0 -2
  43. mousetools-2.1.3/src/mousetools/__init__.py +0 -27
  44. mousetools-2.1.3/src/mousetools/attractions.py +0 -370
  45. mousetools-2.1.3/src/mousetools/auth.py +0 -42
  46. mousetools-2.1.3/src/mousetools/characters.py +0 -241
  47. mousetools-2.1.3/src/mousetools/destinations.py +0 -400
  48. mousetools-2.1.3/src/mousetools/entertainments.py +0 -470
  49. mousetools-2.1.3/src/mousetools/entertainmentvenues.py +0 -264
  50. mousetools-2.1.3/src/mousetools/facilities.py +0 -248
  51. mousetools-2.1.3/src/mousetools/ids.py +0 -44
  52. mousetools-2.1.3/src/mousetools/parks.py +0 -446
  53. mousetools-2.1.3/src/mousetools/pointsofinterest.py +0 -186
  54. {mousetools-2.1.3/src → mousetools-3.0.0.dev2}/MouseTools.egg-info/dependency_links.txt +0 -0
  55. {mousetools-2.1.3/src → mousetools-3.0.0.dev2}/MouseTools.egg-info/top_level.txt +0 -0
  56. {mousetools-2.1.3 → mousetools-3.0.0.dev2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Scott Caratozzolo
3
+ Copyright (c) 2024 Scott Caratozzolo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.1
2
+ Name: MouseTools
3
+ Version: 3.0.0.dev2
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
+ [![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)
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,38 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ MouseTools.egg-info/PKG-INFO
5
+ MouseTools.egg-info/SOURCES.txt
6
+ MouseTools.egg-info/dependency_links.txt
7
+ MouseTools.egg-info/requires.txt
8
+ MouseTools.egg-info/top_level.txt
9
+ mousetools/__init__.py
10
+ mousetools/auth.py
11
+ mousetools/exceptions.py
12
+ mousetools/ids.py
13
+ mousetools/urls.py
14
+ mousetools/entities/__init__.py
15
+ mousetools/entities/attraction.py
16
+ mousetools/entities/base.py
17
+ mousetools/entities/character.py
18
+ mousetools/entities/destination.py
19
+ mousetools/entities/dining_event.py
20
+ mousetools/entities/dinner_show.py
21
+ mousetools/entities/entertainment.py
22
+ mousetools/entities/entertainment_venue.py
23
+ mousetools/entities/event.py
24
+ mousetools/entities/guest_services.py
25
+ mousetools/entities/land.py
26
+ mousetools/entities/menu.py
27
+ mousetools/entities/merchandise_facility.py
28
+ mousetools/entities/park.py
29
+ mousetools/entities/point_of_interest.py
30
+ mousetools/entities/resort.py
31
+ mousetools/entities/resort_area.py
32
+ mousetools/entities/restaurant.py
33
+ mousetools/mixins/__init__.py
34
+ mousetools/mixins/disney.py
35
+ mousetools/mixins/themeparksapi.py
36
+ tests/test_auth.py
37
+ tests/test_entities.py
38
+ tests/test_ids.py
@@ -0,0 +1,2 @@
1
+ httpx>=0.27.2
2
+ tzdata>=2024.1
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.1
2
+ Name: MouseTools
3
+ Version: 3.0.0.dev2
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
+ [![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)
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,62 @@
1
+ # MouseTools
2
+ [![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)
3
+
4
+
5
+ An unofficial Python wrapper for the Disney API. Data is pulled directly from Disney. This package supports Walt Disney World and Disneyland.
6
+
7
+ Read the [documentation](https://caratozzoloxyz.gitlab.io/public/MouseTools/).
8
+
9
+
10
+ ### Installation
11
+ You can install using pip:
12
+ ```bash
13
+ pip install MouseTools
14
+ ```
15
+ You can also install directly from this repo in case of any changes not uploaded to Pypi.
16
+ ```bash
17
+ pip install git+https://gitlab.com/caratozzoloxyz/public/MouseTools
18
+ ```
19
+
20
+ ### Quick Start
21
+
22
+ Define an entity object directly.
23
+
24
+ ```python
25
+ from mousetools.entities import Attraction
26
+
27
+ big_thunder = Attraction("80010110")
28
+
29
+ print(big_thunder.name)
30
+ #> 'Big Thunder Mountain Railroad'
31
+
32
+ print(big_thunder.ancestor_theme_park_id)
33
+ #> '80007944'
34
+
35
+ print(big_thunder.get_status())
36
+ #> 'OPERATING'
37
+
38
+ print(big_thunder.get_wait_time())
39
+ #> 45
40
+
41
+ ```
42
+
43
+ Use the already created destination objects to get children entities.
44
+
45
+ ```python
46
+ from mousetools.entities import WALT_DISNEY_WORLD_DESTINATION, DISNEYLAND_RESORT_DESTINATION
47
+ from mousetools.ids import FacilityServiceEntityTypes
48
+
49
+ print(WALT_DISNEY_WORLD_DESTINATION.get_children_entity_ids(FacilityServiceEntityTypes.ENTERTAINMENT_VENUES))
50
+ #> ['10460', '80008033', '80008259']
51
+
52
+ print(DISNEYLAND_RESORT_DESTINATION.get_children_entity_ids(FacilityServiceEntityTypes.RESORT_AREAS))
53
+ #> ['330338', '15597760']
54
+ ```
55
+
56
+ ### License
57
+ 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)
58
+
59
+ ### Disclaimer
60
+ 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/).
61
+
62
+ This package uses the [ThemeParks.wiki API](https://themeparks.wiki/).
@@ -0,0 +1,7 @@
1
+ import logging
2
+
3
+ logger = logging.getLogger(__name__)
4
+ logger.addHandler(logging.NullHandler())
5
+
6
+ __version__ = "3.0.0-dev.2" # will be set at runtime
7
+ logger.info(f"MouseTools version: {__version__}")
@@ -0,0 +1,70 @@
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
+ )