Scrape logos for all NHL teams
Project description
Scrapes logos for all NHL teams, leagues, and networks
Contents
Usage
First clone the project.
$ git clone https://github.com/blindman/nhl-logo-scraper.git
Once you’ve cloned the project, run the following commands to get the utility working in your terminal.
$ pip install . $ nhlscraper --help
Scrape
$ nhlscraper scrape [--output=DIR] [--format EXTENSIONS] [--archive]
- --output=DIR
The directory to dump all of the files [default: ./output]
- --format EXTENSIONS
Image output formats (svg and/or png) [default: svg]
- --archive
Archive any previous logos that were downloaded [default: True]
Clean
$ nhlscraper clean [--dir=DIR] [--category CATEGORIES] [--full]
- --dir=DIR
The directory that the files live in [default: ./output]
- --category CATEGORIES
Categories to remove all files (league, network, team)
- --full
Clean all files created by this tool (includes archives)
Other
$ nhlscraper -h | --help
$ nhlscraper --version
Contributing
Assuming you’ve cloned the project and created a virtualenv, run the following command to work with the code.
$ virtualenv –python python3 venv $ source venv/bin/activate $ pip install -e .[test]
To test the code, run the following command.
$ python setup.py test
Notes
This is a fork of my old imageDownloader repository which did the same thing but as a bash script and for the previous version of nhl.com
You may have noticed that nhl.com is requested and parsed to find ::code`nhl-logos.css` instead of retrieving the css file directly. This is because (I believe) the path to that file could potentially change. The current path is ::code::…/builds/…/f0683b50089da6c16c1df297a9a74ce08e79b94b_1507226889/…/nhl-logos.css and since the big chunk in the middle looks like a unique identifier I am going to assume it will change. I am looking to implement some sort of caching so it doesn’t make a request every time.
License
MIT © [Jon Heller](https://github.com/blindman)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nhl_logo_scraper-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 344039e40e3703b2626f005a4885f038b9e2b913e4e5d1add956565ca0ab665c |
|
MD5 | 07dcbc64071f2cf93dd5cfcdb1c10a1c |
|
BLAKE2b-256 | 8f602c26213037108dce4ac76002167acf697768c8c24f671853afe32203d1f9 |