bpost-address-validator 0.1.1__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.
- bpost_address_validator-0.1.1/.github/workflows/publish.yml +54 -0
- bpost_address_validator-0.1.1/LICENSE +21 -0
- bpost_address_validator-0.1.1/PKG-INFO +8 -0
- bpost_address_validator-0.1.1/README.md +295 -0
- bpost_address_validator-0.1.1/bpost_address_validator/__init__.py +63 -0
- bpost_address_validator-0.1.1/bpost_address_validator/client.py +158 -0
- bpost_address_validator-0.1.1/bpost_address_validator/errors.py +24 -0
- bpost_address_validator-0.1.1/bpost_address_validator/models.py +292 -0
- bpost_address_validator-0.1.1/pyproject.toml +13 -0
- bpost_address_validator-0.1.1/uv.lock +202 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
repository:
|
|
9
|
+
description: "PyPI repository to publish to (pypi or testpypi)"
|
|
10
|
+
required: false
|
|
11
|
+
default: pypi
|
|
12
|
+
type: choice
|
|
13
|
+
options:
|
|
14
|
+
- pypi
|
|
15
|
+
- testpypi
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
id-token: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build-and-publish:
|
|
23
|
+
name: Build with uv and publish
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
environment: pypi
|
|
26
|
+
steps:
|
|
27
|
+
- name: Check out repository
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up uv (with Python 3.12)
|
|
31
|
+
uses: astral-sh/setup-uv@v4
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
|
|
35
|
+
- name: Build distributions with uv
|
|
36
|
+
run: |
|
|
37
|
+
rm -rf dist
|
|
38
|
+
uv build
|
|
39
|
+
|
|
40
|
+
# Trusted Publishing (OIDC) — no API token required
|
|
41
|
+
- name: Publish to TestPyPI (manual input selected)
|
|
42
|
+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi' }}
|
|
43
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
with:
|
|
45
|
+
repository-url: https://test.pypi.org/legacy/
|
|
46
|
+
# Skip artifacts if the exact version already exists on the repository
|
|
47
|
+
skip-existing: true
|
|
48
|
+
|
|
49
|
+
- name: Publish to PyPI (release or manual input selected)
|
|
50
|
+
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi') }}
|
|
51
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
52
|
+
with:
|
|
53
|
+
# Skip artifacts if the exact version already exists on the repository
|
|
54
|
+
skip-existing: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 fromej.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bpost-address-validator
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python wrapper for bpost External Mailing Address Proofing API with pydantic models and httpx sync/async clients.
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Requires-Dist: httpx>=0.27.0
|
|
8
|
+
Requires-Dist: pydantic>=2.7.0
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
### bpost-address-validator
|
|
2
|
+
|
|
3
|
+
This is a lightweight Python wrapper for bpost’s External Mailing Address Proofing API endpoint `POST /roa-info-st/externalMailingAddressProofingRest/validateAddresses`.
|
|
4
|
+
|
|
5
|
+
It provides:
|
|
6
|
+
- Synchronous and asynchronous clients powered by `httpx`
|
|
7
|
+
- Pydantic v2 models for request/response envelopes (flexible inner structure; extra fields allowed)
|
|
8
|
+
- A simple, typed interface and explicit error handling via `ApiError`
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
#### Features
|
|
12
|
+
- Sync client: `BpostClient`
|
|
13
|
+
- Async client: `AsyncBpostClient`
|
|
14
|
+
- Automatic `x-api-key` header handling
|
|
15
|
+
- Default base URL pointing to bpost NP environment
|
|
16
|
+
- Uniform error type `ApiError` for transport and non-200 responses
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#### Requirements
|
|
20
|
+
- Python 3.12+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#### Installation
|
|
24
|
+
```bash
|
|
25
|
+
pip install bpost-address-validator
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
From source (editable):
|
|
29
|
+
```bash
|
|
30
|
+
pip install -e .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#### Quick start (sync)
|
|
35
|
+
```python
|
|
36
|
+
from bpost_address_validator import (
|
|
37
|
+
BpostClient,
|
|
38
|
+
ValidateAddressesRequest,
|
|
39
|
+
ValidateAddressesRequestContent,
|
|
40
|
+
AddressToValidateList,
|
|
41
|
+
AddressToValidate,
|
|
42
|
+
ValidateAddressOptions,
|
|
43
|
+
PostalAddress,
|
|
44
|
+
DeliveryPointLocation,
|
|
45
|
+
StructuredDeliveryPointLocation,
|
|
46
|
+
PostalCodeMunicipality,
|
|
47
|
+
StructuredPostalCodeMunicipality,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
req = ValidateAddressesRequest(
|
|
51
|
+
validate_addresses_request=ValidateAddressesRequestContent(
|
|
52
|
+
address_to_validate_list=AddressToValidateList(
|
|
53
|
+
address_to_validate=[
|
|
54
|
+
AddressToValidate(
|
|
55
|
+
id="1",
|
|
56
|
+
dispatching_country_iso_code="BE",
|
|
57
|
+
delivering_country_iso_code="BE",
|
|
58
|
+
# Provide either address_block_lines or a structured postal_address
|
|
59
|
+
postal_address=PostalAddress(
|
|
60
|
+
delivery_point_location=DeliveryPointLocation(
|
|
61
|
+
structured_delivery_point_location=StructuredDeliveryPointLocation(
|
|
62
|
+
street_name="Muntstraat",
|
|
63
|
+
street_number="1",
|
|
64
|
+
)
|
|
65
|
+
),
|
|
66
|
+
postal_code_municipality=PostalCodeMunicipality(
|
|
67
|
+
structured_postal_code_municipality=StructuredPostalCodeMunicipality(
|
|
68
|
+
postal_code="1000",
|
|
69
|
+
municipality_name="Bruxelles",
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
),
|
|
76
|
+
validate_address_options=ValidateAddressOptions(
|
|
77
|
+
include_submitted_address=True,
|
|
78
|
+
include_suggestions=True,
|
|
79
|
+
include_formatting=True,
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
with BpostClient(api_key="<YOUR_API_KEY>") as client:
|
|
85
|
+
resp = client.validate_addresses(req)
|
|
86
|
+
print(resp.model_dump())
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
#### Quick start (async)
|
|
91
|
+
```python
|
|
92
|
+
import asyncio
|
|
93
|
+
from bpost_address_validator import (
|
|
94
|
+
AsyncBpostClient,
|
|
95
|
+
ValidateAddressesRequest,
|
|
96
|
+
ValidateAddressesRequestContent,
|
|
97
|
+
AddressToValidateList,
|
|
98
|
+
AddressToValidate,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
async def main():
|
|
102
|
+
req = ValidateAddressesRequest(
|
|
103
|
+
validate_addresses_request=ValidateAddressesRequestContent(
|
|
104
|
+
address_to_validate_list=AddressToValidateList(
|
|
105
|
+
address_to_validate=[
|
|
106
|
+
AddressToValidate(
|
|
107
|
+
id="1",
|
|
108
|
+
dispatching_country_iso_code="BE",
|
|
109
|
+
delivering_country_iso_code="BE",
|
|
110
|
+
)
|
|
111
|
+
]
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
async with AsyncBpostClient(api_key="<YOUR_API_KEY>") as client:
|
|
116
|
+
resp = await client.validate_addresses(req)
|
|
117
|
+
print(resp.model_dump())
|
|
118
|
+
|
|
119
|
+
asyncio.run(main())
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
#### Using the typed address models
|
|
124
|
+
```python
|
|
125
|
+
from bpost_address_validator import (
|
|
126
|
+
BpostClient,
|
|
127
|
+
ValidateAddressesRequest,
|
|
128
|
+
ValidateAddressesRequestContent,
|
|
129
|
+
AddressToValidateList,
|
|
130
|
+
AddressToValidate,
|
|
131
|
+
ValidateAddressOptions,
|
|
132
|
+
AddressBlockLines,
|
|
133
|
+
UnstructuredAddressLineItem,
|
|
134
|
+
PostalAddress,
|
|
135
|
+
DeliveryPointLocation,
|
|
136
|
+
StructuredDeliveryPointLocation,
|
|
137
|
+
PostalCodeMunicipality,
|
|
138
|
+
StructuredPostalCodeMunicipality,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
req = ValidateAddressesRequest(
|
|
142
|
+
validate_addresses_request=ValidateAddressesRequestContent(
|
|
143
|
+
address_to_validate_list=AddressToValidateList(
|
|
144
|
+
address_to_validate=[
|
|
145
|
+
AddressToValidate(
|
|
146
|
+
id="1",
|
|
147
|
+
dispatching_country_iso_code="BE",
|
|
148
|
+
delivering_country_iso_code="BE",
|
|
149
|
+
# Option A: unstructured address lines
|
|
150
|
+
address_block_lines=AddressBlockLines(
|
|
151
|
+
unstructured_address_line=[
|
|
152
|
+
UnstructuredAddressLineItem(body="Muntstraat 1", locale="nl")
|
|
153
|
+
]
|
|
154
|
+
),
|
|
155
|
+
# Option B: structured postal address (can be used instead of address_block_lines)
|
|
156
|
+
postal_address=PostalAddress(
|
|
157
|
+
delivery_point_location=DeliveryPointLocation(
|
|
158
|
+
structured_delivery_point_location=StructuredDeliveryPointLocation(
|
|
159
|
+
street_name="Muntstraat", street_number="1"
|
|
160
|
+
)
|
|
161
|
+
),
|
|
162
|
+
postal_code_municipality=PostalCodeMunicipality(
|
|
163
|
+
structured_postal_code_municipality=StructuredPostalCodeMunicipality(
|
|
164
|
+
postal_code="1000", municipality_name="Bruxelles"
|
|
165
|
+
)
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
)
|
|
169
|
+
]
|
|
170
|
+
),
|
|
171
|
+
validate_address_options=ValidateAddressOptions(include_formatting=True),
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
with BpostClient(api_key="<YOUR_API_KEY>") as client:
|
|
176
|
+
resp = client.validate_addresses(req)
|
|
177
|
+
# Access typed response envelope
|
|
178
|
+
print(resp.validate_addresses_response is not None)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
#### Passing a raw dict payload
|
|
183
|
+
```python
|
|
184
|
+
from bpost_address_validator import BpostClient
|
|
185
|
+
|
|
186
|
+
payload = {
|
|
187
|
+
"ValidateAddressesRequest": {
|
|
188
|
+
"AddressToValidateList": {
|
|
189
|
+
"AddressToValidate": [
|
|
190
|
+
{
|
|
191
|
+
"@id": "1",
|
|
192
|
+
"DispatchingCountryISOCode": "BE",
|
|
193
|
+
"DeliveringCountryISOCode": "BE",
|
|
194
|
+
"PostalAddress": {
|
|
195
|
+
"DeliveryPointLocation": {
|
|
196
|
+
"StructuredDeliveryPointLocation": {
|
|
197
|
+
"StreetName": "Muntstraat",
|
|
198
|
+
"StreetNumber": "1",
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"PostalCodeMunicipality": {
|
|
202
|
+
"StructuredPostalCodeMunicipality": {
|
|
203
|
+
"PostalCode": "1000",
|
|
204
|
+
"MunicipalityName": "Bruxelles",
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"ValidateAddressOptions": {"IncludeFormatting": True},
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
with BpostClient(api_key="<YOUR_API_KEY>") as client:
|
|
216
|
+
resp = client.validate_addresses(payload)
|
|
217
|
+
print(resp.validate_addresses_response is not None)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
#### API overview
|
|
222
|
+
- Clients
|
|
223
|
+
- `BpostClient(api_key: str, base_url: str = DEFAULT, timeout: float | None = 30.0)`
|
|
224
|
+
- `validate_addresses(payload) -> ValidateAddressesResponse`
|
|
225
|
+
- `AsyncBpostClient(api_key: str, base_url: str = DEFAULT, timeout: float | None = 30.0)`
|
|
226
|
+
- `await validate_addresses(payload) -> ValidateAddressesResponse`
|
|
227
|
+
|
|
228
|
+
- Models (selected)
|
|
229
|
+
- `ValidateAddressesRequest`
|
|
230
|
+
- `ValidateAddressesRequestContent`
|
|
231
|
+
- `AddressToValidateList`
|
|
232
|
+
- `AddressToValidate`
|
|
233
|
+
- `AddressBlockLines`, `UnstructuredAddressLineItem`
|
|
234
|
+
- `PostalAddress`, `DeliveryPointLocation`, `StructuredDeliveryPointLocation`
|
|
235
|
+
- `PostalCodeMunicipality`, `StructuredPostalCodeMunicipality`
|
|
236
|
+
- `ValidateAddressOptions`
|
|
237
|
+
- `ValidateAddressesResponse`
|
|
238
|
+
|
|
239
|
+
- Errors
|
|
240
|
+
- `ApiError` — for transport errors and non-200 responses. Inspect `status_code` and `details` for context.
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
#### Request/Response envelopes
|
|
244
|
+
- Request body root: `{"ValidateAddressesRequest": {...}}`
|
|
245
|
+
- Response body root: `{"ValidateAddressesResponse": {...}}`
|
|
246
|
+
|
|
247
|
+
Models allow extra fields to preserve forward-compatibility with upstream changes. See `externalMailaddressProofingAPI-OpenAPIspec_v3.yaml` for the full schema reference.
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
#### Environments and base URL
|
|
251
|
+
- Default base URL (NP): `https://api.mailops-np.bpost.cloud`
|
|
252
|
+
- Endpoint path: `/roa-info-st/externalMailingAddressProofingRest/validateAddresses`
|
|
253
|
+
You can override the base URL in the client constructor.
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
#### Error handling
|
|
257
|
+
- Transport issues raise `ApiError("HTTP transport error")`.
|
|
258
|
+
- Non-200 responses raise `ApiError` with `status_code` and parsed `details` (JSON when available).
|
|
259
|
+
|
|
260
|
+
Example:
|
|
261
|
+
```python
|
|
262
|
+
from bpost_address_validator import BpostClient, ApiError
|
|
263
|
+
|
|
264
|
+
try:
|
|
265
|
+
with BpostClient(api_key="bad-key") as client:
|
|
266
|
+
client.validate_addresses({"ValidateAddressesRequest": {}})
|
|
267
|
+
except ApiError as e:
|
|
268
|
+
print(e.status_code, e.details)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
#### Authentication
|
|
273
|
+
Provide your API key via the `api_key` parameter. It is sent as `x-api-key` automatically.
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
#### Typing strategy
|
|
277
|
+
- Pydantic v2 models are used for the outer envelopes and key nested structures.
|
|
278
|
+
- Public attributes are Pythonic snake_case; JSON aliases match the API (e.g., `dispatching_country_iso_code` -> `DispatchingCountryISOCode`).
|
|
279
|
+
- Typed models are provided for `address_block_lines` and `postal_address` structures (including delivery point location and postal code/municipality).
|
|
280
|
+
- Extra keys are allowed across models to avoid breakage if bpost adds new fields.
|
|
281
|
+
- For attributes like `"@id"`, the models expose proper field aliases (e.g., `Field(alias="@id")`).
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
#### Development
|
|
285
|
+
- Python 3.12+
|
|
286
|
+
- Runtime deps: `httpx>=0.27.0`, `pydantic>=2.7.0`
|
|
287
|
+
- No tests yet — PRs welcome (tests and deeper typed models).
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
#### License
|
|
291
|
+
MIT — see `LICENSE` if provided, otherwise follow repository policy.
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
#### Disclaimer
|
|
295
|
+
This project is not affiliated with or endorsed by bpost. Use at your own risk and comply with bpost’s terms.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""bpost_address_validator
|
|
2
|
+
|
|
3
|
+
Python wrapper for bpost External Mailing Address Proofing API.
|
|
4
|
+
|
|
5
|
+
Sync and async clients using httpx and Pydantic models.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .client import BpostClient, AsyncBpostClient
|
|
9
|
+
from .models import (
|
|
10
|
+
AddressToValidate,
|
|
11
|
+
AddressToValidateList,
|
|
12
|
+
AddressBlockLines,
|
|
13
|
+
UnstructuredAddressLineItem,
|
|
14
|
+
PostalAddress,
|
|
15
|
+
DeliveryPointLocation,
|
|
16
|
+
StructuredDeliveryPointLocation,
|
|
17
|
+
PostalCodeMunicipality,
|
|
18
|
+
StructuredPostalCodeMunicipality,
|
|
19
|
+
OtherDeliveryInformation,
|
|
20
|
+
StructuredOtherDeliveryInformation,
|
|
21
|
+
ValidateAddressesRequestContent,
|
|
22
|
+
ValidateAddressOptions,
|
|
23
|
+
CallerIdentification,
|
|
24
|
+
ValidateAddressesRequest,
|
|
25
|
+
ValidatedAddressResult,
|
|
26
|
+
ValidatedAddressResultList,
|
|
27
|
+
ValidateAddressesResponse,
|
|
28
|
+
ValidationMessageBase,
|
|
29
|
+
ValidationErrorItem,
|
|
30
|
+
ValidationWarningItem,
|
|
31
|
+
ValidationErrorList,
|
|
32
|
+
ValidationWarningList,
|
|
33
|
+
)
|
|
34
|
+
from .errors import ApiError
|
|
35
|
+
|
|
36
|
+
__all__ = [
|
|
37
|
+
"BpostClient",
|
|
38
|
+
"AsyncBpostClient",
|
|
39
|
+
"AddressToValidate",
|
|
40
|
+
"AddressToValidateList",
|
|
41
|
+
"AddressBlockLines",
|
|
42
|
+
"UnstructuredAddressLineItem",
|
|
43
|
+
"PostalAddress",
|
|
44
|
+
"DeliveryPointLocation",
|
|
45
|
+
"StructuredDeliveryPointLocation",
|
|
46
|
+
"PostalCodeMunicipality",
|
|
47
|
+
"StructuredPostalCodeMunicipality",
|
|
48
|
+
"OtherDeliveryInformation",
|
|
49
|
+
"StructuredOtherDeliveryInformation",
|
|
50
|
+
"ValidateAddressesRequestContent",
|
|
51
|
+
"ValidateAddressOptions",
|
|
52
|
+
"CallerIdentification",
|
|
53
|
+
"ValidateAddressesRequest",
|
|
54
|
+
"ValidatedAddressResult",
|
|
55
|
+
"ValidatedAddressResultList",
|
|
56
|
+
"ValidateAddressesResponse",
|
|
57
|
+
"ValidationMessageBase",
|
|
58
|
+
"ValidationErrorItem",
|
|
59
|
+
"ValidationWarningItem",
|
|
60
|
+
"ValidationErrorList",
|
|
61
|
+
"ValidationWarningList",
|
|
62
|
+
"ApiError",
|
|
63
|
+
]
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Optional, Union, Literal
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .errors import ApiError
|
|
8
|
+
from .models import ValidateAddressesRequest, ValidateAddressesResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
DEFAULT_BASE_URL = "https://api.mailops-np.bpost.cloud"
|
|
12
|
+
|
|
13
|
+
# Supported environment prefixes for the path segment
|
|
14
|
+
Environment = Literal["roa-info", "roa-info-st", "roa-info-ac"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _ensure_request_payload(
|
|
18
|
+
payload: Union[ValidateAddressesRequest, Dict[str, Any]],
|
|
19
|
+
) -> Dict[str, Any]:
|
|
20
|
+
if isinstance(payload, ValidateAddressesRequest):
|
|
21
|
+
return payload.model_dump(by_alias=True, exclude_none=True)
|
|
22
|
+
if isinstance(payload, dict):
|
|
23
|
+
return payload
|
|
24
|
+
raise TypeError(
|
|
25
|
+
"payload must be ValidateAddressesRequest or dict, got " + type(payload).__name__
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BpostClient:
|
|
30
|
+
"""Synchronous client for the bpost External Mailing Address Proofing API.
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
with BpostClient(api_key="...", environment="roa-info") as client:
|
|
34
|
+
resp = client.validate_addresses(request_payload)
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(
|
|
38
|
+
self,
|
|
39
|
+
*,
|
|
40
|
+
api_key: str,
|
|
41
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
42
|
+
environment: Environment = "roa-info",
|
|
43
|
+
timeout: Optional[float] = 30.0,
|
|
44
|
+
client: Optional[httpx.Client] = None,
|
|
45
|
+
) -> None:
|
|
46
|
+
self._base_url = base_url.rstrip("/")
|
|
47
|
+
self._environment: Environment = environment
|
|
48
|
+
self._timeout = timeout
|
|
49
|
+
self._external_client = client is not None
|
|
50
|
+
self._client = client or httpx.Client(
|
|
51
|
+
base_url=self._base_url,
|
|
52
|
+
headers={
|
|
53
|
+
"Content-Type": "application/json",
|
|
54
|
+
"x-api-key": api_key
|
|
55
|
+
},
|
|
56
|
+
timeout=self._timeout,
|
|
57
|
+
)
|
|
58
|
+
self._validate_path = (
|
|
59
|
+
f"/{self._environment}/externalMailingAddressProofingRest/validateAddresses"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
def close(self) -> None:
|
|
63
|
+
if not self._external_client:
|
|
64
|
+
self._client.close()
|
|
65
|
+
|
|
66
|
+
def __enter__(self) -> "BpostClient":
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
def __exit__(self, exc_type, exc, tb) -> None: # pragma: no cover - context manager
|
|
70
|
+
self.close()
|
|
71
|
+
|
|
72
|
+
def validate_addresses(
|
|
73
|
+
self,
|
|
74
|
+
payload: Union[ValidateAddressesRequest, Dict[str, Any]],
|
|
75
|
+
) -> ValidateAddressesResponse:
|
|
76
|
+
body = _ensure_request_payload(payload)
|
|
77
|
+
try:
|
|
78
|
+
res = self._client.post(self._validate_path, json=body)
|
|
79
|
+
except httpx.HTTPError as e: # transport-level error
|
|
80
|
+
raise ApiError("HTTP transport error") from e
|
|
81
|
+
|
|
82
|
+
if res.status_code != 200:
|
|
83
|
+
details: Any
|
|
84
|
+
try:
|
|
85
|
+
details = res.json()
|
|
86
|
+
except Exception:
|
|
87
|
+
details = res.text
|
|
88
|
+
raise ApiError(
|
|
89
|
+
f"Unexpected status {res.status_code}",
|
|
90
|
+
status_code=res.status_code,
|
|
91
|
+
details=details,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
data = res.json()
|
|
95
|
+
return ValidateAddressesResponse.model_validate(data)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class AsyncBpostClient:
|
|
99
|
+
"""Asynchronous client for the bpost External Mailing Address Proofing API."""
|
|
100
|
+
|
|
101
|
+
def __init__(
|
|
102
|
+
self,
|
|
103
|
+
*,
|
|
104
|
+
api_key: str,
|
|
105
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
106
|
+
environment: Environment = "roa-info",
|
|
107
|
+
timeout: Optional[float] = 30.0,
|
|
108
|
+
client: Optional[httpx.AsyncClient] = None,
|
|
109
|
+
) -> None:
|
|
110
|
+
self._base_url = base_url.rstrip("/")
|
|
111
|
+
self._environment: Environment = environment
|
|
112
|
+
self._timeout = timeout
|
|
113
|
+
self._external_client = client is not None
|
|
114
|
+
self._client = client or httpx.AsyncClient(
|
|
115
|
+
base_url=self._base_url,
|
|
116
|
+
headers={
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
"x-api-key": api_key
|
|
119
|
+
},
|
|
120
|
+
timeout=self._timeout,
|
|
121
|
+
)
|
|
122
|
+
self._validate_path = (
|
|
123
|
+
f"/{self._environment}/externalMailingAddressProofingRest/validateAddresses"
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
async def aclose(self) -> None:
|
|
127
|
+
if not self._external_client:
|
|
128
|
+
await self._client.aclose()
|
|
129
|
+
|
|
130
|
+
async def __aenter__(self) -> "AsyncBpostClient": # pragma: no cover - CM
|
|
131
|
+
return self
|
|
132
|
+
|
|
133
|
+
async def __aexit__(self, exc_type, exc, tb) -> None: # pragma: no cover - CM
|
|
134
|
+
await self.aclose()
|
|
135
|
+
|
|
136
|
+
async def validate_addresses(
|
|
137
|
+
self,
|
|
138
|
+
payload: Union[ValidateAddressesRequest, Dict[str, Any]],
|
|
139
|
+
) -> ValidateAddressesResponse:
|
|
140
|
+
body = _ensure_request_payload(payload)
|
|
141
|
+
try:
|
|
142
|
+
res = await self._client.post(self._validate_path, json=body)
|
|
143
|
+
except httpx.HTTPError as e:
|
|
144
|
+
raise ApiError("HTTP transport error") from e
|
|
145
|
+
|
|
146
|
+
if res.status_code != 200:
|
|
147
|
+
try:
|
|
148
|
+
details: Any = res.json()
|
|
149
|
+
except Exception:
|
|
150
|
+
details = await res.aread()
|
|
151
|
+
raise ApiError(
|
|
152
|
+
f"Unexpected status {res.status_code}",
|
|
153
|
+
status_code=res.status_code,
|
|
154
|
+
details=details,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
data = res.json()
|
|
158
|
+
return ValidateAddressesResponse.model_validate(data)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApiError(Exception):
|
|
7
|
+
"""Represents an error response from the bpost API or transport layer."""
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
message: str,
|
|
12
|
+
*,
|
|
13
|
+
status_code: Optional[int] = None,
|
|
14
|
+
details: Optional[Any] = None,
|
|
15
|
+
) -> None:
|
|
16
|
+
super().__init__(message)
|
|
17
|
+
self.status_code = status_code
|
|
18
|
+
self.details = details
|
|
19
|
+
|
|
20
|
+
def __str__(self) -> str: # pragma: no cover - simple formatting
|
|
21
|
+
base = super().__str__()
|
|
22
|
+
if self.status_code is not None:
|
|
23
|
+
base += f" (status_code={self.status_code})"
|
|
24
|
+
return base
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# General modeling approach:
|
|
9
|
+
# - Mirror the top-level envelopes exactly as exposed by the API
|
|
10
|
+
# - Keep inner structures flexible (extra = "allow") so the client remains
|
|
11
|
+
# resilient to minor upstream changes without requiring immediate updates.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class _FlexibleModel(BaseModel):
|
|
15
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# ----
|
|
19
|
+
# Request typing additions: AddressBlockLines and PostalAddress structures
|
|
20
|
+
# ----
|
|
21
|
+
|
|
22
|
+
class UnstructuredAddressLineItem(_FlexibleModel):
|
|
23
|
+
body: Optional[str] = Field(default=None, alias="*body")
|
|
24
|
+
locale: Optional[str] = Field(default=None, alias="@locale")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class AddressBlockLines(_FlexibleModel):
|
|
28
|
+
unstructured_address_line: List[UnstructuredAddressLineItem] = Field(
|
|
29
|
+
default_factory=list, alias="UnstructuredAddressLine"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class StructuredDeliveryPointLocation(_FlexibleModel):
|
|
34
|
+
street_name: Optional[str] = Field(default=None, alias="StreetName")
|
|
35
|
+
box_number: Optional[str] = Field(default=None, alias="BoxNumber")
|
|
36
|
+
street_number: Optional[str] = Field(default=None, alias="StreetNumber")
|
|
37
|
+
country_name: Optional[str] = Field(default=None, alias="CountryName")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class DeliveryPointLocation(_FlexibleModel):
|
|
41
|
+
unstructured_delivery_point_location: Optional[str] = Field(
|
|
42
|
+
default=None, alias="UnstructuredDeliveryPointLocation"
|
|
43
|
+
)
|
|
44
|
+
structured_delivery_point_location: Optional[StructuredDeliveryPointLocation] = Field(
|
|
45
|
+
default=None, alias="StructuredDeliveryPointLocation"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class StructuredPostalCodeMunicipality(_FlexibleModel):
|
|
50
|
+
postal_code: Optional[str] = Field(default=None, alias="PostalCode")
|
|
51
|
+
municipality_name: Optional[str] = Field(default=None, alias="MunicipalityName")
|
|
52
|
+
delivery_service_qualifier: Optional[str] = Field(
|
|
53
|
+
default=None, alias="DeliveryServiceQualifier"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class PostalCodeMunicipality(_FlexibleModel):
|
|
58
|
+
unstructured_postal_code_municipality: Optional[str] = Field(
|
|
59
|
+
default=None, alias="UnstructuredPostalCodeMunicipality"
|
|
60
|
+
)
|
|
61
|
+
structured_postal_code_municipality: Optional[StructuredPostalCodeMunicipality] = Field(
|
|
62
|
+
default=None, alias="StructuredPostalCodeMunicipality"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class StructuredOtherDeliveryInformation(_FlexibleModel):
|
|
67
|
+
delivery_service_type: Optional[str] = Field(
|
|
68
|
+
default=None, alias="DeliveryServiceType"
|
|
69
|
+
)
|
|
70
|
+
delivery_service_indicator: Optional[str] = Field(
|
|
71
|
+
default=None, alias="DeliveryServiceIndicator"
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class OtherDeliveryInformation(_FlexibleModel):
|
|
76
|
+
unstructured_other_delivery_information: Optional[str] = Field(
|
|
77
|
+
default=None, alias="UnstructuredOtherDeliveryInformation"
|
|
78
|
+
)
|
|
79
|
+
structured_other_delivery_information: Optional[StructuredOtherDeliveryInformation] = Field(
|
|
80
|
+
default=None, alias="StructuredOtherDeliveryInformation"
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class PostalAddress(_FlexibleModel):
|
|
85
|
+
# Request-style nested groups
|
|
86
|
+
delivery_point_location: Optional[DeliveryPointLocation] = Field(
|
|
87
|
+
default=None, alias="DeliveryPointLocation"
|
|
88
|
+
)
|
|
89
|
+
postal_code_municipality: Optional[PostalCodeMunicipality] = Field(
|
|
90
|
+
default=None, alias="PostalCodeMunicipality"
|
|
91
|
+
)
|
|
92
|
+
other_delivery_information: Optional[OtherDeliveryInformation] = Field(
|
|
93
|
+
default=None, alias="OtherDeliveryInformation"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Response-style direct structured fields (sometimes flattened)
|
|
97
|
+
country_name: Optional[str] = Field(default=None, alias="CountryName")
|
|
98
|
+
structured_delivery_point_location: Optional[StructuredDeliveryPointLocation] = Field(
|
|
99
|
+
default=None, alias="StructuredDeliveryPointLocation"
|
|
100
|
+
)
|
|
101
|
+
structured_postal_code_municipality: Optional[StructuredPostalCodeMunicipality] = Field(
|
|
102
|
+
default=None, alias="StructuredPostalCodeMunicipality"
|
|
103
|
+
)
|
|
104
|
+
structured_other_delivery_information: Optional[StructuredOtherDeliveryInformation] = Field(
|
|
105
|
+
default=None, alias="StructuredOtherDeliveryInformation"
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class AddressToValidate(_FlexibleModel):
|
|
110
|
+
id: Optional[str] = Field(default=None, alias="@id")
|
|
111
|
+
dispatching_country_iso_code: Optional[str] = Field(
|
|
112
|
+
default=None, alias="DispatchingCountryISOCode"
|
|
113
|
+
)
|
|
114
|
+
delivering_country_iso_code: Optional[str] = Field(
|
|
115
|
+
default=None, alias="DeliveringCountryISOCode"
|
|
116
|
+
)
|
|
117
|
+
address_block_lines: Optional[AddressBlockLines] = Field(
|
|
118
|
+
default=None, alias="AddressBlockLines"
|
|
119
|
+
)
|
|
120
|
+
postal_address: Optional[PostalAddress] = Field(default=None, alias="PostalAddress")
|
|
121
|
+
mailee_and_addressee: Optional[Dict[str, Any]] = Field(
|
|
122
|
+
default=None, alias="MaileeAndAddressee"
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class AddressToValidateList(_FlexibleModel):
|
|
127
|
+
address_to_validate: List[AddressToValidate] = Field(alias="AddressToValidate")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ValidateAddressOptions(_FlexibleModel):
|
|
131
|
+
include_submitted_address: Optional[bool] = Field(
|
|
132
|
+
default=None, alias="IncludeSubmittedAddress"
|
|
133
|
+
)
|
|
134
|
+
include_default_geo_location: Optional[bool] = Field(
|
|
135
|
+
default=None, alias="IncludeDefaultGeoLocation"
|
|
136
|
+
)
|
|
137
|
+
include_suggestions: Optional[bool] = Field(default=None, alias="IncludeSuggestions")
|
|
138
|
+
include_formatting: Optional[bool] = Field(default=None, alias="IncludeFormatting")
|
|
139
|
+
include_default_geo_location_for_boxes: Optional[bool] = Field(
|
|
140
|
+
default=None, alias="IncludeDefaultGeoLocationForBoxes"
|
|
141
|
+
)
|
|
142
|
+
include_suffix_list: Optional[bool] = Field(default=None, alias="IncludeSuffixList")
|
|
143
|
+
include_number_of_boxes: Optional[bool] = Field(
|
|
144
|
+
default=None, alias="IncludeNumberOfBoxes"
|
|
145
|
+
)
|
|
146
|
+
include_number_of_suffixes: Optional[bool] = Field(
|
|
147
|
+
default=None, alias="IncludeNumberOfSuffixes"
|
|
148
|
+
)
|
|
149
|
+
include_list_of_boxes: Optional[bool] = Field(
|
|
150
|
+
default=None, alias="IncludeListOfBoxes"
|
|
151
|
+
)
|
|
152
|
+
include_nis_code: Optional[bool] = Field(default=None, alias="IncludeNisCode")
|
|
153
|
+
include_nis_hierarchy: Optional[bool] = Field(
|
|
154
|
+
default=None, alias="IncludeNisHierarchy"
|
|
155
|
+
)
|
|
156
|
+
include_desired_address_language: Optional[str] = Field(
|
|
157
|
+
default=None, alias="IncludeDesiredAddressLanguage"
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class CallerIdentification(_FlexibleModel):
|
|
162
|
+
caller_name: Optional[str] = Field(default=None, alias="CallerName")
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class ValidateAddressesRequestContent(_FlexibleModel):
|
|
166
|
+
address_to_validate_list: AddressToValidateList = Field(
|
|
167
|
+
alias="AddressToValidateList"
|
|
168
|
+
)
|
|
169
|
+
validate_address_options: Optional[ValidateAddressOptions] = Field(
|
|
170
|
+
default=None, alias="ValidateAddressOptions"
|
|
171
|
+
)
|
|
172
|
+
caller_identification: Optional[CallerIdentification] = Field(
|
|
173
|
+
default=None, alias="CallerIdentification"
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class ValidateAddressesRequest(_FlexibleModel):
|
|
178
|
+
"""Top-level request body wrapper required by the API."""
|
|
179
|
+
|
|
180
|
+
validate_addresses_request: ValidateAddressesRequestContent = Field(
|
|
181
|
+
alias="ValidateAddressesRequest"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
# Response models (kept flexible, but with helpful typed anchors)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class ValidatedAddress(_FlexibleModel):
|
|
189
|
+
postal_address: Optional[PostalAddress] = Field(default=None, alias="PostalAddress")
|
|
190
|
+
address_language: Optional[str] = Field(default=None, alias="AddressLanguage")
|
|
191
|
+
score: Optional[str] = Field(default=None, alias="Score")
|
|
192
|
+
number_of_suffix: Optional[str] = Field(default=None, alias="NumberOfSuffix")
|
|
193
|
+
number_of_boxes: Optional[str] = Field(default=None, alias="NumberOfBoxes")
|
|
194
|
+
label: Optional[Dict[str, Any]] = Field(default=None, alias="Label")
|
|
195
|
+
service_point_box_list: Optional[Dict[str, Any]] = Field(
|
|
196
|
+
default=None, alias="ServicePointBoxList"
|
|
197
|
+
)
|
|
198
|
+
service_point_detail: Optional[Dict[str, Any]] = Field(
|
|
199
|
+
default=None, alias="ServicePointDetail"
|
|
200
|
+
)
|
|
201
|
+
nis_code: Optional[Dict[str, Any]] = Field(default=None, alias="NisCode")
|
|
202
|
+
nis_hierarchy: Optional[Dict[str, Any]] = Field(default=None, alias="NisHierarchy")
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class ValidatedAddressList(_FlexibleModel):
|
|
206
|
+
validated_address: List[ValidatedAddress] = Field(
|
|
207
|
+
default_factory=list, alias="ValidatedAddress"
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class ValidatedAddressResult(_FlexibleModel):
|
|
212
|
+
validated_address_list: Optional[ValidatedAddressList] = Field(
|
|
213
|
+
default=None, alias="ValidatedAddressList"
|
|
214
|
+
)
|
|
215
|
+
mailee_and_addressee: Optional[Dict[str, Any]] = Field(
|
|
216
|
+
default=None, alias="MaileeAndAddressee"
|
|
217
|
+
)
|
|
218
|
+
id: Optional[str] = Field(default=None, alias="@id")
|
|
219
|
+
# Backward-compatible raw blocks (if API returns singletons)
|
|
220
|
+
error: Optional[Dict[str, Any]] = Field(default=None, alias="Error")
|
|
221
|
+
warning: Optional[Dict[str, Any]] = Field(default=None, alias="Warning")
|
|
222
|
+
detected_input_address_language: Optional[str] = Field(
|
|
223
|
+
default=None, alias="DetectedInputAddressLanguage"
|
|
224
|
+
)
|
|
225
|
+
transaction_id: Optional[str] = Field(default=None, alias="TransactionID")
|
|
226
|
+
# Preferred structured lists when present
|
|
227
|
+
error_list: Optional["ValidationErrorList"] = Field(
|
|
228
|
+
default=None, alias="ErrorList"
|
|
229
|
+
)
|
|
230
|
+
warning_list: Optional["ValidationWarningList"] = Field(
|
|
231
|
+
default=None, alias="WarningList"
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
# ----
|
|
236
|
+
# Validation messages (Errors and Warnings)
|
|
237
|
+
# The official manual indicates both functional warnings and errors are returned
|
|
238
|
+
# and tied to impacted components. Because the exact upstream field names can
|
|
239
|
+
# vary, we keep models flexible while providing helpful, typed anchors.
|
|
240
|
+
# ----
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class ValidationMessageBase(_FlexibleModel):
|
|
244
|
+
# Common, frequently observed fields in validation message payloads
|
|
245
|
+
code: Optional[str] = Field(default=None, alias="Code")
|
|
246
|
+
severity: Optional[str] = Field(default=None, alias="Severity")
|
|
247
|
+
impacted_component: Optional[str] = Field(default=None, alias="ImpactedComponent")
|
|
248
|
+
message: Optional[str] = Field(default=None, alias="Message")
|
|
249
|
+
description: Optional[str] = Field(default=None, alias="Description")
|
|
250
|
+
phase: Optional[str] = Field(default=None, alias="Phase")
|
|
251
|
+
level: Optional[str] = Field(default=None, alias="Level")
|
|
252
|
+
details: Optional[Dict[str, Any]] = Field(default=None, alias="Details")
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class ValidationErrorItem(ValidationMessageBase):
|
|
256
|
+
pass
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class ValidationWarningItem(ValidationMessageBase):
|
|
260
|
+
pass
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class ValidationErrorList(_FlexibleModel):
|
|
264
|
+
error: List[ValidationErrorItem] = Field(default_factory=list, alias="Error")
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class ValidationWarningList(_FlexibleModel):
|
|
268
|
+
warning: List[ValidationWarningItem] = Field(default_factory=list, alias="Warning")
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
# Rebuild to resolve forward refs for Pydantic v2
|
|
272
|
+
ValidatedAddressResult.model_rebuild()
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
class ValidatedAddressResultList(_FlexibleModel):
|
|
276
|
+
validated_address_result: List[ValidatedAddressResult] = Field(
|
|
277
|
+
default_factory=list, alias="ValidatedAddressResult"
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
class ValidateAddressesResponseContent(_FlexibleModel):
|
|
282
|
+
validated_address_result_list: Optional[ValidatedAddressResultList] = Field(
|
|
283
|
+
default=None, alias="ValidatedAddressResultList"
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class ValidateAddressesResponse(_FlexibleModel):
|
|
288
|
+
"""Top-level response body wrapper returned by the API."""
|
|
289
|
+
|
|
290
|
+
validate_addresses_response: Optional[ValidateAddressesResponseContent] = Field(
|
|
291
|
+
default=None, alias="ValidateAddressesResponse"
|
|
292
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "bpost-address-validator"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Python wrapper for bpost External Mailing Address Proofing API with pydantic models and httpx sync/async clients."
|
|
5
|
+
requires-python = ">=3.12"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"httpx>=0.27.0",
|
|
8
|
+
"pydantic>=2.7.0",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["hatchling>=1.27"]
|
|
13
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
version = 1
|
|
2
|
+
revision = 3
|
|
3
|
+
requires-python = ">=3.12"
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "annotated-types"
|
|
7
|
+
version = "0.7.0"
|
|
8
|
+
source = { registry = "https://pypi.org/simple" }
|
|
9
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }
|
|
10
|
+
wheels = [
|
|
11
|
+
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "anyio"
|
|
16
|
+
version = "4.12.0"
|
|
17
|
+
source = { registry = "https://pypi.org/simple" }
|
|
18
|
+
dependencies = [
|
|
19
|
+
{ name = "idna" },
|
|
20
|
+
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
|
21
|
+
]
|
|
22
|
+
sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" }
|
|
23
|
+
wheels = [
|
|
24
|
+
{ url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[[package]]
|
|
28
|
+
name = "bpost-address-validator"
|
|
29
|
+
version = "0.1.0"
|
|
30
|
+
source = { editable = "." }
|
|
31
|
+
dependencies = [
|
|
32
|
+
{ name = "httpx" },
|
|
33
|
+
{ name = "pydantic" },
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[package.metadata]
|
|
37
|
+
requires-dist = [
|
|
38
|
+
{ name = "httpx", specifier = ">=0.27.0" },
|
|
39
|
+
{ name = "pydantic", specifier = ">=2.7.0" },
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "certifi"
|
|
44
|
+
version = "2025.11.12"
|
|
45
|
+
source = { registry = "https://pypi.org/simple" }
|
|
46
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" }
|
|
47
|
+
wheels = [
|
|
48
|
+
{ url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" },
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[[package]]
|
|
52
|
+
name = "h11"
|
|
53
|
+
version = "0.16.0"
|
|
54
|
+
source = { registry = "https://pypi.org/simple" }
|
|
55
|
+
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
|
|
56
|
+
wheels = [
|
|
57
|
+
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[[package]]
|
|
61
|
+
name = "httpcore"
|
|
62
|
+
version = "1.0.9"
|
|
63
|
+
source = { registry = "https://pypi.org/simple" }
|
|
64
|
+
dependencies = [
|
|
65
|
+
{ name = "certifi" },
|
|
66
|
+
{ name = "h11" },
|
|
67
|
+
]
|
|
68
|
+
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
|
|
69
|
+
wheels = [
|
|
70
|
+
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "httpx"
|
|
75
|
+
version = "0.28.1"
|
|
76
|
+
source = { registry = "https://pypi.org/simple" }
|
|
77
|
+
dependencies = [
|
|
78
|
+
{ name = "anyio" },
|
|
79
|
+
{ name = "certifi" },
|
|
80
|
+
{ name = "httpcore" },
|
|
81
|
+
{ name = "idna" },
|
|
82
|
+
]
|
|
83
|
+
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
|
|
84
|
+
wheels = [
|
|
85
|
+
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[[package]]
|
|
89
|
+
name = "idna"
|
|
90
|
+
version = "3.11"
|
|
91
|
+
source = { registry = "https://pypi.org/simple" }
|
|
92
|
+
sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" }
|
|
93
|
+
wheels = [
|
|
94
|
+
{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "pydantic"
|
|
99
|
+
version = "2.12.5"
|
|
100
|
+
source = { registry = "https://pypi.org/simple" }
|
|
101
|
+
dependencies = [
|
|
102
|
+
{ name = "annotated-types" },
|
|
103
|
+
{ name = "pydantic-core" },
|
|
104
|
+
{ name = "typing-extensions" },
|
|
105
|
+
{ name = "typing-inspection" },
|
|
106
|
+
]
|
|
107
|
+
sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" }
|
|
108
|
+
wheels = [
|
|
109
|
+
{ url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" },
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
[[package]]
|
|
113
|
+
name = "pydantic-core"
|
|
114
|
+
version = "2.41.5"
|
|
115
|
+
source = { registry = "https://pypi.org/simple" }
|
|
116
|
+
dependencies = [
|
|
117
|
+
{ name = "typing-extensions" },
|
|
118
|
+
]
|
|
119
|
+
sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" }
|
|
120
|
+
wheels = [
|
|
121
|
+
{ url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" },
|
|
122
|
+
{ url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" },
|
|
123
|
+
{ url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" },
|
|
124
|
+
{ url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" },
|
|
125
|
+
{ url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" },
|
|
126
|
+
{ url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" },
|
|
127
|
+
{ url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" },
|
|
128
|
+
{ url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" },
|
|
129
|
+
{ url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" },
|
|
130
|
+
{ url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" },
|
|
131
|
+
{ url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" },
|
|
132
|
+
{ url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" },
|
|
133
|
+
{ url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" },
|
|
134
|
+
{ url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" },
|
|
135
|
+
{ url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" },
|
|
136
|
+
{ url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" },
|
|
137
|
+
{ url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" },
|
|
138
|
+
{ url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" },
|
|
139
|
+
{ url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" },
|
|
140
|
+
{ url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" },
|
|
141
|
+
{ url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" },
|
|
142
|
+
{ url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" },
|
|
143
|
+
{ url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" },
|
|
144
|
+
{ url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" },
|
|
145
|
+
{ url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" },
|
|
146
|
+
{ url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" },
|
|
147
|
+
{ url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" },
|
|
148
|
+
{ url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" },
|
|
149
|
+
{ url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" },
|
|
150
|
+
{ url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" },
|
|
151
|
+
{ url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" },
|
|
152
|
+
{ url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" },
|
|
153
|
+
{ url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" },
|
|
154
|
+
{ url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" },
|
|
155
|
+
{ url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" },
|
|
156
|
+
{ url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" },
|
|
157
|
+
{ url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" },
|
|
158
|
+
{ url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" },
|
|
159
|
+
{ url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" },
|
|
160
|
+
{ url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" },
|
|
161
|
+
{ url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" },
|
|
162
|
+
{ url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" },
|
|
163
|
+
{ url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" },
|
|
164
|
+
{ url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" },
|
|
165
|
+
{ url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" },
|
|
166
|
+
{ url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" },
|
|
167
|
+
{ url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" },
|
|
168
|
+
{ url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" },
|
|
169
|
+
{ url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" },
|
|
170
|
+
{ url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" },
|
|
171
|
+
{ url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" },
|
|
172
|
+
{ url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" },
|
|
173
|
+
{ url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" },
|
|
174
|
+
{ url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" },
|
|
175
|
+
{ url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" },
|
|
176
|
+
{ url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" },
|
|
177
|
+
{ url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" },
|
|
178
|
+
{ url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" },
|
|
179
|
+
{ url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" },
|
|
180
|
+
{ url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" },
|
|
181
|
+
]
|
|
182
|
+
|
|
183
|
+
[[package]]
|
|
184
|
+
name = "typing-extensions"
|
|
185
|
+
version = "4.15.0"
|
|
186
|
+
source = { registry = "https://pypi.org/simple" }
|
|
187
|
+
sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
|
|
188
|
+
wheels = [
|
|
189
|
+
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
|
190
|
+
]
|
|
191
|
+
|
|
192
|
+
[[package]]
|
|
193
|
+
name = "typing-inspection"
|
|
194
|
+
version = "0.4.2"
|
|
195
|
+
source = { registry = "https://pypi.org/simple" }
|
|
196
|
+
dependencies = [
|
|
197
|
+
{ name = "typing-extensions" },
|
|
198
|
+
]
|
|
199
|
+
sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" }
|
|
200
|
+
wheels = [
|
|
201
|
+
{ url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" },
|
|
202
|
+
]
|