Skip to main content

GM standings and fixtures parser

Project description

# 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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unicorner-0.2.2.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

unicorner-0.2.2-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file unicorner-0.2.2.tar.gz.

File metadata

  • Download URL: unicorner-0.2.2.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for unicorner-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2e0f7dd3ac2c2e640d06ec11a54f052db2bdf2eacb54af5202ff3fae7323936a
MD5 9f2c1c55ab89f1ebd23a43d8c02b2808
BLAKE2b-256 597ceb25743647612d39a60512c73d13829f9dec66f2780e302c7fc2080c2fe4

See more details on using hashes here.

File details

Details for the file unicorner-0.2.2-py2.py3-none-any.whl.

File metadata

  • Download URL: unicorner-0.2.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for unicorner-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 17efe98cf43906196a6d1af6ee213414b28d0e034a90a1a3b468d2fd3b140615
MD5 9f208c648bbe2c118e2af986a54e76f4
BLAKE2b-256 df3f9a302a7d240c5f578a1450a052688e21ae07e2b7169f9b7c240c734f0fa8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page