Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added cli function to module and refactored #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions baseball/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@

from .baseball_helpers import (AUTOMATIC_BALL_POSITION,
EASTERN_TIMEZONE_STR,
STADIUM_TIMEZONE_DICT,
INCREMENT_BASE_DICT,
NO_HIT_CODE_LIST,
BASE_PLUS_ONE_DICT,
PLAY_CODE_ORDERED_DICT,
ON_BASE_SUMMARY_DICT,
POSITION_CODE_DICT,
strip_suffixes)

from baseball.schedule import fetch_schedule_summary

from baseball.events import (RunnerAdvance,
Substitution,
Switch,
Pitch,
Pickoff)

from baseball.game import (Game,
PlayerAppearance,
Team,
Inning,
PlateAppearance,
Player)

from baseball.fetch_game import (get_game_from_url,
get_game_xml_from_url,
get_game_dict_from_url,
Expand All @@ -10,16 +37,3 @@
write_games_for_date)

from baseball.process_game_xml import MLB_TEAM_CODE_DICT

from baseball.baseball import (PlayerAppearance,
Player,
Team,
Game,
Inning,
PlateAppearance)

from baseball.baseball_events import (Substitution,
Switch,
Pitch,
Pickoff,
RunnerAdvance)
5 changes: 5 additions & 0 deletions baseball/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sys

if __name__ == '__main__':
from baseball.cli import main as _main
sys.exit(_main())
Loading