Skip to main content

A typed Python SDK for working with OpenPowerlifting data

Project description

opl-py

A typed Python SDK for working with OpenPowerlifting data. Query lifters, meets, and rankings from a local DuckDB database built from the official OpenPowerlifting bulk CSV. Includes optional ML-based trajectory prediction analytics module.

0. Installation

pip install opl-py

For analytics features (trajectory prediction, percentile rankings):

pip install opl-py[analytics]

For dev features (type-checking, testing, linting, formatting, publishing):

pip install opl-py[dev]

1. Quick Start

Download and ingest the full OPL dataset (~250 MB) into a local DuckDB file:

opl init

Then query it from Python:

import opl

client = opl.OPL()

# Look up a lifter
lifter = client.lifter("Ray Williams #1")
print(lifter.best_total_kg)       # 1104.5
print(lifter.competition_count)   # 30

for entry in lifter.history():
    print(f"{entry.date}: {entry.total_kg}kg @ {entry.bodyweight_kg}kg")

# Query rankings
top_raw = client.rankings(
    sex=opl.Sex.MALE,
    equipment=opl.Equipment.RAW,
    event=opl.Event.SBD,
    weight_class="93",
    order_by="dots",
    limit=10,
)

# Raw SQL for custom queries
results = client.query(
    "SELECT Federation, COUNT(*) as n FROM entries GROUP BY Federation ORDER BY n DESC LIMIT 10"
)

Documentation

Guide Description
CLI Command-line interface — opl init, opl update, opl info
SDK Python client, models, and enums
Analytics Percentile rankings, feature extraction, trajectory prediction
Development Local setup, linting, testing, Make targets

Attribution

This project uses data from the OpenPowerlifting project. OpenPowerlifting data is contributed to the public domain.

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

opl_py-0.1.0.tar.gz (935.9 kB view details)

Uploaded Source

Built Distribution

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

opl_py-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opl_py-0.1.0.tar.gz
  • Upload date:
  • Size: 935.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opl_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 632c8b64f3de57de401260faa1000c2e9127fdab9039d180f05b633b90e292d0
MD5 e81402d43ee7d7dec7e28eedd151e6bc
BLAKE2b-256 4d13b55081d53ec1784f23b4f065ef4e2f32922accc95af6a338fca550b4dc3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for opl_py-0.1.0.tar.gz:

Publisher: publish.yml on yaq1n0/opl-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: opl_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opl_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb136e0daa6f9332d20902f4d1591828bd0a6e3a3c02a00c3dfbdf6db77b4641
MD5 8fdcf277920d3ae5e01e5f045150be86
BLAKE2b-256 43d57bcfa829bd365258b3a7bcc1060fbb0954fc48507174768cbbc25fdf3e18

See more details on using hashes here.

Provenance

The following attestation bundles were made for opl_py-0.1.0-py3-none-any.whl:

Publisher: publish.yml on yaq1n0/opl-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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