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

Metadata

Release files for pychanga 0.1.2

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

Source distribution (sdist)

Source distribution for pychanga 0.1.2
File Size Uploaded Provenance Actions
pychanga-0.1.2.tar.gz 63.3 kB Without provenance Details for pychanga-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pychanga 0.1.2
File Interpreter ABI Platform Actions
pychanga-0.1.2-py3-none-any.whl Python 3 none any Details for pychanga-0.1.2-py3-none-any.whl

Total release size: 135.6 kB

Release files / pychanga-0.1.2.tar.gz

Download URL pychanga-0.1.2.tar.gz
Size 63.3 kB
Tags Source
SHA-256 checksum
How to use checksums
30400f7813f4537e26bd4ed6fc5f61781e25d69d1ba1d48faf984d4a40363a11
BLAKE2b-256 checksum
How to use checksums
620164fd1fffc52a88344ca9eb8ba3366f5807b4b2a1c7313aeacd5b096f82e0
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pychanga-0.1.2-py3-none-any.whl

Download URL pychanga-0.1.2-py3-none-any.whl
Size 72.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd0a9ffb58021cbbd2a2df4267a67351402d2b87c45d89a734c8118905e9104d
BLAKE2b-256 checksum
How to use checksums
52ac34a764fbd43ea9a10a9255da4d1c9f79bb9d8bd55078d394a84ea8a59dc4
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for pychanga 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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