repsapi 0.1.0__tar.gz → 0.1.2__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.
@@ -0,0 +1,65 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `repsapi` PyPI package. Versions follow [Semantic Versioning](https://semver.org/);
4
+ before 1.0, a new field or method bumps the patch (`0.1.x`) and a breaking change bumps the minor (`0.x.0`).
5
+
6
+ API changes on the server side are listed at https://repsapi.pl/changelog.
7
+
8
+ ## 0.1.2 - 2026-10-25
9
+
10
+ ### Added
11
+
12
+ - `QcBatch["sku_en"]` and `QcBatch["sku_pl"]`: English and Polish versions of the batch's variant name when the
13
+ warehouse wrote it in Chinese (`sku: "黑色 / M"` → `sku_en: "Black / M"`, `sku_pl: "Czarny / M"`). Both are
14
+ optional, like `sku`.
15
+
16
+ ### Notes
17
+
18
+ - No runtime changes. Older versions keep working: they return the same JSON, their types just don't know the new fields.
19
+
20
+ ## 0.1.1 - 2026-10-14
21
+
22
+ ### Added
23
+
24
+ - `ServiceName` now includes `"shipping"`. `/v1/health` reports the shipping calculator behind
25
+ `shipping_estimate()` and `haul()` as its own service, so `health()["services"]["shipping"]` and
26
+ `health()["uptime_30d"]["shipping"]` are typed.
27
+
28
+ ### Notes
29
+
30
+ - No runtime changes. 0.1.0 keeps working: it returns the same JSON, its types just don't know `shipping`.
31
+
32
+ ## 0.1.0 - 2026-10-14
33
+
34
+ First release.
35
+
36
+ ### Added
37
+
38
+ - `RepsApi` (sync) and `AsyncRepsApi` (asyncio - discord.py, FastAPI) clients for Python 3.9+. One dependency: `httpx`.
39
+ Both work as context managers and accept your own `httpx.Client` / `httpx.AsyncClient`.
40
+ - One method per endpoint:
41
+ - `tracking(num)` - `GET /v1/tracking`
42
+ - `qc(url)` or `qc(platform=, id=)` - `GET /v1/qc`
43
+ - `lookup(url, currency=, agent=)` - `GET /v1/lookup`
44
+ - `convert(url, agents=)` - `GET /v1/convert`
45
+ - `shipping_estimate(country, ...)` - `POST /v1/shipping/estimate`, by weight or straight from product links
46
+ - `haul(items, country, ...)` - `POST /v1/haul`
47
+ - `usage()` - `GET /v1/usage`
48
+ - `shipping_countries()`, `rates(base)`, `health(days=)`, `changelog(limit=, lang=)` - public, sent without the key
49
+ - Typed responses (`TypedDict`, `py.typed`) for every endpoint, written from the API's own route code; passes `mypy --strict`.
50
+ - Errors as classes: `RepsApiError` → `APIError` (`status`, `type`, `message`, `details`) → `BadRequestError`,
51
+ `AuthenticationError`, `PermissionDeniedError`, `NotFoundError`, `UnprocessableEntityError`, `RateLimitError`
52
+ (`retry_after`, `reset_at`, `limit`, `used`, `scope`), `InternalServerError`; plus `APIConnectionError` and
53
+ `APITimeoutError` when there is no answer. Body validation errors land in `BadRequestError` with `details["fields"]`.
54
+ - Retries: 2 by default on network errors and 500/502/503/504 (exponential backoff with jitter), and on a short `429`
55
+ (honours `Retry-After` up to 60 s). A used-up daily quota raises `RateLimitError` straight away.
56
+ - Timeouts: 60 s per attempt, 180 s for `haul()` and link-based shipping estimates.
57
+ - `health()` returns the full report on `503` instead of raising.
58
+
59
+ ### Security
60
+
61
+ - The key is only sent in `Authorization: Bearer`, only to endpoints that need it, never in the URL.
62
+ - `base_url` must be `https://` (`http://` only for localhost); URLs with credentials, a query or a fragment are rejected.
63
+ - Redirects are never followed, even with your own `httpx.Client(follow_redirects=True)`, so the key can't leak to another host.
64
+ - `repr(api)` never shows the key.
65
+ - Keys with whitespace or control characters are rejected up front.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: repsapi
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Official RepsApi.pl client: parcel tracking, QC photos, product lookup, agent links and shipping estimates.
5
5
  Project-URL: Homepage, https://repsapi.pl
6
6
  Project-URL: Documentation, https://repsapi.pl/docs
@@ -151,6 +151,14 @@ except UnprocessableEntityError:
151
151
  api = RepsApi(api_key="rk_live_...", timeout=30, max_retries=3)
152
152
  ```
153
153
 
154
+ ## Changelog
155
+
156
+ **0.1.2** (2026-10-25): QC batches have `sku_en` / `sku_pl` - the variant name in English and Polish when the warehouse wrote it in Chinese. No runtime changes.
157
+
158
+ **0.1.1** (2026-10-14): `ServiceName` includes `"shipping"` - `health()` now reports the shipping calculator. No runtime changes.
159
+
160
+ **0.1.0** (2026-10-14): first release. The full list is in `CHANGELOG.md` in the source distribution.
161
+
154
162
  ## Links
155
163
 
156
164
  - Documentation: https://repsapi.pl/docs
@@ -128,6 +128,14 @@ except UnprocessableEntityError:
128
128
  api = RepsApi(api_key="rk_live_...", timeout=30, max_retries=3)
129
129
  ```
130
130
 
131
+ ## Changelog
132
+
133
+ **0.1.2** (2026-10-25): QC batches have `sku_en` / `sku_pl` - the variant name in English and Polish when the warehouse wrote it in Chinese. No runtime changes.
134
+
135
+ **0.1.1** (2026-10-14): `ServiceName` includes `"shipping"` - `health()` now reports the shipping calculator. No runtime changes.
136
+
137
+ **0.1.0** (2026-10-14): first release. The full list is in `CHANGELOG.md` in the source distribution.
138
+
131
139
  ## Links
132
140
 
133
141
  - Documentation: https://repsapi.pl/docs
@@ -34,7 +34,7 @@ path = "src/repsapi/_version.py"
34
34
 
35
35
  [tool.hatch.build.targets.sdist]
36
36
  # hatchling also copies the nearest .gitignore; the local one keeps the site's out of the package
37
- only-include = ["src/repsapi", "README.md", "LICENSE", "pyproject.toml"]
37
+ only-include = ["src/repsapi", "README.md", "CHANGELOG.md", "LICENSE", "pyproject.toml"]
38
38
 
39
39
  [tool.hatch.build.targets.wheel]
40
40
  packages = ["src/repsapi"]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.2"
@@ -21,7 +21,7 @@ TrackingStage = Literal[
21
21
  "ready_for_pickup", "delivered", "delayed", "exception", "returned",
22
22
  ]
23
23
 
24
- ServiceName = Literal["api", "tracking", "qc", "lookup", "convert"]
24
+ ServiceName = Literal["api", "tracking", "qc", "lookup", "convert", "shipping"]
25
25
  ServiceStatus = Literal["operational", "degraded", "down"]
26
26
  ChangeTag = Literal["new", "improved", "fixed", "removed"]
27
27
 
@@ -94,6 +94,9 @@ class _QcBatchBase(TypedDict):
94
94
 
95
95
  class QcBatch(_QcBatchBase, total=False):
96
96
  sku: str
97
+ # English / Polish variant name, only when ``sku`` was Chinese
98
+ sku_en: str
99
+ sku_pl: str
97
100
 
98
101
 
99
102
  class _QcResponseBase(TypedDict):
@@ -1 +0,0 @@
1
- __version__ = "0.1.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes