Skip to main content

# unicorner

GM season standings and fixtures parser as a reusable library.

This library can change at any time. Same applies to GM’s actual websites. Use at your own risk.

### Install

pip install unicorner

### Usage

#### Parsing Standings and Fixtures Pages

Standings page has to parsed before fixtures can be parsed.

from unicorner import SeasonParse

sp = SeasonParse() sp.parse_standings_page(path=”standings.html”) sp.parse_fixtures_page(path=”fixtures.html”) print(sp.game_days[0])

#### Extracting to CSV

python -m unicorner extract_all –help

### GM Data Model Issues

  • GM does not store the historical team names - only the latest version of the name is preserved.

  • In the past, GM would reuse the same team object for unrelated groups of people so you would have one season TeamId=23 point to to Team A and the next season, if all the people of Team A left, TeamId=23 could point to another group of players Team B. You would see this in team history page which would show past games that the new group of players had never heard of.

Both of the above are caused by not having a season-team model.

We work around this by first introducing the concept of Franchise - the identity of a group of players playing together that spans over more than one season. Each franchise should be given an ID which is independent from GM IDs. These can be maintained in a franchises.csv file.

Then, for each season that a franchise joins, we create a separate Team object whose ID is a concatenation of zero-padded GM season’s ID and team ID. For example, team identified by GM with TeamId=23 playing in season SeasonId=101 gets ID 0101.23

Each such team can have its own name so every season a franchise can use a different name. The mapping from teams to franchises is maintained in a franchise_seasons.csv file.

Examples of both files can be found under tests/data/

### GM Data Issues

GM data is very much like their operations. Sometimes there’s no score or the score is incorrect, the winner is wrong, or the game is marked incorrectly say as a final when it isn’t a final etc. etc. To fix these issues use score_overrides.csv file.

Metadata

Release files for unicorner 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unicorner 0.3.4
File Size Uploaded
unicorner-0.3.4.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unicorner 0.3.4
File Interpreter ABI Platform
unicorner-0.3.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 38.0 kB

Release files / unicorner-0.3.4.tar.gz

Download URL unicorner-0.3.4.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96f4fdf98d6f0710997da5f4320aa0243fe7fcb40c8128af9ed518861784f3e3
BLAKE2b-256 checksum
How to use checksums
be7286b586f7ba4d1441ce26587bcd0ca0a9acc24b4144276728ceadc0957ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

Release files / unicorner-0.3.4-py2.py3-none-any.whl

Download URL unicorner-0.3.4-py2.py3-none-any.whl
Size 11.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4b7509f534ae6faa7f9f92c054f2d7ff8c97ba16894f0928c234c23b8e434cf3
BLAKE2b-256 checksum
How to use checksums
aab697da53512c6883b15da089e741302a1f88f3213997a961720b2703b5905b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page