DatasetScraper
Tool to create image datasets for machine learning problems by scraping search engines like Google, Bing and Baidu.
Features:
- Search engine support: Google, Bing, Baidu. (in-production): Yahoo, Yandex, Duckduckgo
- Image format support: jpg, png, svg, gif, jpeg
- Fast multiprocessing enabled scraper
- Very fast multithreaded downloader
- Data verification after download for assertion of image files
Installation
- COMING SOON on pypi
Usage:
-
Import
from datasetscraper import Scraper -
Defaults
obj = Scraper()
urls = obj.fetch_urls('kiniro mosaic')
obj.download(urls, directory='kiniro_mosaic/')
- Specify a search engine
obj = Scraper()
urls = obj.fetch_urls('kiniro mosaic', engine=['google'])
obj.download(urls, directory='kiniro_mosaic/')
- Specify a list of search engines
obj = Scraper()
urls = obj.fetch_urls('kiniro mosaic', engine=['google', 'bing'])
obj.download(urls, directory='kiniro_mosaic/')
- Specify max images (default was 200)
obj = Scraper()
urls = obj.fetch_urls('kiniro mosaic', engine=['google', 'bing'], maxlist=[500, 300])
obj.download(urls, directory='kiniro_mosaic/')
FAQs
-
Why aren't yandex, yahoo, duckduckgo and other search engines supported? They are hard to scrape, I am working on them and will update as soon as I can.
-
I set maxlist=[500] why are only (x<500) images downloaded? There can be several reasons for this:
- Search ran out: This happens very often, google/bing might not have enough images for your query
- Slow internet: Increase the timeout (default is 60 seconds) as follows:
obj.download(urls, directory='kiniro_mosaic/', timeout=100)
-
How to debug? You can change the logging level while making the scraper object :
obj = Scraper(logger.INFO)
TODO:
- More search engines
- Better debug
- Write documentation
- Text data? Audio data?
Metadata
Release files for datasetscraper 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasetscraper-0.0.4.tar.gz | 5.8 kB | Without provenance | Details for datasetscraper-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasetscraper-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for datasetscraper-0.0.4-py3-none-any.whl |
Total release size: 19.7 kB
Release files / datasetscraper-0.0.4.tar.gz
| Download URL | datasetscraper-0.0.4.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2487404f8454cdef44d32309c62cc3a035b0d0d7a5fea4744881d66dbf060437
|
|
BLAKE2b-256 checksum How to use checksums |
aa3fff3744248ae93b2724e7d210bb95fa0a391c6c81b50db831a968a7a6e009
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
|
Release files / datasetscraper-0.0.4-py3-none-any.whl
| Download URL | datasetscraper-0.0.4-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4819ae12d72c5f358d6bd753b5203cb2689ba4e796799dad535e482d36f42b61
|
|
BLAKE2b-256 checksum How to use checksums |
76325b4d10c3e5fdd37fb62e18ff000ec8f857dcff91e0efd4594e0e8e0275ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
|
Security for datasetscraper 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.