Skip to main content

Convert NBA injury reports from PDF to a DataFrame

Project description

NBA Injury Report PDF to DataFrame Converter

This Python package provides a function, pdf_to_df, that converts NBA injury reports in PDF format into a pandas DataFrame for easy analysis and manipulation.

Features

  • PDF to DataFrame Conversion: Extracts data from NBA injury report PDFs and structures it into a pandas DataFrame.
  • Data Cleaning: Handles multi-row entries and corrects common formatting issues in the reports.

Installation

Install the package using pip:

pip install nba_injury_report_pdf_to_df

Usage

Here's how you can use the pdf_to_df function:

from nba_injury_report_pdf_to_df import pdf_to_df

# Path to your local NBA injury report PDF
pdf_path = "path/to/your/injury_report.pdf"

# Convert PDF to DataFrame
df = pdf_to_df(pdf_path)

# Display the DataFrame
print(df.head())

Important Note

This package is designed to process NBA injury reports that follow the format used in January 2025.
The structure of these reports includes specific columns such as:

  • Game Date
  • Game Time
  • Matchup
  • Team
  • Player Name
  • Current Status
  • Reason

If the NBA updates the report format in the future, this package may require modifications to ensure compatibility.

Dependencies

  • pandas
  • pdfplumber

These dependencies are automatically installed with the package.

Contributing

Contributions are welcome!
If you encounter issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository:
https://github.com/johngoodhand/nba_injury_report_pdf_to_df

License

This project is licensed under the MIT License.


Note: This package is not affiliated with or endorsed by the National Basketball Association (NBA).

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

nba_injury_report_pdf_to_df-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

nba_injury_report_pdf_to_df-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file nba_injury_report_pdf_to_df-0.1.0.tar.gz.

File metadata

File hashes

Hashes for nba_injury_report_pdf_to_df-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5adea8b0afa7230489f4eada2c4da3069305ea2dcb0075b0348a47fd9839bc72
MD5 8b24e6b4ea4bf363ca4b85c834414ebc
BLAKE2b-256 a63f9d49a74ff1421b03a9283c4313a05119599dbc42cb0b7fd32b510ac1b002

See more details on using hashes here.

File details

Details for the file nba_injury_report_pdf_to_df-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nba_injury_report_pdf_to_df-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b39ba8df6afe6b9f840b431287ad5c19ed983b3bb188da9cab8d98809d593e
MD5 a60acf8b4159ce8f5913b2580b442a85
BLAKE2b-256 c47ea98b474736c1eb7c2849a04f0eaad1d7a21a027c68c6c96f4670cf02000e

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