Skip to main content

A package for downloading NBA player headshots from stats.NBA.com

Project description

nbaHeadshots

A package for downloading NBA player headshots from stats.NBA.com

Development Version: v0.0.1

nbaHeadshots was created to make player headsnhots from www.stats.nba.com more accessible and easilly downloadable.

Installation

pip install nbaHeadshots

Example Usage

Currently the package only consists of two functions:

  • getHeadshotById(id, saveFolder, fileName=None)
  • getAllHeadshots(saveFolder)

Player Id's are based on www.stats.nba.com player ids. nba_api is an easy way to get a list of these player ids and its also useful for getting nab statistics. There is a json file of basic player information loacted at src/playerInfo.json. Image files are saved in .png format. Different formats can be used by specifying fileName.

from nbaHeadshots import getHeadshotById, getAllHeadshots

# Lebron James headshot will be saved as lebron.jpg in saveHere folder
getHeadshotById(2544, folder="saveHere/", fileName="lebron.jpg")

# Lebron James headshot will be saved as 2544.png in current directory
getHeadshotById(2544)

# All headshots will be saved as "id".png in saveHere folder
getAllHeadshots("saveHere/")

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

nbaHeadshots-0.0.1.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

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

nbaHeadshots-0.0.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file nbaHeadshots-0.0.1.tar.gz.

File metadata

  • Download URL: nbaHeadshots-0.0.1.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for nbaHeadshots-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0d896d821c8d8f6f7cd047acb1361a74551af91c7199989340d5cf35baba7a52
MD5 5231f27a4484d0604cf6017e7eaa2a6c
BLAKE2b-256 04e90f22f83f57193be299ff76c4c17a1a3bbe1b22f291cb4001705f9315663a

See more details on using hashes here.

File details

Details for the file nbaHeadshots-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nbaHeadshots-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for nbaHeadshots-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 380beaf7dc1177f80b9beef29807f207ca9c89fd457938788bfadb0ade79a47f
MD5 a053261ac7f851c3e2d58049330a0114
BLAKE2b-256 570550618b4a78c5d355f63d02e6b70bec1c28c39679b14efc5d95f6398bbd5f

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