pyvikunja 0.7__py3-none-any.whl → 0.8__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.
pyvikunja/api.py CHANGED
@@ -74,6 +74,22 @@ class VikunjaAPI:
74
74
  logger.error(f"Unexpected error occurred: {e} | URL: {url}")
75
75
  return None
76
76
 
77
+ async def ping(self) -> bool:
78
+ """Tests if the API key is valid by calling the /projects endpoint."""
79
+ """Not chosen the /user endpoint here because it was always returning 401 with an API Token"""
80
+ url = f"{self.api_base_url}/projects"
81
+
82
+ try:
83
+ response = await self.client.get(url, headers=self.headers, timeout=10)
84
+ response.raise_for_status()
85
+
86
+ if response.status_code == 200:
87
+ return True
88
+ else:
89
+ raise httpx.HTTPError(f"Non-200 Response from server {response.status_code}")
90
+ except httpx.HTTPError as e:
91
+ raise e
92
+
77
93
  # Projects
78
94
  async def get_projects(self, page: int = 1, per_page: int = 20) -> List[Project]:
79
95
  response = await self._request("GET", "/projects", params={"page": page, "per_page": per_page})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyvikunja
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: A Python wrapper for Vikunja API
5
5
  Author: Joseph Shufflebotham
6
6
  License: AGPL
@@ -1,5 +1,5 @@
1
1
  pyvikunja/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pyvikunja/api.py,sha256=TgHoibnVlYtkVYi5fdnwugF33q4uheawzcWhaBOjyIQ,6277
2
+ pyvikunja/api.py,sha256=mHPn0XPFrYNCG3ChIUnluAOP08z3YyUL_3nors9RuYU,6920
3
3
  pyvikunja/models/label.py,sha256=cOOuVYDVDMmK96Ev22EDgWwXljkAonQNL4XsTMay4K4,467
4
4
  pyvikunja/models/models.py,sha256=RCPsYQtcgE-W5ZmhwGDejAI76nHZ9-1X-x5GeTG4RnI,637
5
5
  pyvikunja/models/project.py,sha256=viVIe3lVgbh7k05ADDds1cwzvC1vf4tT2vSNjbB7KMk,1179
@@ -8,8 +8,8 @@ pyvikunja/models/team.py,sha256=0Z3828Cm3nNuNr1z2on63fLYAVW325_SQKi5RmqXf-I,559
8
8
  pyvikunja/models/user.py,sha256=36duFNyGXKzlwqO0d6FA-C1KTCci2sIMU1IBIF-N_LM,310
9
9
  pyvikunja/models/enum/repeat_mode.py,sha256=T0cOJcCYJjewZ9dQ41cEFYmOEEfW73cM4xxNYmH8y6s,106
10
10
  pyvikunja/models/enum/task_priority.py,sha256=aVz1HEofIqwUkXG0vYm58n_vLNbgqtbvHuQ5K-YQqA0,119
11
- pyvikunja-0.7.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
12
- pyvikunja-0.7.dist-info/METADATA,sha256=anlQ0b_LYXXeEo31POBMIlgkAWlgUzhYrkiZ-fRY5No,187
13
- pyvikunja-0.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
- pyvikunja-0.7.dist-info/top_level.txt,sha256=WVV9zgxUBuWOkUY1t_U7zI0paWWTVelKYB4vjsiKsks,10
15
- pyvikunja-0.7.dist-info/RECORD,,
11
+ pyvikunja-0.8.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
12
+ pyvikunja-0.8.dist-info/METADATA,sha256=6qwKYwpuz89skchRjmmKwlLIwchoTgzsqJU9XF78iVI,187
13
+ pyvikunja-0.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ pyvikunja-0.8.dist-info/top_level.txt,sha256=WVV9zgxUBuWOkUY1t_U7zI0paWWTVelKYB4vjsiKsks,10
15
+ pyvikunja-0.8.dist-info/RECORD,,