hydrafetch 0.5.0__tar.gz → 0.6.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.
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/PKG-INFO +15 -1
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/README.md +14 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/pyproject.toml +1 -1
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/src/hydrafetch/__init__.py +1 -1
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/src/hydrafetch/_client.py +8 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/tests/test_client.py +10 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/uv.lock +1 -1
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/.github/workflows/ci.yml +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/.github/workflows/publish.yml +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/.gitignore +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/LICENSE +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/src/hydrafetch/_schema.py +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/src/hydrafetch/errors.py +0 -0
- {hydrafetch-0.5.0 → hydrafetch-0.6.0}/src/hydrafetch/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: hydrafetch
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Official Python client for the Hydrafetch web data API. Turn any URL into clean Markdown and structured data.
|
|
5
5
|
Project-URL: Homepage, https://hydrafetch.com
|
|
6
6
|
Project-URL: Documentation, https://docs.hydrafetch.com
|
|
@@ -165,6 +165,19 @@ for r in res["results"]:
|
|
|
165
165
|
print(((r.get("data") or {}).get("markdown") or "")[:500])
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
## News
|
|
169
|
+
|
|
170
|
+
Find recent news articles about anything, newest first, each with its outlet and publish time:
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
found = hf.news("acme raises funding", timeRange="week", limit=10)
|
|
174
|
+
|
|
175
|
+
for article in found["results"]:
|
|
176
|
+
print(article["publishedAt"], article["source"], article["title"], article["url"])
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
A news search costs 1 credit, and one that finds nothing is free. Pass `scrapeResults=True` to also read each article as clean data, at 1 extra credit per article.
|
|
180
|
+
|
|
168
181
|
## Jobs
|
|
169
182
|
|
|
170
183
|
Search open jobs collected from company career sites and hiring platforms, by the words in the job title:
|
|
@@ -293,6 +306,7 @@ hf = Hydrafetch(
|
|
|
293
306
|
| `markdown(url, **options)` | `str` | 1 |
|
|
294
307
|
| `map(url, **options)` | links dict | 1 |
|
|
295
308
|
| `search(query, **options)` | results dict | 1 + 1 per scraped result |
|
|
309
|
+
| `news(query, **options)` | articles, newest first | 1 + 1 per article read; free when empty |
|
|
296
310
|
| `search_jobs(query, **options)` | list of jobs | 1 per 10 jobs |
|
|
297
311
|
| `hiring_changes(domains, since, **options)` | list of companies | 1 per company with jobs |
|
|
298
312
|
| `extract(urls, **options)` | dict with `"results"` | 5 per URL |
|
|
@@ -142,6 +142,19 @@ for r in res["results"]:
|
|
|
142
142
|
print(((r.get("data") or {}).get("markdown") or "")[:500])
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
## News
|
|
146
|
+
|
|
147
|
+
Find recent news articles about anything, newest first, each with its outlet and publish time:
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
found = hf.news("acme raises funding", timeRange="week", limit=10)
|
|
151
|
+
|
|
152
|
+
for article in found["results"]:
|
|
153
|
+
print(article["publishedAt"], article["source"], article["title"], article["url"])
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
A news search costs 1 credit, and one that finds nothing is free. Pass `scrapeResults=True` to also read each article as clean data, at 1 extra credit per article.
|
|
157
|
+
|
|
145
158
|
## Jobs
|
|
146
159
|
|
|
147
160
|
Search open jobs collected from company career sites and hiring platforms, by the words in the job title:
|
|
@@ -270,6 +283,7 @@ hf = Hydrafetch(
|
|
|
270
283
|
| `markdown(url, **options)` | `str` | 1 |
|
|
271
284
|
| `map(url, **options)` | links dict | 1 |
|
|
272
285
|
| `search(query, **options)` | results dict | 1 + 1 per scraped result |
|
|
286
|
+
| `news(query, **options)` | articles, newest first | 1 + 1 per article read; free when empty |
|
|
273
287
|
| `search_jobs(query, **options)` | list of jobs | 1 per 10 jobs |
|
|
274
288
|
| `hiring_changes(domains, since, **options)` | list of companies | 1 per company with jobs |
|
|
275
289
|
| `extract(urls, **options)` | dict with `"results"` | 5 per URL |
|
|
@@ -214,6 +214,9 @@ class Hydrafetch(_Base):
|
|
|
214
214
|
def search(self, query: str, **options: Any) -> dict[str, Any]:
|
|
215
215
|
return self._request("POST", "/v1/web/search", json={"query": query, **_drop_none(options)})
|
|
216
216
|
|
|
217
|
+
def news(self, query: str, **options: Any) -> dict[str, Any]:
|
|
218
|
+
return self._request("POST", "/v1/web/news", json={"query": query, **_drop_none(options)})
|
|
219
|
+
|
|
217
220
|
def search_jobs(self, query: str, **options: Any) -> list[dict[str, Any]]:
|
|
218
221
|
return self._request(
|
|
219
222
|
"POST", "/v1/web/index/jobs/search", json={"query": query, **_drop_none(options)}
|
|
@@ -386,6 +389,11 @@ class AsyncHydrafetch(_Base):
|
|
|
386
389
|
"POST", "/v1/web/search", json={"query": query, **_drop_none(options)}
|
|
387
390
|
)
|
|
388
391
|
|
|
392
|
+
async def news(self, query: str, **options: Any) -> dict[str, Any]:
|
|
393
|
+
return await self._request(
|
|
394
|
+
"POST", "/v1/web/news", json={"query": query, **_drop_none(options)}
|
|
395
|
+
)
|
|
396
|
+
|
|
389
397
|
async def search_jobs(self, query: str, **options: Any) -> list[dict[str, Any]]:
|
|
390
398
|
return await self._request(
|
|
391
399
|
"POST", "/v1/web/index/jobs/search", json={"query": query, **_drop_none(options)}
|
|
@@ -325,3 +325,13 @@ def test_hiring_changes_takes_one_domain_or_many_and_a_datetime() -> None:
|
|
|
325
325
|
"since": "2026-10-01",
|
|
326
326
|
"includeDescriptions": True,
|
|
327
327
|
}
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
def test_news_posts_the_query_and_window() -> None:
|
|
331
|
+
found = {"query": "acme raises", "status": "ok", "results": [{"title": "Acme raises $10M"}]}
|
|
332
|
+
rec = Recorder({"success": True, "data": found})
|
|
333
|
+
client = make_client(rec)
|
|
334
|
+
out = client.news("acme raises", timeRange="day", limit=5, country=None)
|
|
335
|
+
assert out == found
|
|
336
|
+
assert rec.last.url.path == "/v1/web/news"
|
|
337
|
+
assert json.loads(rec.last.content) == {"query": "acme raises", "timeRange": "day", "limit": 5}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|