Giter Club home page Giter Club logo

mlb-gameday-terminal's Introduction

⚾ mlb-gameday-terminal ⚾

Final Game Output Screenshot

Quickstart

  1. Get live data
./run.sh nym
  1. Watch live data, updated every minute
./run.sh nym 60

⚠️ watch command must be installed for automatic refresh

ℹ️ You can search for a team by any term that partially matches exactly one team by either name, location, or abbreviation.

Install Requirements

If you ran quickstart script, this was done already.

  1. Create virtual env
$ python -m venv env
  1. Activate virtual env
$ source env/bin/activate
  1. Install packages
$ pip install -r requirements.txt

Query for Game Data

  1. Activate virtual env (see install above)
  2. Run script

Today

$ python run.py query --team nym

Past Game

$ python run.py query --team nym --date 2019-09-27

Auto Update

$ watch -t -d -n 60 "python run.py query --team nym"

⚠️ watch command is not automatically installed

Update Teams List

By default teams with the names, abbreviations, and IDs are stored in teams.py. In the unlikely event you need to update that list, run the following...

$ python fetch_team_ids.py > teams.py

Use Sample Data

Repo includes past games in certain states in games.p for easier debugging and development.

Save Sample Game

$ python run.py save --team nym --date 2019-09-27 --name pete-alonso

List Available Sample Games

$ python run.py load

Load Sample Game

$ python run.py load --name pete-alonso

Help

Query

usage: run.py query [-h] --team TEAM [--date DATE] [--select {all,first,second,smart}]

optional arguments:
  -h, --help            show this help message and exit
  --team TEAM           team search term partical match for name, location, or abbreviation
  --date DATE           YYYY-MM-DD date to find game for, default today
  --select {all,first,second,smart}
                        filter games list

Save

python run.py save --help
usage: run.py save [-h] --team TEAM [--date DATE] --name NAME

optional arguments:
  -h, --help   show this help message and exit
  --team TEAM  team search term partical match for name, location, or abbreviation
  --date DATE  YYYY-MM-DD date to find game for, default today
  --name NAME  Save raw game data with input name to test with later

Load

python run.py load --help
usage: run.py load [-h] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit
  --name NAME  Load raw game data with input name instead of querying
  --select {all,first,second,smart}
                        filter games list

mlb-gameday-terminal's People

Contributors

pdumoulin avatar dependabot[bot] avatar

Stargazers

 avatar  avatar Noam  Vergain avatar Matthew Barber avatar Dan Thompson avatar

Watchers

Noam  Vergain avatar  avatar

Forkers

skimono

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.