Skip to main content

Scrape logos for all NHL teams

Project description

https://badge.fury.io/py/nhl-logo-scraper.svg https://codecov.io/gh/blindman/nhl-logo-scraper/branch/master/graph/badge.svg https://travis-ci.org/blindman/nhl-logo-scraper.svg?branch=master

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]

--debug

Allow debugging logs through

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)

--debug

Allow debugging logs through

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nhl-logo-scraper-1.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nhl_logo_scraper-1.1.0-py2.py3-none-any.whl (10.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nhl-logo-scraper-1.1.0.tar.gz.

File metadata

File hashes

Hashes for nhl-logo-scraper-1.1.0.tar.gz
Algorithm Hash digest
SHA256 794814a1d22da3783e8d7febc98db8c11bd9b0fcf0ad8708dbe97428de7c80ce
MD5 505bfb9ce034166e8e43a5daf830a3af
BLAKE2b-256 03d434e8675aa5c399b562f792af67858695777d6c7629a401c6622f04adacb0

See more details on using hashes here.

File details

Details for the file nhl_logo_scraper-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nhl_logo_scraper-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 edd14392527180d71a4c8e7bb6a9714c4f2cf1be7f8d44ddecb4e48ba470da2c
MD5 525536ecbdc74cae0d078a780f47ac5a
BLAKE2b-256 1403afdf3890d77c595526a020f7a3904e305444adefe81206be32af7b6331f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page