Observed since 20 Oct, 21:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
afetchx
# afetchx Asynchronously fetch image URLs using httpx. `afetchx` parses command-line arguments to determine the list of image URLs to fetch, the maximum number of concurrent connections, the cooldown time between requests, an optional JSON file containing URLs, and output options. It then fetches the images, saves them in the specified output directory, and prints the number of successfully downloaded images. ## Usage Invoke the script with ```bash python -m afetchx {args} ``` ## Command-line arguments - `-n`, `--max_connections`: Max number of concurrent connections (default: 5). - `-c`, `--cooldown`: Cooldown time between requests in seconds (default: 1.0). - `-j`, `--json`: Path to a JSON
Asynchronously fetch image URLs using httpx.
afetchx parses command-line arguments to determine the list of image URLs to fetch, the maximum number of concurrent connections, the cooldown time between requests, an optional JSON file containing URLs, and output options. It then fetches the images, saves them in the specified output directory, and prints the number of successfully downloaded images.
Invoke the script with
python -m afetchx {args}
-n, --max_connections: Max number of concurrent connections (default: 5).-c, --cooldown: Cooldown time between requests in seconds (default: 1.0).-j, --json: Path to a JSON file containing URLs to fetch.-o, --output-dir: Directory to save downloaded images (default: ./downloaded in the current working directory).--filename-format: Lambda function as a string to format filenames based on the URL (e.g., "lambda url: url.split('/')[-1].split('.')[0] + '.png'").urls: List of image URLs to fetch (positional arguments).--json (-j) argument to specify a JSON file containing URLs.Download images from a JSON file with a cooldown of 1 second between each download and a maximum of 5 concurrent connections:
python -m afetchx -j urls.json -c 1.0 -n 5
Download images from URLs provided as positional arguments and save them to a custom directory:
python -m afetchx -c 1.0 -n 5 -o ./downloaded_pictures "https://unsplash.it/256.jpg" "https://unsplash.it/512.jpg"
Download images and apply a custom filename format based on the URL:
python -m afetchx -c 1.0 -n 5 --filename-format "lambda url: url.split('/')[-1].split('.')[0] + '.png'" "https://example.com/image1.png" "https://example.com/image2.jpg"
In this example, each downloaded image will be named according to the lambda function. The filename format option can be especially useful for sanitizing or modifying filenames before saving.
If both URLs and a JSON file are provided, the script will print an error and exit. Likewise, if neither URLs nor a JSON file are provided, the script will print an error and exit. Ensure exactly one source for URLs.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
tqdmEnvironment{
"extras": "",
"marker": null,
"requires_python": "<4.0,>=3.10",
"evaluation": "NOT_EVALUATED"
} | tqdm<5.0.0,>=4.66.6 | runtime |
httpxEnvironment{
"extras": "",
"marker": null,
"requires_python": "<4.0,>=3.10",
"evaluation": "NOT_EVALUATED"
} | httpx<0.28.0,>=0.27.2 | runtime |
argparseEnvironment{
"extras": "",
"marker": null,
"requires_python": "<4.0,>=3.10",
"evaluation": "NOT_EVALUATED"
} | argparse<2.0.0,>=1.4.0 | runtime |
aiofilesEnvironment{
"extras": "",
"marker": null,
"requires_python": "<4.0,>=3.10",
"evaluation": "NOT_EVALUATED"
} | aiofiles<25.0.0,>=24.1.0 | runtime |
pytest-asyncioEnvironment{
"extras": "",
"marker": null,
"requires_python": "<4.0,>=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest-asyncio<0.25.0,>=0.24.0 | runtime |
bdist_wheel · 4.7 KB · Python py3
sdist · 4.1 KB · Python source
Observed since 20 Oct, 21:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:3e73ea39557a4f64c005a55794bdcb2e685bc24880ba61cee44e8ace2629db83