connects to hoops dynasty in whatifsports and pulls data
Project description
Hoops Dynasty Data Extraction
This repository contains CLI tools for extracting team and player data from the WhatifSports Hoops Dynasty Game. The CLI commands allow you to pull data for specified team or player IDs and optionally save the results to an Excel file. To use this
Note: this is not affiliated with whatifsports, hoops dynasty or fanball
Installation
Install CLI
.. code:: bash
pip install hoops_dynasty_api
Usage
-----
The CLI commands are defined using the click library. There are two main
commands: pull_hd_team_data and pull_hd_player_data.
**Note**: as of version 0.4.0 the –save-excel-file flag is automatically
set to True and does not need to be included to write out to excel
Pull Team Data
Use the pull-hd-team-data command to pull data for specific teams.
Arguments team_ids: The list of team IDs to pull data for (multiple values allowed).
Options –save-excel-file, -sef: Flag to save the output to the current path. –save-path, -sp: Path to save the output file (default is the current directory).
.. code:: bash
pull-hd-team-data 123 456 789 --save-excel-file --save-path /path/to/save
Pull Player Data
Use the pull-hd-player-data command to pull data for specific players.
**Arguments** player_ids: The list of player IDs to pull data for
(multiple values allowed).
**Options** –save-excel-file, -sef: Flag to save the output to the
current path. –save-path, -sp: Path to save the output file (default is
the current directory).
.. code:: bash
pull-hd-player-data 101 102 103 --save-excel-file --save-path /path/to/save
Pull Players by Team Ids
Use the pull-hd-players-by-team-id command to pull a file for each teams ids roster
Arguments player_ids: The list of player IDs to pull data for (multiple values allowed).
Options –save-excel-file, -sef: Flag to save the output to the current path. –save-path, -sp: Path to save the output file (default is the current directory).
.. code:: bash
pull-hd-players-by-team-id 1 2 3 --save-excel-file --save-path ./data
Errors
WebBrowserCreationError
^^^^^^^^^^^^^^^^^^^^^^^
At times the browser doesn’t build correctly and the run fails. just
click up and run your same command again, working on figuring this out
Development
-----------
Setup
~~~~~
To install repo and contribute first, clone the repository and navigate
to the project directory:
.. code:: bash
# clone project
git clone https://github.com/zachstocker/hoops-dynasty-api.git
cd hoops-dynasty-api
# create virtual env and activate it
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
# install requirements
pip install -r requirements.txt
# Create a new branch and check it out
NEW_BRANCH="new-feature-branch" # Replace with your branch name
git checkout -b $NEW_BRANCH
Contribute
To contribute to this project, fork the repository, create a new branch, and submit a pull request.
.. code:: bash
git checkout -b feature-branch
Make your changes and commit them:
.. code:: bash
git commit -m "Description of the changes"
Push your changes to your fork:
.. code:: bash
git push origin feature-branch
Create a pull request from your feature branch to the main repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributors
- Zach Stocker (@zachstocker)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for hoops_dynasty_api-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbb26275db0a9970324aebe7620e4800c447cb5f7be12dd481547cbc5a46d6b7 |
|
MD5 | a7f116f8bfb98410937ab44fc5c0c1f5 |
|
BLAKE2b-256 | 1f70f90f27c60a5ba50da97d72278df336dcd0691e13886b0a9b6c74709b20a6 |