Skip to main content

Title Belt Calculator

Finds the shortest path to having a shot at the belt for a given team and belt holder.

Setup

poetry install

# either open a poetry shell to run everything
poetry shell

# or run individual commands with the poetry run prefix
poetry run title-belt-nhl

The following steps assume you are in a poetry shell. Add poetry run at the beginning of commands if not.

Usage

Run with title-belt-nhl.

$ title-belt-nhl --help

Usage: title-belt-nhl [OPTIONS]

Options:
  --team TEXT    [required]
  --season TEXT
  --help         Show this message and exit.

Commands:
  belt-path
  path
  path-alt
  • use path-alt to get a list of games recursively
  • use path to get the nested list of games iteratively, containing all evaluated games with the shortest path marked
  • use belt-path to get the list of complete games that the belt has traveled so far, plus the next title belt match

Linting and Formatting

Linting

ruff check title_belt_nhl

Fix Lint Errors

ruff check --fix title_belt_nhl

Formatting

ruff format title_belt_nhl

Autoformat on save (vscode)

  1. Install ruff extension
  2. Update settings in .vscode/settings.json:
    {
        "[python]": {
          "editor.formatOnSave": true,
          "editor.defaultFormatter": "charliermarsh.ruff",
          "editor.codeActionsOnSave": {
            "source.fixAll": "explicit"
          }
        }
    }
    
  3. Ensure you are using the python interpreter from the poetry shell.
    • Open command palette (Ctrl+Shift+P)

    • Python: Select Interpreter

    • "Select at workspace level"

    • "Enter interpreter path"

    • Copy/paste the path to your poetry virtualenv

      • Run poetry env info and copy the path to the Executable under Virtualenv
      • Should be something like /home/user/.cache/pypoetry/virtualenvs/title-belt-nhl-asdf1234-py3.10/bin/python
    • When you open a python file in vscode, the bottom right corner of the window should show something like:

      Python  3.10.14 ("title-belt-nhl-asdf1234-py3.10": poetry)
      

Testing

Run poetry run pytest to run through any tests in the ./title_belt_nhl/tests folder

Metadata

Release files for title-belt-nhl 0.3.6

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

Source distribution (sdist)

Source distribution for title-belt-nhl 0.3.6
File Size Uploaded
title_belt_nhl-0.3.6.tar.gz 30.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for title-belt-nhl 0.3.6
File Interpreter ABI Platform
title_belt_nhl-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 62.2 kB

Release files / title_belt_nhl-0.3.6.tar.gz

Download URL title_belt_nhl-0.3.6.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c467d1b634cb2ba6c1a3c9340c94f9b2fa3e91f37885cf60bd06f4403767223e
BLAKE2b-256 checksum
How to use checksums
b31443a750216f89e52cd0168e50304304faa54fab8a56d8d1fb6c1e1300b6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.

Transparency log

Release files / title_belt_nhl-0.3.6-py3-none-any.whl

Download URL title_belt_nhl-0.3.6-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dc59784bb23f562bbd25e236fa13460ebd8e31c4c1b706953995b399b4a9ac0
BLAKE2b-256 checksum
How to use checksums
4c1ba1bc811fc7885778c6afd2738cfe854e45048b126065748fa62f2eec16b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

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