Skip to content

danpoynor/python-basketball-stats-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Basketball Stats Tool

Demo console-based basketball team statistics app that divides a group of players into teams and presents statistics about each team.

Features

  • Uses various Python data types to store and manipulate data into organized team structures.
  • Cleans data from constants.py without changing the original data.
    • Converts string data into integers or floats.
    • Converts string data into Boolean values.
    • Converts string data into lists of strings.
  • Organizes player data evenly into teams ensuring each team has the same number of experienced and inexperienced players.
  • Provides Dunder Main usage examples in app.py entry point and dm.py module.
  • Presents data in a nice readable format using extra spaces and line breaks ('\n') to break up lines.
  • User is re-prompted with the main menu until they decide to "Quit the program".

Run the app

python3 app.py

NOTE: Python 3.10 was used to develop and test this app.


Run Unit Tests

Some basic unit tests are included to test the dm.py module.

Expand/Collapse To run the tests, use something like:
python3 -m unittest -v dm.py

and you should see some test result output like this:

test_balance_teams (dm.Tests) ... ok
test_calculate_avg_height (dm.Tests) ... ok
test_cleaned_players (dm.Tests) ... ok
test_create_string_from_list_of_lists (dm.Tests) ... ok
test_show_menu_options (dm.ToDoTests) ... skipped "TODO: When there's more time, test this"
test_show_team_stats (dm.ToDoTests) ... skipped "TODO: When there's more time, test this"

----------------------------------------------------------------------
Ran 6 tests in 0.001s

OK (skipped=2)

Note: If you run dm.py directly, with something like:

python3 dm.py

You should see test result output like this:

....ss
----------------------------------------------------------------------
Ran 6 tests in 0.000s

OK (skipped=2)

The ....ss indicates four tests ran and two were skipped.


Screenshot Showing Example Program States

Expand/Collapse Screen Shot 2022-07-05 at 11 06 45 AM

About

Demo console-based basketball team statistics app that divides a group of players into teams and presents statistics about each team.

Topics

Resources

Stars

Watchers

Forks

Languages