encarapi 1.2.0__tar.gz → 1.3.0__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.
- {encarapi-1.2.0 → encarapi-1.3.0}/CHANGELOG.md +9 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/PKG-INFO +10 -1
- {encarapi-1.2.0 → encarapi-1.3.0}/README.md +9 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/encarapi/__init__.py +1 -1
- {encarapi-1.2.0 → encarapi-1.3.0}/encarapi/client.py +38 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/pyproject.toml +1 -1
- {encarapi-1.2.0 → encarapi-1.3.0}/.gitignore +0 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/LICENSE +0 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/examples/quickstart.py +0 -0
- {encarapi-1.2.0 → encarapi-1.3.0}/tests/test_offline.py +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
- Trucks, buses and special vehicles (Encar Truck, Business/Scale): `korea.trucks(**params)`,
|
|
6
|
+
`korea.truck_enums()`, `korea.trucks_csv()`, `korea.iterate_trucks_by_id(**params)`.
|
|
7
|
+
- Used excavators (굴삭기나라, Business/Scale): `korea.equipment(**params)`, `korea.equipment_enums()`,
|
|
8
|
+
`korea.equipment_csv()`, `korea.iterate_equipment_by_id(**params)`.
|
|
9
|
+
- `korea.vehicle_by_vin(vin)`: every Encar / K Car listing of one VIN, active and removed (Business/Scale).
|
|
10
|
+
- The catalog `region` filter now also works with a single other source (`source="kbc"` or `"kcar"`).
|
|
11
|
+
|
|
3
12
|
## 1.2.0
|
|
4
13
|
|
|
5
14
|
- `korea.iterate_catalog_by_id(**params)` / `korea.iterate_leasing_by_id(**params)`: complete,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: encarapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Official Python client for EnCarAPI: Korean used car data (Encar, KB Chachacha, K Car) and Chinese used car data (Dongchedi, Che168) in one REST API.
|
|
5
5
|
Project-URL: Homepage, https://encarapi.com/?utm_source=pypi&utm_medium=encarapi-python
|
|
6
6
|
Project-URL: Documentation, https://encarapi.com/documentation?utm_source=pypi&utm_medium=encarapi-python
|
|
@@ -104,6 +104,15 @@ save_cursor(client.china.last_cursor)
|
|
|
104
104
|
| `iterate_catalog_by_id(**params)` | `GET /api/catalog?sort=id` | Complete, stable traversal (keyset cursor, nothing repeated or skipped) |
|
|
105
105
|
| `leasing(**params)` | `GET /api/catalog/leasing` | Lease takeovers and rentals |
|
|
106
106
|
| `iterate_leasing_by_id(**params)` | `GET /api/catalog/leasing?sort=id` | Complete, stable traversal of lease/rental listings |
|
|
107
|
+
| `vehicle_by_vin(vin)` | `GET /api/vehicle/by-vin/{vin}` | All listings of one VIN incl. removed ones (Business/Scale) |
|
|
108
|
+
| `trucks(**params)` | `GET /api/catalog/trucks` | Trucks, buses and special vehicles (Business/Scale) |
|
|
109
|
+
| `truck_enums()` | `GET /api/catalog/trucks/enums` | Truck filter values with counts |
|
|
110
|
+
| `trucks_csv()` | `GET /api/catalog/trucks/export` | Full truck inventory CSV (Business/Scale) |
|
|
111
|
+
| `iterate_trucks_by_id(**params)` | `GET /api/catalog/trucks?sort=id` | Complete, stable traversal of the truck catalog |
|
|
112
|
+
| `equipment(**params)` | `GET /api/catalog/equipment` | Used excavators (Business/Scale) |
|
|
113
|
+
| `equipment_enums()` | `GET /api/catalog/equipment/enums` | Equipment filter values with counts |
|
|
114
|
+
| `equipment_csv()` | `GET /api/catalog/equipment/export` | Full equipment inventory CSV (Business/Scale) |
|
|
115
|
+
| `iterate_equipment_by_id(**params)` | `GET /api/catalog/equipment?sort=id` | Complete, stable traversal of the equipment catalog |
|
|
107
116
|
| `nav(**params)` | `GET /api/nav` | Filter facets with counts |
|
|
108
117
|
| `enums(**params)` | `GET /api/enums` | Valid values for the flat filters |
|
|
109
118
|
| `model_search(search, **params)` | `GET /api/model-search` | Model autocomplete |
|
|
@@ -83,6 +83,15 @@ save_cursor(client.china.last_cursor)
|
|
|
83
83
|
| `iterate_catalog_by_id(**params)` | `GET /api/catalog?sort=id` | Complete, stable traversal (keyset cursor, nothing repeated or skipped) |
|
|
84
84
|
| `leasing(**params)` | `GET /api/catalog/leasing` | Lease takeovers and rentals |
|
|
85
85
|
| `iterate_leasing_by_id(**params)` | `GET /api/catalog/leasing?sort=id` | Complete, stable traversal of lease/rental listings |
|
|
86
|
+
| `vehicle_by_vin(vin)` | `GET /api/vehicle/by-vin/{vin}` | All listings of one VIN incl. removed ones (Business/Scale) |
|
|
87
|
+
| `trucks(**params)` | `GET /api/catalog/trucks` | Trucks, buses and special vehicles (Business/Scale) |
|
|
88
|
+
| `truck_enums()` | `GET /api/catalog/trucks/enums` | Truck filter values with counts |
|
|
89
|
+
| `trucks_csv()` | `GET /api/catalog/trucks/export` | Full truck inventory CSV (Business/Scale) |
|
|
90
|
+
| `iterate_trucks_by_id(**params)` | `GET /api/catalog/trucks?sort=id` | Complete, stable traversal of the truck catalog |
|
|
91
|
+
| `equipment(**params)` | `GET /api/catalog/equipment` | Used excavators (Business/Scale) |
|
|
92
|
+
| `equipment_enums()` | `GET /api/catalog/equipment/enums` | Equipment filter values with counts |
|
|
93
|
+
| `equipment_csv()` | `GET /api/catalog/equipment/export` | Full equipment inventory CSV (Business/Scale) |
|
|
94
|
+
| `iterate_equipment_by_id(**params)` | `GET /api/catalog/equipment?sort=id` | Complete, stable traversal of the equipment catalog |
|
|
86
95
|
| `nav(**params)` | `GET /api/nav` | Filter facets with counts |
|
|
87
96
|
| `enums(**params)` | `GET /api/enums` | Valid values for the flat filters |
|
|
88
97
|
| `model_search(search, **params)` | `GET /api/model-search` | Model autocomplete |
|
|
@@ -153,6 +153,44 @@ class KoreaClient:
|
|
|
153
153
|
"""Same as ``iterate_catalog_by_id`` for lease-takeover and rental listings."""
|
|
154
154
|
yield from self._iterate_by_id("/api/catalog/leasing", params)
|
|
155
155
|
|
|
156
|
+
def vehicle_by_vin(self, vin: str) -> Any:
|
|
157
|
+
"""Every Encar / K Car listing of one VIN, active and removed (Business/Scale)."""
|
|
158
|
+
return self._get(f"/api/vehicle/by-vin/{quote(str(vin), safe='')}", {})
|
|
159
|
+
|
|
160
|
+
# -- trucks, buses, special vehicles (Business/Scale) -------------------
|
|
161
|
+
def trucks(self, **params: Any) -> Any:
|
|
162
|
+
"""Encar trucks & buses, e.g. ``trucks(form="cargo", max_tons=1, lang="en")``. Values from ``truck_enums()``."""
|
|
163
|
+
return self._get("/api/catalog/trucks", params)
|
|
164
|
+
|
|
165
|
+
def truck_enums(self) -> Any:
|
|
166
|
+
"""Valid truck filter values with counts."""
|
|
167
|
+
return self._get("/api/catalog/trucks/enums", {})
|
|
168
|
+
|
|
169
|
+
def trucks_csv(self, **params: Any) -> str:
|
|
170
|
+
"""Full truck inventory as CSV text (Business/Scale)."""
|
|
171
|
+
return self._get("/api/catalog/trucks/export", params, text=True)
|
|
172
|
+
|
|
173
|
+
def iterate_trucks_by_id(self, **params: Any) -> Iterator[Dict[str, Any]]:
|
|
174
|
+
"""Complete, stable traversal of the truck catalog (``sort=id`` + ``after``)."""
|
|
175
|
+
yield from self._iterate_by_id("/api/catalog/trucks", params)
|
|
176
|
+
|
|
177
|
+
# -- construction equipment / excavators (Business/Scale) ---------------
|
|
178
|
+
def equipment(self, **params: Any) -> Any:
|
|
179
|
+
"""Used excavators from 굴삭기나라, e.g. ``equipment(sub_type="crawler", max_hours=5000)``."""
|
|
180
|
+
return self._get("/api/catalog/equipment", params)
|
|
181
|
+
|
|
182
|
+
def equipment_enums(self) -> Any:
|
|
183
|
+
"""Valid equipment filter values with counts."""
|
|
184
|
+
return self._get("/api/catalog/equipment/enums", {})
|
|
185
|
+
|
|
186
|
+
def equipment_csv(self, **params: Any) -> str:
|
|
187
|
+
"""Full equipment inventory as CSV text (Business/Scale)."""
|
|
188
|
+
return self._get("/api/catalog/equipment/export", params, text=True)
|
|
189
|
+
|
|
190
|
+
def iterate_equipment_by_id(self, **params: Any) -> Iterator[Dict[str, Any]]:
|
|
191
|
+
"""Complete, stable traversal of the equipment catalog (``sort=id`` + ``after``)."""
|
|
192
|
+
yield from self._iterate_by_id("/api/catalog/equipment", params)
|
|
193
|
+
|
|
156
194
|
def _iterate_by_id(self, path: str, params: Dict[str, Any]) -> Iterator[Dict[str, Any]]:
|
|
157
195
|
params = dict(params)
|
|
158
196
|
params.pop("page", None)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "encarapi"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.3.0"
|
|
8
8
|
description = "Official Python client for EnCarAPI: Korean used car data (Encar, KB Chachacha, K Car) and Chinese used car data (Dongchedi, Che168) in one REST API."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|