1. Troy Williams
  2. bowling

Overview

5-Pin Bowling Statistics
========================


What is it?
-----------
It is a script that can generate a number of valuable statistics related to 5-pin bowling. It processes a custom file format ending with the '.bowl' file extension.


The Latest Version
------------------

The latest version of the software can be found here:

https://bitbucket.org/troy_williams/bowling/overview

The best way to stay up to date is by cloning the repository.


Documentation
-------------

The program is broken into two parts: bowler.py and league.py. The first part, bowler.py takes a path to a .bowl file where the individual bowler scores are recorded. It generates various statistics about the bowler. The second part, league.py generates various league statistics about a group of bowlers.

To determine bowler statistics issue the following command:
$python3 bowler.py ~/bowling_data/*.bowl

Here is the sample data that it generates:

Name: Bowler
Division: bantam
Lane: *******
Season: 2013-2014
Gender: M
Player ID: 123-456-780
Data: league
┌─────────────┬────────────────────────┬────────────┬─────────┬────────────────┬──────────────┬───────────────────┬─────────────────┐
│    Date     │        Matches         │ Total Pins │ Average │ Season Average │ % Difference │ Pins Over Average │ Total Pins Over │
├─────────────┼────────────────────────┼────────────┼─────────┼────────────────┼──────────────┼───────────────────┼─────────────────┤
│ 2013-09-14  │     88,     70,     67 │    225     │  75.00  │     75.00      │    +0.00     │    13,   0,   0   │       13        │
├─────────────┼────────────────────────┼────────────┼─────────┼────────────────┼──────────────┼───────────────────┼─────────────────┤
│ 2013-09-21  │    104,     96,     79 │    279     │  93.00  │     84.00      │    +9.68     │    20,  12,   0   │       32        │
├─────────────┼────────────────────────┼────────────┼─────────┼────────────────┼──────────────┼───────────────────┼─────────────────┤
│ 2013-09-28* │     59,     83,    116 │    258     │  86.00  │     84.67      │    +1.55     │     0,   0,  31   │       31        │
├─────────────┼────────────────────────┼────────────┼─────────┼────────────────┼──────────────┼───────────────────┼─────────────────┤
│ 2013-10-05  │     74,     80,    132 │    286     │  95.33  │     87.33      │    +8.39     │     0,   0,  45   │       45        │
├─────────────┼────────────────────────┼────────────┼─────────┼────────────────┼──────────────┼───────────────────┼─────────────────┤
│             │  81.25, 82.25, 98.50   │    1048    │         │                │              │                   │       121       │
└─────────────┴────────────────────────┴────────────┴─────────┴────────────────┴──────────────┴───────────────────┴─────────────────┘

In addition to writing to the console, it automaticaly generates files: text and tab-delimited. The text is visually pleasing and a quick way to look at the data. The tab-delimted format is suitable for pasting into your favorite spreadsheet. NOTE: These files will be replaced with new versions everytime the script is executed

To generate league statistics issue the following command:
$python3 league.py ~/bowling_data/*.bowl

The following data is genrated (as output to the terminal and a file):

Season Averages (Girls)
┌─────────┬─────────┐
│ Bowler  │ Average │
├─────────┼─────────┤
│ Bowler 1│  91.25  │
├─────────┼─────────┤
│ Bowler 2│  87.25  │
└─────────┴─────────┘

Season Averages (Boys)
┌───────────┬─────────┐
│  Bowler   │ Average │
├───────────┼─────────┤
│  Bowler 1 │ 107.00  │
├───────────┼─────────┤
│  Bowler 2 │  92.92  │
├───────────┼─────────┤
│  Bowler 3 │  87.33  │
├───────────┼─────────┤
│  Bowler 4 │  86.75  │
├───────────┼─────────┤
│  Bowler 5 │  47.58  │
├───────────┼─────────┤
│  Bowler 6 │  38.83  │
├───────────┼─────────┤
│  Bowler 7 │  31.83  │
└───────────┴─────────┘

High Singles (Girls)
┌─────────┬──────────────┐
│ Bowler  │ High Singles │
├─────────┼──────────────┤
│ Bowler 1│     116      │
├─────────┼──────────────┤
│ Bowler 2│     108      │
└─────────┴──────────────┘

High Singles (Boys)
┌───────────┬──────────────┐
│  Bowler   │ High Singles │
├───────────┼──────────────┤
│  Bowler 1 │     175      │
├───────────┼──────────────┤
│  Bowler 2 │     140      │
├───────────┼──────────────┤
│  Bowler 3 │     132      │
├───────────┼──────────────┤
│  Bowler 4 │     125      │
├───────────┼──────────────┤
│  Bowler 5 │     116      │
├───────────┼──────────────┤
│  Bowler 6 │      79      │
├───────────┼──────────────┤
│  Bowler 7 │      78      │
└───────────┴──────────────┘

High Triples (Girls)
┌─────────┬──────────────┐
│ Bowler  │ High Triples │
├─────────┼──────────────┤
│ Bowler 1│     298      │
├─────────┼──────────────┤
│ Bowler 2│     266      │
└─────────┴──────────────┘

High Triples (Boys)
┌───────────┬──────────────┐
│  Bowler   │ High Triples │
├───────────┼──────────────┤
│ Bowler 1  │     466      │
├───────────┼──────────────┤
│ Bowler 2  │     368      │
├───────────┼──────────────┤
│ Bowler 3  │     351      │
├───────────┼──────────────┤
│ Bowler 4  │     286      │
├───────────┼──────────────┤
│ Bowler 5  │     280      │
├───────────┼──────────────┤
│ Bowler 6  │     222      │
├───────────┼──────────────┤
│ Bowler 7  │     212      │
└───────────┴──────────────┘

The following statistics are also calculated:
- Pin Counts
- Pins Over Average by Month
- Average by Game
- Singles Badges
- Triples Badges


.bowl file format
-----------------

See the included 'bowler_data(2012-2013).bowl' sample file for details on the .bowl file format.


Installation
------------

In order for the script to run properly you will require python 3. The software was written against python v3.3.0 but it should work on any version of python 3.

The best way to install the software is by cloning the repository to a local folder:
hg clone ssh://hg@bitbucket.org/troy_williams/bowling

If you cannot clone the repository, then you can download the files from here:
https://bitbucket.org/troy_williams/bowling/src

In the repository are the following files:
- bowler.py - Generates season statistics for the bowler.
- bowler.tests.py - Unit tests for bowler.py.
- league.py - Generates league statistics for a set of bowlers.
- table.py - This contains the code to create the ascii tables.
- License.text - The license that that project is released under.
- README.txt - This file.
- bowler_data(2012-2013).bowl - A sample bowl file that contains details on the bowl file format (optional)

All of the files need to be in the same folder in order for it to function correctly. The folder can be located anywhere on your system, preferably your home folder.


Licensing
---------

Refer to 'License.txt'.


Contacts
--------

Any issues or enhancement requests should be added to the issue tracker located here:
https://bitbucket.org/troy_williams/bowling/issues?status=new&status=open