Skip to main content

CLI tool to compute NHL Title Belt info.

Project description

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:
  path
  path-alt
  • use path-alt to get a string showing list of games
  • use path to get the list of games using a diff algorithm

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

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

title_belt_nhl-0.3.2.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

title_belt_nhl-0.3.2-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file title_belt_nhl-0.3.2.tar.gz.

File metadata

  • Download URL: title_belt_nhl-0.3.2.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for title_belt_nhl-0.3.2.tar.gz
Algorithm Hash digest
SHA256 040330b94c696c77edf8649c44eec172a077e18c9dd0f9da16012e79305bbfb9
MD5 d7935bfb1c76f5b1ad2778f440714bbf
BLAKE2b-256 e7887b1fb5506f2f421e5aa4fc8a3d800498ad80d2c6840b5c3844c48285126c

See more details on using hashes here.

Provenance

File details

Details for the file title_belt_nhl-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for title_belt_nhl-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aa1115b93d5b6fa6767173c2dda9b81faa16e2035bb5a8fe0e6fff63142aca5e
MD5 051a7484bb23ef0cfc4be8aa6216b5ad
BLAKE2b-256 492dd0ea516ace70fc9b89c8087f68cf4faa1965386c8cf14025ad69218b2e32

See more details on using hashes here.

Provenance

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