the-datagarden 1.2.3__tar.gz → 1.2.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/PKG-INFO +2 -2
  2. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/pyproject.toml +2 -2
  3. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/authentication/settings.py +2 -0
  4. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/base/__init__.py +11 -1
  5. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/PKG-INFO +2 -2
  6. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/README.rst +0 -0
  7. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/setup.cfg +0 -0
  8. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/__init__.py +0 -0
  9. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/abc/__init__.py +0 -0
  10. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/abc/api.py +0 -0
  11. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/abc/authentication.py +0 -0
  12. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/__init__.py +0 -0
  13. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/authentication/__init__.py +0 -0
  14. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/authentication/credentials/__init__.py +0 -0
  15. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/authentication/environment/__init__.py +0 -0
  16. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/regions/__init__.py +0 -0
  17. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/regions/base/__init__.py +0 -0
  18. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/regions/base/settings.py +0 -0
  19. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/regions/continent.py +0 -0
  20. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/api/regions/country.py +0 -0
  21. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/cli.py +0 -0
  22. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/models/__init__.py +0 -0
  23. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/models/geojson.py +0 -0
  24. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/models/regional_data.py +0 -0
  25. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden/version.py +0 -0
  26. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/SOURCES.txt +0 -0
  27. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/dependency_links.txt +0 -0
  28. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/entry_points.txt +0 -0
  29. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/requires.txt +0 -0
  30. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/src/the_datagarden.egg-info/top_level.txt +0 -0
  31. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/tests/test_cli.py +0 -0
  32. {the_datagarden-1.2.3 → the_datagarden-1.2.4}/tests/test_the_datagarden_imports.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: the-datagarden
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: Public data made easy.
5
5
  Author-email: Maarten de Ruyter <info@the-datagarden.io>
6
6
  License: MIT
7
7
  Project-URL: Read the Docs, https://dg-the-datagarden.readthedocs.io/en/stable/
8
8
  Project-URL: The-DataGarden, https://www.the-datagarden.io/
9
9
  Project-URL: API documentation, https://www.the-datagarden.io/api-docs
10
- Project-URL: Source, https://github.com/the-datagarden/the-datagarden
10
+ Project-URL: Source, https://github.com/OlivettaDataGarden/dg-the-datagarden
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "the-datagarden"
3
- version = "1.2.3"
3
+ version = "1.2.4"
4
4
  description = "Public data made easy."
5
5
  readme = "README.rst"
6
6
  requires-python = ">=3.10"
@@ -57,7 +57,7 @@ the-datagarden = "the_datagarden.cli:main"
57
57
  "Read the Docs" = "https://dg-the-datagarden.readthedocs.io/en/stable/"
58
58
  "The-DataGarden" = "https://www.the-datagarden.io/"
59
59
  "API documentation" = "https://www.the-datagarden.io/api-docs"
60
- "Source" = "https://github.com/the-datagarden/the-datagarden"
60
+ "Source" = "https://github.com/OlivettaDataGarden/dg-the-datagarden"
61
61
 
62
62
 
63
63
  [tool.ruff]
@@ -41,6 +41,8 @@ DEFAULT_HEADER: dict[str, str] = {
41
41
 
42
42
 
43
43
  class URLExtension:
44
+ ROOT = ""
45
+ PULSE = "pulse/"
44
46
  WORLD = "world/"
45
47
  WORLD_DATA = "world/regional_data/"
46
48
  CONTINENTS = "continent/"
@@ -26,6 +26,7 @@ from the_datagarden.abc.authentication import DatagardenEnvironment
26
26
  from the_datagarden.api.authentication import AccessToken
27
27
  from the_datagarden.api.authentication.environment import TheDatagardenProductionEnvironment
28
28
  from the_datagarden.api.authentication.settings import (
29
+ DEFAULT_HEADER,
29
30
  SHOW_REQ_DETAIL,
30
31
  DynamicEndpointCategories,
31
32
  URLExtension,
@@ -49,8 +50,17 @@ class BaseDataGardenAPI(BaseApi):
49
50
  password: str | None = None,
50
51
  ):
51
52
  self._environment = environment or TheDatagardenProductionEnvironment
52
- self._tokens = self.ACCESS_TOKEN(self._environment, email, password)
53
53
  self._base_url = self._environment().the_datagarden_url
54
+ self._api_status = self._check_pulse()
55
+ self._tokens = self.ACCESS_TOKEN(self._environment, email, password)
56
+
57
+ def _check_pulse(self) -> bool:
58
+ url = self._generate_url(URLExtension.PULSE)
59
+ response = requests.request(method="GET", url=url, headers=DEFAULT_HEADER.copy())
60
+
61
+ if response.status_code == 200:
62
+ return True
63
+ return False
54
64
 
55
65
  def _generate_url(self, url_extension: str) -> str:
56
66
  url = self._base_url + url_extension
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: the-datagarden
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: Public data made easy.
5
5
  Author-email: Maarten de Ruyter <info@the-datagarden.io>
6
6
  License: MIT
7
7
  Project-URL: Read the Docs, https://dg-the-datagarden.readthedocs.io/en/stable/
8
8
  Project-URL: The-DataGarden, https://www.the-datagarden.io/
9
9
  Project-URL: API documentation, https://www.the-datagarden.io/api-docs
10
- Project-URL: Source, https://github.com/the-datagarden/the-datagarden
10
+ Project-URL: Source, https://github.com/OlivettaDataGarden/dg-the-datagarden
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
File without changes