autouncle-scraper 0.1.0__py3-none-any.whl

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,203 @@
1
+ Metadata-Version: 2.4
2
+ Name: autouncle-scraper
3
+ Version: 0.1.0
4
+ Summary: Free, keyless scraper and library for autouncle.ch used-car listings. Unofficial, not affiliated with AutoUncle ApS.
5
+ Project-URL: Homepage, https://github.com/danyk20/autouncle-scraper
6
+ Project-URL: Repository, https://github.com/danyk20/autouncle-scraper
7
+ Project-URL: Issues, https://github.com/danyk20/autouncle-scraper/issues
8
+ Project-URL: Changelog, https://github.com/danyk20/autouncle-scraper/blob/master/CHANGELOG.md
9
+ Author-email: Daniel Košč <maintainer@danielkosc.eu>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: autouncle,cars,cli,scraper,switzerland,web-scraping
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.13
24
+ Requires-Dist: beautifulsoup4~=4.12
25
+ Requires-Dist: requests~=2.34
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy~=2.1; extra == 'dev'
28
+ Requires-Dist: pytest-cov~=7.1; extra == 'dev'
29
+ Requires-Dist: pytest~=9.1; extra == 'dev'
30
+ Requires-Dist: responses~=0.26; extra == 'dev'
31
+ Requires-Dist: ruff~=0.15; extra == 'dev'
32
+ Requires-Dist: types-beautifulsoup4~=4.12; extra == 'dev'
33
+ Requires-Dist: types-requests~=2.33; extra == 'dev'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # AutoUncle Scraper
37
+
38
+ [![CI](https://github.com/danyk20/autouncle-scraper/actions/workflows/ci.yml/badge.svg)](https://github.com/danyk20/autouncle-scraper/actions/workflows/ci.yml)
39
+ [![PyPI](https://img.shields.io/pypi/v/autouncle-scraper)](https://pypi.org/project/autouncle-scraper/)
40
+ [![Coverage](https://img.shields.io/badge/unit%20test%20coverage-100%25-brightgreen)](#testing)
41
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
42
+ [![Python 3.13](https://img.shields.io/badge/python-3.13-blue)](https://www.python.org/)
43
+
44
+ > Unofficial, independently developed project — not affiliated with, endorsed by, or sponsored by AutoUncle ApS. "AutoUncle" is a trademark of its respective owner.
45
+
46
+ Fetches every listing for a given brand/model from AutoUncle — for free, no
47
+ API key, no paid scraping service. It's a drop-in-compatible sibling of the
48
+ [AutoScout24 scraper](https://github.com/danyk20/autoscout24-scraper): same
49
+ `scrape()` call shape, same `ScrapeResult` return type, same CLI flags, same
50
+ MIT license and tooling — switch `from autoscout24_scraper import scrape` to
51
+ `from autouncle_scraper import scrape` and the rest of your code doesn't
52
+ need to change.
53
+
54
+ Under the hood the two projects work differently, because the two sites do:
55
+ AutoScout24 exposes one clean JSON API; AutoUncle is a Next.js site with no
56
+ such API, so this scraper reads the same structured data (schema.org
57
+ JSON-LD) and, for filtered searches, the same internal data mechanism
58
+ (GraphQL + React Server Components) AutoUncle's own frontend uses — all
59
+ reverse-engineered by observing real traffic, documented in full in the
60
+ module docstring and [docs/REFERENCE.md](docs/REFERENCE.md).
61
+
62
+ **A stronger legal footing than most scrapers.** AutoUncle's own detail
63
+ pages explicitly mark their listing data as a `Dataset` with
64
+ `"isAccessibleForFree": true`, licensed
65
+ [**CC BY 4.0**](https://creativecommons.org/licenses/by/4.0/). That's not
66
+ just "we call their own frontend's endpoint" reasoning (though that's true
67
+ too, same as AutoScout24) — it's AutoUncle's own explicit declaration that
68
+ this data is meant to be freely reused, with attribution.
69
+
70
+ **🤖 Robot-friendly.** This project is explicitly intended to be run, read,
71
+ imported, or adapted by AI agents and bots, same as a human developer — see
72
+ [License](#license).
73
+
74
+ ## Setup
75
+
76
+ Requires [pipenv](https://pipenv.pypa.io/) (`brew install pipenv`).
77
+
78
+ ```bash
79
+ git clone https://github.com/danyk20/autouncle-scraper.git
80
+ cd autouncle-scraper
81
+ pipenv install --dev
82
+ ```
83
+
84
+ Contributing, linting, and testing commands: see [CONTRIBUTING.md](CONTRIBUTING.md).
85
+
86
+ ## Usage
87
+
88
+ ### CLI
89
+
90
+ ```bash
91
+ pipenv run python autouncle_scraper.py --make VW --model Golf
92
+ ```
93
+
94
+ Prints progress, then writes `vw_golf.csv` and `vw_golf.json` in the current
95
+ directory. Installed via `pip install` instead? Drop `pipenv run` — the same
96
+ command is `autouncle-scraper --make VW --model Golf`.
97
+
98
+ | Flag | Description |
99
+ |---|---|
100
+ | `--version` | Print the installed version and exit |
101
+ | `--make` | Brand name, e.g. `VW` (required) |
102
+ | `--model` | Model name, e.g. `Golf` (required) |
103
+ | `--domain` | Country domain (default `ch`) — only `ch` is implemented today, see [docs/REFERENCE.md](docs/REFERENCE.md#domains) |
104
+ | `--category` | `car` (default) — the only category implemented |
105
+ | `--out` | Output file base name, without extension. Defaults to `<make>_<model>` |
106
+ | `--no-detail` | Skip per-listing detail visits (unfiltered searches only — see below) |
107
+ | `--delay` | Seconds between requests (default `0.4`) — raise this if you get rate-limited |
108
+ | `--price-from` / `--price-to` | Filter by price in CHF (inclusive, either end optional) |
109
+ | `--mileage-from` / `--mileage-to` | Filter by mileage in km (inclusive, either end optional) |
110
+ | `--year-from` / `--year-to` | Filter by first-registration year (inclusive, either end optional) |
111
+ | `-v` / `--verbose` | Also show debug-level detail, including every HTTP request (mutually exclusive with `-q`) |
112
+ | `-q` / `--quiet` | Suppress progress output; only warnings/errors (mutually exclusive with `-v`) |
113
+
114
+ Filters combine with AND and are applied server-side. A mistyped make/model
115
+ prints a clean error (plus, for an unknown model, the list of valid models)
116
+ instead of crashing.
117
+
118
+ ```bash
119
+ # Fast mode: search results only, skip per-listing detail
120
+ pipenv run python autouncle_scraper.py --make VW --model Golf --no-detail
121
+
122
+ # 2015 or newer, under CHF 30'000
123
+ pipenv run python autouncle_scraper.py --make VW --model "Golf VIII" --price-to 30000 --year-from 2015
124
+ ```
125
+
126
+ **One honest asymmetry vs. AutoScout24**: unfiltered searches use
127
+ schema.org JSON-LD, which is already fairly rich even without `--no-detail`.
128
+ Filtered searches use a different mechanism (see
129
+ [docs/REFERENCE.md](docs/REFERENCE.md)) that carries *only* listing ids —
130
+ so `--no-detail` on a filtered search gives you ids only, plus a logged
131
+ warning. Leave `--no-detail` off (the default) for anything beyond a bare
132
+ count.
133
+
134
+ ### As a library
135
+
136
+ ```bash
137
+ pip install autouncle-scraper
138
+ ```
139
+
140
+ ```python
141
+ from autouncle_scraper import scrape
142
+
143
+ result = scrape("VW", "Golf", price_to=30000, year_from=2015)
144
+
145
+ for row in result.rows: # list[dict], CSV-ready
146
+ print(row["price"], row["mileageKm"], row["url"])
147
+
148
+ result.to_csv("vw_golf.csv") # optional — no files are written unless you ask
149
+ ```
150
+
151
+ Full `scrape()` signature, the `ScrapeResult` return type, and the complete
152
+ JSON/CSV field schema — including price history, gallery, and equipment
153
+ fields AutoScout24 doesn't have — **[docs/REFERENCE.md](docs/REFERENCE.md)**.
154
+
155
+ ## Testing
156
+
157
+ ```bash
158
+ pipenv run pytest # unit tests (fast, no network), 100% coverage
159
+ pipenv run pytest -m e2e --no-cov # end-to-end tests against the real live site
160
+ pipenv run pytest -m "e2e or not e2e" --no-cov # everything
161
+ ```
162
+
163
+ Unit tests mock all HTTP (via [`responses`](https://github.com/getsentry/responses))
164
+ against fixtures that are real captures from the live site, and cover 100%
165
+ of `autouncle_scraper.py`. E2E tests target a narrow, low-volume model (VW
166
+ Golf Alltrack) to confirm the scraper still works against the live site
167
+ without putting real load on it. Coverage detail by area:
168
+ [docs/REFERENCE.md](docs/REFERENCE.md#test-coverage-by-area).
169
+
170
+ ## Contributing
171
+
172
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, pre-PR checks, and
173
+ what to do if AutoUncle changes its markup.
174
+
175
+ Be a reasonable citizen: the default request delay is intentional — this
176
+ scrapes an undocumented data mechanism the site's own frontend uses, not a
177
+ public API with a stated rate limit. Don't remove the delay or crank up
178
+ concurrency.
179
+
180
+ ## License
181
+
182
+ Released under the [MIT License](LICENSE) — you can use, copy, modify,
183
+ merge, publish, distribute, and sell copies of this code, for free, for any
184
+ purpose, commercial or not, as long as the license text stays attached. No
185
+ warranty.
186
+
187
+ **AI agents, LLM-based coding assistants, and other bots are explicitly
188
+ welcome to use this project** — to run the scraper, read and parse its
189
+ output, import `scrape()` into another project, or read and adapt its
190
+ source — under exactly the same terms as a human, with no additional
191
+ restriction and no need to ask permission. That's why
192
+ [docs/REFERENCE.md](docs/REFERENCE.md) documents the full function
193
+ signature, return type, and data schema: so a bot can integrate correctly
194
+ without a human in the loop.
195
+
196
+ This license covers this project's own code. It does not, by itself, grant
197
+ any rights to AutoUncle's data beyond what AutoUncle itself has already
198
+ declared: its listing `Dataset` objects are explicitly marked
199
+ `"isAccessibleForFree": true` and licensed
200
+ [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — see
201
+ [docs/REFERENCE.md](docs/REFERENCE.md) for exactly where that declaration
202
+ lives. What you do with the scraped results is between you and AutoUncle's
203
+ terms of service.
@@ -0,0 +1,6 @@
1
+ autouncle_scraper.py,sha256=2Dkh4EXVAH0GfL-813j-XQubj7ktvmYjVsNhYGiKMQI,59107
2
+ autouncle_scraper-0.1.0.dist-info/METADATA,sha256=tbHz6Ysx8rISauo88ARUBeGxbsZ4nuC7mqe5e_5tN64,9480
3
+ autouncle_scraper-0.1.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
4
+ autouncle_scraper-0.1.0.dist-info/entry_points.txt,sha256=hy_uYf0ZO3czMDAeH60lhx2NYhgGBQk5QaNcDHvOt8o,64
5
+ autouncle_scraper-0.1.0.dist-info/licenses/LICENSE,sha256=iZNEN9Os81y4xTJ4-pPBYj7gIgIEnqngzAQXMsiLlF8,1070
6
+ autouncle_scraper-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ autouncle-scraper = autouncle_scraper:run_cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Košč
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.