parseapi 0.2.1__tar.gz → 0.3.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.
- {parseapi-0.2.1 → parseapi-0.3.2}/.github/workflows/publish.yml +2 -1
- parseapi-0.3.2/.github/workflows/test.yml +21 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/LICENSE +1 -1
- {parseapi-0.2.1 → parseapi-0.3.2}/PKG-INFO +28 -10
- {parseapi-0.2.1 → parseapi-0.3.2}/README.md +25 -7
- parseapi-0.3.2/api/public.json +2050 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/pyproject.toml +3 -3
- parseapi-0.3.2/scripts/public_api.py +62 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/smoke/smoke.py +10 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/src/parseapi/__init__.py +2 -2
- {parseapi-0.2.1 → parseapi-0.3.2}/src/parseapi/_client.py +134 -28
- parseapi-0.3.2/src/parseapi/py.typed +0 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/tests/test_client.py +134 -0
- parseapi-0.3.2/tests/test_public_api.py +11 -0
- {parseapi-0.2.1 → parseapi-0.3.2}/.gitignore +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: SDK checks
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
python: ['3.9', '3.13']
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: ${{ matrix.python }}
|
|
16
|
+
- run: python -m pip install -e . pytest build
|
|
17
|
+
- run: python -m pytest -q
|
|
18
|
+
- run: python scripts/public_api.py
|
|
19
|
+
- run: python -m build
|
|
20
|
+
- name: Verify wheel typing marker
|
|
21
|
+
run: python -c "import glob,zipfile; z=zipfile.ZipFile(glob.glob('dist/*.whl')[0]); assert 'parseapi/py.typed' in z.namelist()"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: parseapi
|
|
3
|
-
Version: 0.2
|
|
4
|
-
Summary: Official
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Official ParseAPI client for Python. One key, minimal JSON, fast.
|
|
5
5
|
Project-URL: Homepage, https://parseapi.com
|
|
6
6
|
Project-URL: Documentation, https://parseapi.com/docs
|
|
7
7
|
Project-URL: Repository, https://github.com/parseapi/python
|
|
8
|
-
Author-email:
|
|
8
|
+
Author-email: ParseAPI <hello@parseapi.com>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Keywords: currency,email validation,geolocation,ip,parseapi,phone validation,postal,timezone,weather
|
|
@@ -19,7 +19,7 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
|
|
20
20
|
# parseapi
|
|
21
21
|
|
|
22
|
-
Official
|
|
22
|
+
Official ParseAPI client for Python.
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
pip install parseapi
|
|
@@ -53,6 +53,9 @@ parse.postal("SW1A 1AA")
|
|
|
53
53
|
parse.postal("28202", country="US")
|
|
54
54
|
parse.postal.nearby("28202", country="US", radius=40)
|
|
55
55
|
parse.postal.distance("28202", "10001", country="US")
|
|
56
|
+
parse.address("1600 Pennsylvania Ave NW, Washington DC", country="US")
|
|
57
|
+
parse.address.search("1600 Pennsylvania", country="US", postal="20500")
|
|
58
|
+
parse.company("51 824 753 556", country="AU")
|
|
56
59
|
parse.city("charlotte", country="US")
|
|
57
60
|
parse.city.id("city_mb8mbqrkz8zb")
|
|
58
61
|
parse.city.search("char", country="US", limit=10)
|
|
@@ -66,35 +69,45 @@ parse.state.districts("NC", country="US")
|
|
|
66
69
|
parse.district("37081")
|
|
67
70
|
parse.continent("NA")
|
|
68
71
|
parse.continent.countries("NA")
|
|
72
|
+
parse.bloc("EU")
|
|
73
|
+
parse.bloc.countries("EU")
|
|
69
74
|
parse.currency("USD")
|
|
70
75
|
parse.currency.rate("USD", "EUR")
|
|
71
76
|
parse.language("en")
|
|
72
77
|
parse.name("BILLY OSHALL")
|
|
73
78
|
parse.timezone("America/New_York")
|
|
79
|
+
parse.timezone("America/New_York", at="2026-09-05T15:00:00", to="Europe/London")
|
|
80
|
+
parse.timezone.at(39.77, -104.9)
|
|
81
|
+
parse.date("03/04/2026", format="mdy")
|
|
82
|
+
parse.date.today()
|
|
74
83
|
parse.holiday("US", year=2026)
|
|
75
84
|
parse.holiday.date("US", "2026-12-25")
|
|
76
85
|
parse.elevation(35.2271, -80.8431)
|
|
77
86
|
parse.point(36.0726, -79.792)
|
|
78
87
|
parse.weather(40.7128, -74.006)
|
|
79
88
|
parse.domain("example.com")
|
|
89
|
+
parse.asn("AS13335")
|
|
90
|
+
parse.mac("00:1B:63:84:45:E6")
|
|
80
91
|
parse.mx("example.com")
|
|
81
92
|
parse.useragent(ua_string)
|
|
82
93
|
parse.vin("1HGCM82633A004352")
|
|
94
|
+
parse.tariff("8471.30.01.00")
|
|
95
|
+
parse.tariff.search("sunglasses")
|
|
83
96
|
parse.emoji("rocket")
|
|
84
97
|
parse.emoji.search("fire")
|
|
85
98
|
```
|
|
86
99
|
|
|
87
|
-
Responses are plain dicts, exactly the JSON the API returns.
|
|
100
|
+
Responses are plain dicts, exactly the JSON the API returns. `country.states("US")` requests states directly; it does not fetch a country first. Required inputs are positional and optional behavior uses keyword arguments, leaving room for new options without changing existing calls. Reuse a client across calls. Use `with ParseAPI(...) as parse:` or call `parse.close()` when finished.
|
|
88
101
|
|
|
89
102
|
## Async
|
|
90
103
|
|
|
91
|
-
Same
|
|
104
|
+
Same lookup methods and keyword arguments, with `await`. Use a context manager to close the client when the work is done.
|
|
92
105
|
|
|
93
106
|
```python
|
|
94
107
|
from parseapi import AsyncParseAPI
|
|
95
108
|
|
|
96
|
-
|
|
97
|
-
country = await parse.country("US")
|
|
109
|
+
async with AsyncParseAPI("your-api-key") as parse:
|
|
110
|
+
country = await parse.country("US")
|
|
98
111
|
```
|
|
99
112
|
|
|
100
113
|
## Deep
|
|
@@ -120,18 +133,23 @@ except ParseAPIError as err:
|
|
|
120
133
|
... # no such city
|
|
121
134
|
```
|
|
122
135
|
|
|
136
|
+
Network and decoding failures keep their native error types. Responses such as `valid: false` are successful API answers, not exceptions.
|
|
137
|
+
|
|
123
138
|
## Options
|
|
124
139
|
|
|
125
140
|
```python
|
|
126
141
|
parse = ParseAPI(
|
|
127
142
|
"your-api-key",
|
|
128
|
-
timeout=10.0, #
|
|
129
|
-
retries=2, # automatic retries on network errors, 429, and 5xx
|
|
143
|
+
timeout=10.0, # timeout for each connect, read, write, or pool phase
|
|
130
144
|
)
|
|
131
145
|
```
|
|
132
146
|
|
|
133
147
|
Requires Python 3.9 or later. One dependency (httpx).
|
|
134
148
|
|
|
149
|
+
Ordinary lookups retry network failures, 429, and 500/502/503/504 responses twice by default. Carrier, caller, HLR, and email or VAT with `deep=True` make one attempt by default. Address with `deep=True` also uses one attempt, reserving the same behavior for future verification.
|
|
150
|
+
|
|
151
|
+
An explicit client `retries` setting overrides those defaults; `retries=0` always makes one attempt. Another attempt can consume additional usage if the earlier response was lost. Cancelling an async task stops the call and any retry wait. Automatic redirects are disabled.
|
|
152
|
+
|
|
135
153
|
## Docs
|
|
136
154
|
|
|
137
155
|
Full field reference for every endpoint: [parseapi.com/docs](https://parseapi.com/docs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# parseapi
|
|
2
2
|
|
|
3
|
-
Official
|
|
3
|
+
Official ParseAPI client for Python.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
pip install parseapi
|
|
@@ -34,6 +34,9 @@ parse.postal("SW1A 1AA")
|
|
|
34
34
|
parse.postal("28202", country="US")
|
|
35
35
|
parse.postal.nearby("28202", country="US", radius=40)
|
|
36
36
|
parse.postal.distance("28202", "10001", country="US")
|
|
37
|
+
parse.address("1600 Pennsylvania Ave NW, Washington DC", country="US")
|
|
38
|
+
parse.address.search("1600 Pennsylvania", country="US", postal="20500")
|
|
39
|
+
parse.company("51 824 753 556", country="AU")
|
|
37
40
|
parse.city("charlotte", country="US")
|
|
38
41
|
parse.city.id("city_mb8mbqrkz8zb")
|
|
39
42
|
parse.city.search("char", country="US", limit=10)
|
|
@@ -47,35 +50,45 @@ parse.state.districts("NC", country="US")
|
|
|
47
50
|
parse.district("37081")
|
|
48
51
|
parse.continent("NA")
|
|
49
52
|
parse.continent.countries("NA")
|
|
53
|
+
parse.bloc("EU")
|
|
54
|
+
parse.bloc.countries("EU")
|
|
50
55
|
parse.currency("USD")
|
|
51
56
|
parse.currency.rate("USD", "EUR")
|
|
52
57
|
parse.language("en")
|
|
53
58
|
parse.name("BILLY OSHALL")
|
|
54
59
|
parse.timezone("America/New_York")
|
|
60
|
+
parse.timezone("America/New_York", at="2026-09-05T15:00:00", to="Europe/London")
|
|
61
|
+
parse.timezone.at(39.77, -104.9)
|
|
62
|
+
parse.date("03/04/2026", format="mdy")
|
|
63
|
+
parse.date.today()
|
|
55
64
|
parse.holiday("US", year=2026)
|
|
56
65
|
parse.holiday.date("US", "2026-12-25")
|
|
57
66
|
parse.elevation(35.2271, -80.8431)
|
|
58
67
|
parse.point(36.0726, -79.792)
|
|
59
68
|
parse.weather(40.7128, -74.006)
|
|
60
69
|
parse.domain("example.com")
|
|
70
|
+
parse.asn("AS13335")
|
|
71
|
+
parse.mac("00:1B:63:84:45:E6")
|
|
61
72
|
parse.mx("example.com")
|
|
62
73
|
parse.useragent(ua_string)
|
|
63
74
|
parse.vin("1HGCM82633A004352")
|
|
75
|
+
parse.tariff("8471.30.01.00")
|
|
76
|
+
parse.tariff.search("sunglasses")
|
|
64
77
|
parse.emoji("rocket")
|
|
65
78
|
parse.emoji.search("fire")
|
|
66
79
|
```
|
|
67
80
|
|
|
68
|
-
Responses are plain dicts, exactly the JSON the API returns.
|
|
81
|
+
Responses are plain dicts, exactly the JSON the API returns. `country.states("US")` requests states directly; it does not fetch a country first. Required inputs are positional and optional behavior uses keyword arguments, leaving room for new options without changing existing calls. Reuse a client across calls. Use `with ParseAPI(...) as parse:` or call `parse.close()` when finished.
|
|
69
82
|
|
|
70
83
|
## Async
|
|
71
84
|
|
|
72
|
-
Same
|
|
85
|
+
Same lookup methods and keyword arguments, with `await`. Use a context manager to close the client when the work is done.
|
|
73
86
|
|
|
74
87
|
```python
|
|
75
88
|
from parseapi import AsyncParseAPI
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
country = await parse.country("US")
|
|
90
|
+
async with AsyncParseAPI("your-api-key") as parse:
|
|
91
|
+
country = await parse.country("US")
|
|
79
92
|
```
|
|
80
93
|
|
|
81
94
|
## Deep
|
|
@@ -101,18 +114,23 @@ except ParseAPIError as err:
|
|
|
101
114
|
... # no such city
|
|
102
115
|
```
|
|
103
116
|
|
|
117
|
+
Network and decoding failures keep their native error types. Responses such as `valid: false` are successful API answers, not exceptions.
|
|
118
|
+
|
|
104
119
|
## Options
|
|
105
120
|
|
|
106
121
|
```python
|
|
107
122
|
parse = ParseAPI(
|
|
108
123
|
"your-api-key",
|
|
109
|
-
timeout=10.0, #
|
|
110
|
-
retries=2, # automatic retries on network errors, 429, and 5xx
|
|
124
|
+
timeout=10.0, # timeout for each connect, read, write, or pool phase
|
|
111
125
|
)
|
|
112
126
|
```
|
|
113
127
|
|
|
114
128
|
Requires Python 3.9 or later. One dependency (httpx).
|
|
115
129
|
|
|
130
|
+
Ordinary lookups retry network failures, 429, and 500/502/503/504 responses twice by default. Carrier, caller, HLR, and email or VAT with `deep=True` make one attempt by default. Address with `deep=True` also uses one attempt, reserving the same behavior for future verification.
|
|
131
|
+
|
|
132
|
+
An explicit client `retries` setting overrides those defaults; `retries=0` always makes one attempt. Another attempt can consume additional usage if the earlier response was lost. Cancelling an async task stops the call and any retry wait. Automatic redirects are disabled.
|
|
133
|
+
|
|
116
134
|
## Docs
|
|
117
135
|
|
|
118
136
|
Full field reference for every endpoint: [parseapi.com/docs](https://parseapi.com/docs)
|