scrapebadger-cli 0.28.0__tar.gz → 0.29.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.
- scrapebadger_cli-0.29.0/CHANGELOG.md +6 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/PKG-INFO +36 -4
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/README.md +33 -2
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/pyproject.toml +3 -2
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/autoscout24.py +23 -1
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/github.py +15 -1
- scrapebadger_cli-0.29.0/src/scrapebadger_cli/commands/yelp.py +50 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/main.py +4 -2
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_autoscout24_commands.py +30 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_github.py +27 -0
- scrapebadger_cli-0.29.0/tests/test_yelp_commands.py +55 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/uv.lock +1 -1
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/.gitignore +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/__init__.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/availability.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/client.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/__init__.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/agent.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/airbnb.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/aliexpress.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/amazon.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/apartments.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/app_store.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/asos.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/auth.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/baidu.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/bestbuy.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/bing.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/booking.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/brave.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/chatgpt.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/copilot.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/depop.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/duckduckgo.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/ebay.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/etsy.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/facebook.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/gemini.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/google.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/google_play.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/gumtree.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/idealista.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/immobiliare.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/init.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/instagram.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/leboncoin.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/linkedin.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/loopnet.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/naver.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/onboarding.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/perplexity.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/realtor.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/reddit.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/redfin.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/stream.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/target.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/tiktok.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/twitter.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/vinted.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/wallapop.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/walmart.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/web.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/yahoo.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/yandex.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/youtube.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/zillow.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/config.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/output.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/results.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/views.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/conftest.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_agent_features.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_brave.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_cli_availability.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_copilot_commands.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_google_light_search.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_naver.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_perplexity_strict_country.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_tiktok_pagination.py +0 -0
- {scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/tests/test_vinted_image_search.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: scrapebadger-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.29.0
|
|
4
4
|
Summary: ScrapeBadger CLI — Twitter, Vinted, Google, and Web Scraping from the command line
|
|
5
5
|
Author: ScrapeBadger Team
|
|
6
6
|
License: MIT
|
|
@@ -11,9 +11,10 @@ Classifier: Intended Audience :: Developers
|
|
|
11
11
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries
|
|
13
13
|
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: click<9,>=8.1
|
|
14
15
|
Requires-Dist: httpx>=0.26.0
|
|
15
16
|
Requires-Dist: rich>=13.0.0
|
|
16
|
-
Requires-Dist: typer
|
|
17
|
+
Requires-Dist: typer<0.25,>=0.12.0
|
|
17
18
|
Requires-Dist: websockets>=12.0
|
|
18
19
|
Provides-Extra: dev
|
|
19
20
|
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
@@ -170,6 +171,19 @@ Run `scrapebadger <api> --help` to list product, review, store, availability and
|
|
|
170
171
|
reference commands for that API. Each command supports `--help` for its exact
|
|
171
172
|
parameters. Requests use your API key's existing permissions and credit balance.
|
|
172
173
|
|
|
174
|
+
### GitHub repository detail
|
|
175
|
+
|
|
176
|
+
Use owner and repository name separately, not a URL. Repository detail uses the
|
|
177
|
+
public default branch and accepts no pagination, market or ref options.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
scrapebadger github repository cli cli
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
A successful uncached detail response costs 10 credits. Errors are unbilled;
|
|
184
|
+
cache hits can be free. The raw JSON retains README, root files, latest commit,
|
|
185
|
+
metadata and additive fields. Reference: https://docs.scrapebadger.com/github/repositories.
|
|
186
|
+
|
|
173
187
|
### GitHub public profiles
|
|
174
188
|
|
|
175
189
|
Prepared for the GitHub API rollout. Use a login or @handle, not a URL.
|
|
@@ -184,13 +198,15 @@ scrapebadger github profile sindresorhus --tab stars --next-page-token OPAQUE_TO
|
|
|
184
198
|
|
|
185
199
|
These examples are representative; see https://docs.scrapebadger.com/github/profiles.
|
|
186
200
|
|
|
187
|
-
### AutoScout24 vehicle search
|
|
201
|
+
### AutoScout24 vehicle search and listing detail
|
|
188
202
|
|
|
189
|
-
Search vehicle cards across eight European marketplaces
|
|
203
|
+
Search vehicle cards across eight European marketplaces, then retrieve full specifications, equipment, photos and public seller contacts.
|
|
190
204
|
|
|
191
205
|
```bash
|
|
192
206
|
scrapebadger autoscout24 search --market de --make volkswagen --model golf --price-max 20000
|
|
193
207
|
scrapebadger autoscout24 search --market it --make volkswagen --model golf --sort-by price_asc --page 2
|
|
208
|
+
scrapebadger autoscout24 listing --url SEARCH_RESULT_URL
|
|
209
|
+
scrapebadger autoscout24 listing --listing-id UUID --market it
|
|
194
210
|
scrapebadger autoscout24 filters --market de --make volkswagen
|
|
195
211
|
scrapebadger autoscout24 markets
|
|
196
212
|
```
|
|
@@ -199,6 +215,9 @@ Ranges use `--price-min/--price-max` (EUR), `--mileage-min/--mileage-max` (km),
|
|
|
199
215
|
`--year-min/--year-max` (first registration) and `--power-min/--power-max` (kW).
|
|
200
216
|
Use `--help` for fuel, transmission, body, seller, condition and postcode/radius filters.
|
|
201
217
|
Follow the response's `next_page`; the source caps browsing at 200 pages per query.
|
|
218
|
+
Listing detail accepts exactly one URL or UUID and costs 10 credits. A URL infers its
|
|
219
|
+
market; a UUID defaults to Germany unless `--market` is supplied. Failed requests
|
|
220
|
+
and removed listings are free.
|
|
202
221
|
## Brave Search
|
|
203
222
|
|
|
204
223
|
```bash
|
|
@@ -214,3 +233,16 @@ Web/video `--page` is a 1-based native page ordinal; `--count` trims one source
|
|
|
214
233
|
page without changing its boundaries. Images/news return an initial batch.
|
|
215
234
|
JSON output preserves the complete response, including rich blocks and native
|
|
216
235
|
query alteration metadata. Use `brave locales` for country/UI-language codes.
|
|
236
|
+
|
|
237
|
+
## Yelp business search
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
scrapebadger yelp search "San Francisco, CA" -q pizza
|
|
241
|
+
scrapebadger yelp search "Chicago, IL" --category coffee --sort-by rating --price 1,2 --page 2
|
|
242
|
+
scrapebadger yelp search "Austin, TX" -q tacos --features delivery,takeout
|
|
243
|
+
scrapebadger yelp markets
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Results are ranked as on Yelp, ten businesses per page, pages 1–11; ads come back
|
|
247
|
+
separately under `ads`. JSON output keeps totals, filters and `next_page`.
|
|
248
|
+
Business detail and reviews are not included.
|
|
@@ -148,6 +148,19 @@ Run `scrapebadger <api> --help` to list product, review, store, availability and
|
|
|
148
148
|
reference commands for that API. Each command supports `--help` for its exact
|
|
149
149
|
parameters. Requests use your API key's existing permissions and credit balance.
|
|
150
150
|
|
|
151
|
+
### GitHub repository detail
|
|
152
|
+
|
|
153
|
+
Use owner and repository name separately, not a URL. Repository detail uses the
|
|
154
|
+
public default branch and accepts no pagination, market or ref options.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
scrapebadger github repository cli cli
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
A successful uncached detail response costs 10 credits. Errors are unbilled;
|
|
161
|
+
cache hits can be free. The raw JSON retains README, root files, latest commit,
|
|
162
|
+
metadata and additive fields. Reference: https://docs.scrapebadger.com/github/repositories.
|
|
163
|
+
|
|
151
164
|
### GitHub public profiles
|
|
152
165
|
|
|
153
166
|
Prepared for the GitHub API rollout. Use a login or @handle, not a URL.
|
|
@@ -162,13 +175,15 @@ scrapebadger github profile sindresorhus --tab stars --next-page-token OPAQUE_TO
|
|
|
162
175
|
|
|
163
176
|
These examples are representative; see https://docs.scrapebadger.com/github/profiles.
|
|
164
177
|
|
|
165
|
-
### AutoScout24 vehicle search
|
|
178
|
+
### AutoScout24 vehicle search and listing detail
|
|
166
179
|
|
|
167
|
-
Search vehicle cards across eight European marketplaces
|
|
180
|
+
Search vehicle cards across eight European marketplaces, then retrieve full specifications, equipment, photos and public seller contacts.
|
|
168
181
|
|
|
169
182
|
```bash
|
|
170
183
|
scrapebadger autoscout24 search --market de --make volkswagen --model golf --price-max 20000
|
|
171
184
|
scrapebadger autoscout24 search --market it --make volkswagen --model golf --sort-by price_asc --page 2
|
|
185
|
+
scrapebadger autoscout24 listing --url SEARCH_RESULT_URL
|
|
186
|
+
scrapebadger autoscout24 listing --listing-id UUID --market it
|
|
172
187
|
scrapebadger autoscout24 filters --market de --make volkswagen
|
|
173
188
|
scrapebadger autoscout24 markets
|
|
174
189
|
```
|
|
@@ -177,6 +192,9 @@ Ranges use `--price-min/--price-max` (EUR), `--mileage-min/--mileage-max` (km),
|
|
|
177
192
|
`--year-min/--year-max` (first registration) and `--power-min/--power-max` (kW).
|
|
178
193
|
Use `--help` for fuel, transmission, body, seller, condition and postcode/radius filters.
|
|
179
194
|
Follow the response's `next_page`; the source caps browsing at 200 pages per query.
|
|
195
|
+
Listing detail accepts exactly one URL or UUID and costs 10 credits. A URL infers its
|
|
196
|
+
market; a UUID defaults to Germany unless `--market` is supplied. Failed requests
|
|
197
|
+
and removed listings are free.
|
|
180
198
|
## Brave Search
|
|
181
199
|
|
|
182
200
|
```bash
|
|
@@ -192,3 +210,16 @@ Web/video `--page` is a 1-based native page ordinal; `--count` trims one source
|
|
|
192
210
|
page without changing its boundaries. Images/news return an initial batch.
|
|
193
211
|
JSON output preserves the complete response, including rich blocks and native
|
|
194
212
|
query alteration metadata. Use `brave locales` for country/UI-language codes.
|
|
213
|
+
|
|
214
|
+
## Yelp business search
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
scrapebadger yelp search "San Francisco, CA" -q pizza
|
|
218
|
+
scrapebadger yelp search "Chicago, IL" --category coffee --sort-by rating --price 1,2 --page 2
|
|
219
|
+
scrapebadger yelp search "Austin, TX" -q tacos --features delivery,takeout
|
|
220
|
+
scrapebadger yelp markets
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Results are ranked as on Yelp, ten businesses per page, pages 1–11; ads come back
|
|
224
|
+
separately under `ads`. JSON output keeps totals, filters and `next_page`.
|
|
225
|
+
Business detail and reviews are not included.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "scrapebadger-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.29.0"
|
|
4
4
|
description = "ScrapeBadger CLI — Twitter, Vinted, Google, and Web Scraping from the command line"
|
|
5
5
|
requires-python = ">=3.10"
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -15,7 +15,8 @@ classifiers = [
|
|
|
15
15
|
"Topic :: Software Development :: Libraries",
|
|
16
16
|
]
|
|
17
17
|
dependencies = [
|
|
18
|
-
"typer>=0.12.0",
|
|
18
|
+
"typer>=0.12.0,<0.25",
|
|
19
|
+
"click>=8.1,<9",
|
|
19
20
|
"httpx>=0.26.0",
|
|
20
21
|
"rich>=13.0.0",
|
|
21
22
|
"websockets>=12.0",
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/autoscout24.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""AutoScout24 vehicle listing
|
|
1
|
+
"""AutoScout24 vehicle search, listing detail and reference commands."""
|
|
2
2
|
|
|
3
3
|
import typer
|
|
4
4
|
|
|
@@ -66,6 +66,28 @@ def search(
|
|
|
66
66
|
render(data, fmt, fields, preserve_envelope=True)
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
@app.command()
|
|
70
|
+
def listing(
|
|
71
|
+
url: str | None = typer.Option(None, "--url", help="Full HTTPS listing URL from search"),
|
|
72
|
+
listing_id: str | None = typer.Option(None, "--listing-id", help="Listing UUID from search"),
|
|
73
|
+
market: str | None = typer.Option(
|
|
74
|
+
None, "--market", help="Inferred from URL, otherwise de; must match URL if supplied"
|
|
75
|
+
),
|
|
76
|
+
fmt: str = FMT,
|
|
77
|
+
fields: str | None = FIELDS,
|
|
78
|
+
) -> None:
|
|
79
|
+
"""Full vehicle specs, equipment, photos and seller. URL or UUID required; 10 credits."""
|
|
80
|
+
render(
|
|
81
|
+
api_get(
|
|
82
|
+
"/v1/autoscout24/listing",
|
|
83
|
+
{"url": url, "listing_id": listing_id, "market": market},
|
|
84
|
+
),
|
|
85
|
+
fmt,
|
|
86
|
+
fields,
|
|
87
|
+
preserve_envelope=True,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
69
91
|
@app.command()
|
|
70
92
|
def filters(
|
|
71
93
|
market: str = typer.Option("de", "--market"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""GitHub public profile commands."""
|
|
1
|
+
"""GitHub public profile and repository commands."""
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from urllib.parse import quote
|
|
@@ -17,6 +17,20 @@ class ProfileTab(str, Enum):
|
|
|
17
17
|
stars = "stars"
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
@app.command()
|
|
21
|
+
def repository(
|
|
22
|
+
owner: str = typer.Argument(..., help="Public repository owner login, not a URL"),
|
|
23
|
+
repo: str = typer.Argument(..., help="Repository name, including dots or hyphens"),
|
|
24
|
+
fmt: str = typer.Option("json", "--output", "-o", help="json, csv, table, markdown"),
|
|
25
|
+
fields: str | None = typer.Option(None, "--fields", "-f", help="Comma-separated output fields"),
|
|
26
|
+
) -> None:
|
|
27
|
+
"""Get a public repository with native README, root files and latest commit."""
|
|
28
|
+
if owner in {".", ".."} or repo in {".", ".."}:
|
|
29
|
+
raise typer.BadParameter("owner and repo must not be dot path segments")
|
|
30
|
+
data = api_get(f"/v1/github/repositories/{quote(owner, safe='')}/{quote(repo, safe='')}")
|
|
31
|
+
render(data, fmt, fields, preserve_envelope=True)
|
|
32
|
+
|
|
33
|
+
|
|
20
34
|
@app.command()
|
|
21
35
|
def profile(
|
|
22
36
|
username: str = typer.Argument(..., help="GitHub login or @handle, not a profile URL"),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Yelp business search commands. Business detail and reviews are not included."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
from scrapebadger_cli.client import api_get
|
|
6
|
+
from scrapebadger_cli.output import render
|
|
7
|
+
|
|
8
|
+
app = typer.Typer(no_args_is_help=True)
|
|
9
|
+
FMT = typer.Option("json", "--output", "-o", help="Output format: json, csv, table, markdown")
|
|
10
|
+
FIELDS = typer.Option(None, "--fields", "-f", help="Comma-separated response fields")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@app.command()
|
|
14
|
+
def search(
|
|
15
|
+
location: str = typer.Argument(..., help="Where: city, neighbourhood, address or postcode"),
|
|
16
|
+
query: str | None = typer.Option(None, "--query", "-q", help="What, e.g. pizza or plumbers"),
|
|
17
|
+
market: str = typer.Option("us", "--market", help="Yelp site; see `yelp markets`"),
|
|
18
|
+
category: str | None = typer.Option(None, "--category", help="Yelp category alias, e.g. pizza"),
|
|
19
|
+
sort_by: str = typer.Option(
|
|
20
|
+
"recommended", "--sort-by", help="recommended, rating, review_count"
|
|
21
|
+
),
|
|
22
|
+
price: str | None = typer.Option(None, "--price", help="Comma-separated levels 1-4, e.g. 1,2"),
|
|
23
|
+
features: str | None = typer.Option(
|
|
24
|
+
None, "--features", help="Comma-separated, e.g. delivery,takeout"
|
|
25
|
+
),
|
|
26
|
+
page: int = typer.Option(1, "--page", help="Page 1-11, ten businesses each"),
|
|
27
|
+
fmt: str = FMT,
|
|
28
|
+
fields: str | None = FIELDS,
|
|
29
|
+
) -> None:
|
|
30
|
+
"""Search ranked Yelp businesses; ads are separate. 15 credits; empty results free."""
|
|
31
|
+
data = api_get(
|
|
32
|
+
"/v1/yelp/search",
|
|
33
|
+
{
|
|
34
|
+
"location": location,
|
|
35
|
+
"query": query,
|
|
36
|
+
"market": market,
|
|
37
|
+
"category": category,
|
|
38
|
+
"sort_by": sort_by,
|
|
39
|
+
"price": price,
|
|
40
|
+
"features": features,
|
|
41
|
+
"page": page,
|
|
42
|
+
},
|
|
43
|
+
)
|
|
44
|
+
render(data, fmt, fields, preserve_envelope=True)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@app.command()
|
|
48
|
+
def markets(fmt: str = FMT, fields: str | None = FIELDS) -> None:
|
|
49
|
+
"""List the Yelp sites this API searches. Free."""
|
|
50
|
+
render(api_get("/v1/yelp/markets"), fmt, fields, preserve_envelope=True)
|
|
@@ -54,6 +54,7 @@ from scrapebadger_cli.commands import (
|
|
|
54
54
|
web,
|
|
55
55
|
yahoo,
|
|
56
56
|
yandex,
|
|
57
|
+
yelp,
|
|
57
58
|
youtube,
|
|
58
59
|
zillow,
|
|
59
60
|
)
|
|
@@ -79,7 +80,7 @@ def _main(
|
|
|
79
80
|
|
|
80
81
|
app.add_typer(twitter.app, name="twitter", help="Twitter/X data commands")
|
|
81
82
|
app.add_typer(reddit.app, name="reddit", help="Reddit data commands")
|
|
82
|
-
app.add_typer(github.app, name="github", help="GitHub public profile commands")
|
|
83
|
+
app.add_typer(github.app, name="github", help="GitHub public repository and profile commands")
|
|
83
84
|
app.add_typer(instagram.app, name="instagram", help="Instagram data commands")
|
|
84
85
|
app.add_typer(stream.app, name="stream", help="Real-time streaming commands")
|
|
85
86
|
app.add_typer(vinted.app, name="vinted", help="Vinted marketplace commands")
|
|
@@ -109,6 +110,7 @@ app.add_typer(baidu.app, name="baidu", help="Baidu search engine commands")
|
|
|
109
110
|
app.add_typer(naver.app, name="naver", help="Naver search, place & shopping commands")
|
|
110
111
|
app.add_typer(duckduckgo.app, name="duckduckgo", help="DuckDuckGo search commands")
|
|
111
112
|
app.add_typer(yandex.app, name="yandex", help="Yandex search commands")
|
|
113
|
+
app.add_typer(yelp.app, name="yelp", help="Yelp business search commands")
|
|
112
114
|
app.add_typer(realtor.app, name="realtor", help="Realtor real-estate commands")
|
|
113
115
|
app.add_typer(loopnet.app, name="loopnet", help="LoopNet commercial real estate commands")
|
|
114
116
|
app.add_typer(airbnb.app, name="airbnb", help="Airbnb stays, availability and experiences commands")
|
|
@@ -122,7 +124,7 @@ app.add_typer(apartments.app, name="apartments", help="Apartments.com rental com
|
|
|
122
124
|
app.add_typer(linkedin.app, name="linkedin", help="LinkedIn public data commands")
|
|
123
125
|
app.add_typer(chatgpt.app, name="chatgpt", help="ChatGPT LLM scraping commands")
|
|
124
126
|
app.add_typer(perplexity.app, name="perplexity", help="Perplexity AI answer-engine commands")
|
|
125
|
-
app.add_typer(autoscout24.app, name="autoscout24", help="AutoScout24 vehicle search
|
|
127
|
+
app.add_typer(autoscout24.app, name="autoscout24", help="AutoScout24 vehicle search and listings")
|
|
126
128
|
app.add_typer(copilot.app, name="copilot", help="Microsoft Copilot answer-engine commands")
|
|
127
129
|
app.add_typer(gemini.app, name="gemini", help="Google Gemini LLM commands")
|
|
128
130
|
app.add_typer(
|
|
@@ -58,6 +58,36 @@ def test_markets_remains_a_static_reference_call(monkeypatch):
|
|
|
58
58
|
call.assert_called_once_with("/v1/autoscout24/markets")
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
@pytest.mark.parametrize(
|
|
62
|
+
"arguments,params",
|
|
63
|
+
[
|
|
64
|
+
(
|
|
65
|
+
[
|
|
66
|
+
"--url",
|
|
67
|
+
"https://www.autoscout24.be/fr/offres/golf-3124825e-43e6-45d4-8987-775b827fb166",
|
|
68
|
+
],
|
|
69
|
+
{
|
|
70
|
+
"url": "https://www.autoscout24.be/fr/offres/golf-3124825e-43e6-45d4-8987-775b827fb166",
|
|
71
|
+
"listing_id": None,
|
|
72
|
+
"market": None,
|
|
73
|
+
},
|
|
74
|
+
),
|
|
75
|
+
(
|
|
76
|
+
["--listing-id", "3124825e-43e6-45d4-8987-775b827fb166", "--market", "be"],
|
|
77
|
+
{"url": None, "listing_id": "3124825e-43e6-45d4-8987-775b827fb166", "market": "be"},
|
|
78
|
+
),
|
|
79
|
+
],
|
|
80
|
+
)
|
|
81
|
+
def test_detail_url_and_id_handoffs_preserve_envelope(monkeypatch, arguments, params):
|
|
82
|
+
data = {"market": "be", "listing": {"id": "3124825e-43e6-45d4-8987-775b827fb166"}}
|
|
83
|
+
call = Mock(return_value=data)
|
|
84
|
+
monkeypatch.setattr(autoscout24, "api_get", call)
|
|
85
|
+
result = CliRunner().invoke(autoscout24.app, ["listing", *arguments])
|
|
86
|
+
assert result.exit_code == 0, result.output
|
|
87
|
+
call.assert_called_once_with("/v1/autoscout24/listing", params)
|
|
88
|
+
assert json.loads(result.stdout) == data
|
|
89
|
+
|
|
90
|
+
|
|
61
91
|
@pytest.mark.parametrize("count", [0, 1, 2])
|
|
62
92
|
def test_json_preserves_pagination_for_every_row_count(monkeypatch, count):
|
|
63
93
|
data = {
|
|
@@ -9,6 +9,33 @@ from scrapebadger_cli.main import app
|
|
|
9
9
|
from typer.testing import CliRunner
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def test_repository_forwards_two_encoded_identifiers_and_preserves_envelope(monkeypatch):
|
|
13
|
+
payload = {
|
|
14
|
+
"repository": {"full_name": "example/project", "watchers": 0},
|
|
15
|
+
"readme": {"text": "Example", "html": "<p>Example</p>"},
|
|
16
|
+
"files": [],
|
|
17
|
+
"additional_source_field": {"available": False},
|
|
18
|
+
}
|
|
19
|
+
call = Mock(return_value=payload)
|
|
20
|
+
monkeypatch.setattr(github, "api_get", call)
|
|
21
|
+
result = CliRunner().invoke(app, ["github", "repository", "a/b?c", "project+?#雪"])
|
|
22
|
+
assert result.exit_code == 0, result.output
|
|
23
|
+
call.assert_called_once_with("/v1/github/repositories/a%2Fb%3Fc/project%2B%3F%23%E9%9B%AA")
|
|
24
|
+
assert json.loads(result.output) == payload
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@pytest.mark.parametrize(
|
|
28
|
+
"owner,repo", [(".", "project"), ("..", "project"), ("owner", "."), ("owner", "..")]
|
|
29
|
+
)
|
|
30
|
+
def test_repository_dot_segments_never_reach_http(monkeypatch, owner, repo):
|
|
31
|
+
call = Mock()
|
|
32
|
+
monkeypatch.setattr(github, "api_get", call)
|
|
33
|
+
result = CliRunner().invoke(app, ["github", "repository", owner, repo])
|
|
34
|
+
assert result.exit_code != 0
|
|
35
|
+
assert "dot path segments" in result.output
|
|
36
|
+
call.assert_not_called()
|
|
37
|
+
|
|
38
|
+
|
|
12
39
|
@pytest.mark.parametrize(
|
|
13
40
|
("options", "expected"),
|
|
14
41
|
[
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from unittest.mock import Mock
|
|
2
|
+
|
|
3
|
+
from scrapebadger_cli.commands import yelp
|
|
4
|
+
from typer.testing import CliRunner
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_search_filters_and_pagination_reach_gateway(monkeypatch):
|
|
8
|
+
call = Mock(return_value={"results": [], "ads": []})
|
|
9
|
+
render = Mock()
|
|
10
|
+
monkeypatch.setattr(yelp, "api_get", call)
|
|
11
|
+
monkeypatch.setattr(yelp, "render", render)
|
|
12
|
+
result = CliRunner().invoke(
|
|
13
|
+
yelp.app,
|
|
14
|
+
[
|
|
15
|
+
"search",
|
|
16
|
+
"San Francisco, CA",
|
|
17
|
+
"-q",
|
|
18
|
+
"pizza",
|
|
19
|
+
"--category",
|
|
20
|
+
"pizza",
|
|
21
|
+
"--sort-by",
|
|
22
|
+
"review_count",
|
|
23
|
+
"--price",
|
|
24
|
+
"1,2",
|
|
25
|
+
"--features",
|
|
26
|
+
"delivery,takeout",
|
|
27
|
+
"--page",
|
|
28
|
+
"3",
|
|
29
|
+
],
|
|
30
|
+
)
|
|
31
|
+
assert result.exit_code == 0, result.output
|
|
32
|
+
path, params = call.call_args.args
|
|
33
|
+
assert path == "/v1/yelp/search"
|
|
34
|
+
assert params == {
|
|
35
|
+
"location": "San Francisco, CA",
|
|
36
|
+
"query": "pizza",
|
|
37
|
+
"market": "us",
|
|
38
|
+
"category": "pizza",
|
|
39
|
+
"sort_by": "review_count",
|
|
40
|
+
"price": "1,2",
|
|
41
|
+
"features": "delivery,takeout",
|
|
42
|
+
"page": 3,
|
|
43
|
+
}
|
|
44
|
+
# Totals, ads and the next page survive any output format.
|
|
45
|
+
assert render.call_args.kwargs == {"preserve_envelope": True}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def test_location_is_required_and_markets_is_a_reference_call(monkeypatch):
|
|
49
|
+
call = Mock(return_value={"markets": []})
|
|
50
|
+
monkeypatch.setattr(yelp, "api_get", call)
|
|
51
|
+
monkeypatch.setattr(yelp, "render", Mock())
|
|
52
|
+
assert CliRunner().invoke(yelp.app, ["search"]).exit_code != 0
|
|
53
|
+
result = CliRunner().invoke(yelp.app, ["markets"])
|
|
54
|
+
assert result.exit_code == 0, result.output
|
|
55
|
+
call.assert_called_once_with("/v1/yelp/markets")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/aliexpress.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/apartments.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/app_store.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/bestbuy.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/booking.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/chatgpt.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/copilot.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/duckduckgo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/facebook.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/google_play.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/gumtree.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/idealista.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/immobiliare.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/instagram.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/leboncoin.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/linkedin.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/loopnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/onboarding.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/perplexity.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/realtor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/twitter.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/wallapop.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/walmart.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.28.0 → scrapebadger_cli-0.29.0}/src/scrapebadger_cli/commands/youtube.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|