-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(python): add ijson streaming jsonl
- Loading branch information
Showing
12 changed files
with
722 additions
and
199 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spider-cloud-cli" | ||
version = "0.1.5" | ||
version = "0.1.22" | ||
edition = "2021" | ||
authors = [ "j-mendez <[email protected]>"] | ||
description = "The Spider Cloud CLI for web crawling and scraping" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
from spider import Spider | ||
|
||
# Initialize the Spider with your API key using the env key SPIDER_API_KEY | ||
app = Spider() | ||
|
||
crawler_params = { | ||
'limit': 1000, | ||
'proxy_enabled': False, | ||
'store_data': False, | ||
'metadata': False, | ||
'request': 'http' | ||
} | ||
|
||
count = [0] | ||
|
||
def process_json(data: dict) -> None: | ||
print(f"Processing: {count[0]}") | ||
count[0] += 1 | ||
for key, value in data.items(): | ||
print(f"{key}: {value}") | ||
|
||
app.crawl_url('https://spider.cloud', params=crawler_params, stream=True, callback=process_json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ pytest | |
pytest-asyncio | ||
python-dotenv | ||
aiohttp | ||
python-dotenv | ||
python-dotenv | ||
ijson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ def read_file(fname): | |
|
||
setup( | ||
name="spider-client", | ||
version="0.0.72", | ||
version="0.1.22", | ||
url="https://github.com/spider-rs/spider-clients/tree/main/python", | ||
author="Spider", | ||
author_email="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.