Skip to main content

*-# pychanga - python-based sports database manager

Pychanga (pronounced as the Chilean Spanish word) is a light-weight sports database manager written in python, using polars and parquet files. It is the db manager in golessonamores.cl, a Chilean football stats website launched in 2018. This code started as a rewritten version of this website's original code (written in php). As a python package aims to provide support for different sports and its user target are sports stats aficionados with some basic python knowledge and access to data.

Install

install it with pip: py -m pip install pychanga

Data configuration

pychanga is now data-root driven. Your app must point pychanga to a folder that contains:

  • parquet/*.parquet for runtime queries
  • optionally csv/*.csv if you run conversion scripts

You can configure it in two ways:

  • Environment variable: PYCHANGA_DATA_DIR=/path/to/data_root
  • Runtime setup:
import pychanga as pc

pc.set_data_dir("/path/to/data_root")
comp = pc.Competition("CHI-1A")

If neither is configured, pychanga will try a local .dirs file (for backwards compatibility), and then a bundled sample dataset.

Build sample dataset

To generate a minimal sample dataset from your Golessonamores data:

python dev/build_sample_dataset.py \
	--source-data-dir /path/to/golessonamores/data \
	--target-data-dir sample \
	--comp-id CHI-1A \
	--edition-id CHI-1A-1994

This creates sample/parquet/*.parquet with only:

  • competition CHI-1A
  • edition CHI-1A-1994
  • teams that appear in those matches
  • related reference tables (sports, countries, stages, sources, etc.)

Features

  • It provides some classes to represent sports entities, such as: Competition, Edition, Team, Player, Match, Ground, Sport, among others.
  • It provides classes to ask some common queries, such as: HeadToHead, Streaks,
  • Each class provides methods to retrieve stats based on an id.
  • The queries are all written in polars' DSL (domain specific language)

Example

Documentation

Collaboration

Download files

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

Source Distribution

pychanga-0.1.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pychanga-0.1.0-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

Details for the file pychanga-0.1.0.tar.gz.

File metadata

  • Download URL: pychanga-0.1.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pychanga-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6afcbb69f6b7696f3a74aee6cb2f541ba34783c4acc3cd053c0474537a12f48e
MD5 13ec625411b5cf59f39aa13bb9b32eb5
BLAKE2b-256 cbc2d1ff8255c8c8a8bf7719ac4de2240b6a5ae77932ac2d07a62a3ba22e695d

See more details on using hashes here.

File details

Details for the file pychanga-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pychanga-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pychanga-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03177cf3fb9d1d827ba2ffa881eb625149885cb6dead096b2977662514109586
MD5 a61d294a222dd12f355ba65150a4b531
BLAKE2b-256 6497010a74745829a996bfdb66f3c36114fa4be052a4be2ec3dbd4d423b324f8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 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