sharpapi 0.3.1__tar.gz → 0.3.3__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.
@@ -14,5 +14,4 @@ build/
14
14
  htmlcov/
15
15
  .claude/
16
16
  .DS_Store
17
- tests/
18
17
  .benchmarks/
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to the `sharpapi` Python SDK are documented here.
4
4
 
5
+ ## 0.3.2 — 2026-05-07
6
+
7
+ ### Changed
8
+
9
+ - Update `Repository` and `Changelog` URLs in package metadata to use the
10
+ canonical `SharpAPI-Python` repo name (was lowercase `sharpapi-python`,
11
+ redirected by GitHub but worth making canonical on PyPI). Metadata-only
12
+ release; no code changes.
13
+
5
14
  ## 0.3.1 — 2026-05-06
6
15
 
7
16
  ### Added — TeamRef metadata
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sharpapi
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Official Python SDK for the SharpAPI real-time sports betting odds API
5
5
  Project-URL: Homepage, https://sharpapi.io
6
6
  Project-URL: Documentation, https://docs.sharpapi.io/sdks/python
7
- Project-URL: Repository, https://github.com/Sharp-API/sharpapi-python
8
- Project-URL: Changelog, https://github.com/Sharp-API/sharpapi-python/releases
7
+ Project-URL: Repository, https://github.com/Sharp-API/SharpAPI-Python
8
+ Project-URL: Changelog, https://github.com/Sharp-API/SharpAPI-Python/releases
9
9
  Author-email: SharpAPI <hello@sharpapi.io>
10
10
  License-Expression: MIT
11
11
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sharpapi"
7
- version = "0.3.1"
7
+ version = "0.3.3"
8
8
  description = "Official Python SDK for the SharpAPI real-time sports betting odds API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -35,8 +35,8 @@ test = ["pytest>=8.0", "pytest-asyncio>=0.23", "respx>=0.21"]
35
35
  [project.urls]
36
36
  Homepage = "https://sharpapi.io"
37
37
  Documentation = "https://docs.sharpapi.io/sdks/python"
38
- Repository = "https://github.com/Sharp-API/sharpapi-python"
39
- Changelog = "https://github.com/Sharp-API/sharpapi-python/releases"
38
+ Repository = "https://github.com/Sharp-API/SharpAPI-Python"
39
+ Changelog = "https://github.com/Sharp-API/SharpAPI-Python/releases"
40
40
 
41
41
  [tool.hatch.build.targets.wheel]
42
42
  packages = ["src/sharpapi"]
@@ -33,6 +33,15 @@ RETRY_BASE_DELAY = 0.5
33
33
  RETRY_MAX_DELAY = 4.0
34
34
 
35
35
 
36
+ def normalize_base_url(base_url: str) -> str:
37
+ """Return the API origin URL, accepting values with a trailing /api/v1."""
38
+ cleaned = base_url.rstrip("/")
39
+ suffix = "/api/v1"
40
+ if cleaned.endswith(suffix):
41
+ return cleaned[: -len(suffix)]
42
+ return cleaned
43
+
44
+
36
45
  def should_retry(response: httpx.Response | None, exc: Exception | None) -> bool:
37
46
  """True for transient upstream failures worth retrying."""
38
47
  if exc is not None:
@@ -15,6 +15,7 @@ from ._base import (
15
15
  AuthMethod,
16
16
  handle_errors,
17
17
  make_headers,
18
+ normalize_base_url,
18
19
  parse_rate_limit,
19
20
  parse_response,
20
21
  retry_delay,
@@ -89,7 +90,7 @@ class AsyncSharpAPI:
89
90
 
90
91
  self._api_key = api_key
91
92
  self._auth_method: AuthMethod = auth_method
92
- self._base_url = base_url.rstrip("/")
93
+ self._base_url = normalize_base_url(base_url)
93
94
  self._timeout = timeout
94
95
  self._http = httpx.AsyncClient(
95
96
  base_url=f"{self._base_url}/api/v1",
@@ -15,6 +15,7 @@ from ._base import (
15
15
  AuthMethod,
16
16
  handle_errors,
17
17
  make_headers,
18
+ normalize_base_url,
18
19
  parse_rate_limit,
19
20
  parse_response,
20
21
  retry_delay,
@@ -97,7 +98,7 @@ class SharpAPI:
97
98
 
98
99
  self._api_key = api_key
99
100
  self._auth_method: AuthMethod = auth_method
100
- self._base_url = base_url.rstrip("/")
101
+ self._base_url = normalize_base_url(base_url)
101
102
  self._timeout = timeout
102
103
  self._http = httpx.Client(
103
104
  base_url=f"{self._base_url}/api/v1",
File without changes
File without changes
File without changes
File without changes