Skip to main content

polyhattrick

Your Hattrick club in the terminal: team, league table, squad, players, training, staff and matches, as tables, as JSON for scripts, or in a full-screen interface. It also puts your live match score in polybar.

polyhattrick only reads your data; it cannot change anything in your club.


Installation

pip install polyhattrick

Logging in

polyhattrick login start

Open the page it prints, allow polyhattrick to read your data, and copy the PIN Hattrick shows you. Then:

polyhattrick login finish PIN

The login stays valid until you revoke it on Hattrick. polyhattrick logout removes it from this machine.

Commands

polyhattrick team list                # your teams
polyhattrick team show                # league, series, cup, power rating
polyhattrick series show              # your series table, with promotion and relegation places
polyhattrick series fixtures          # every match of your series this season (--season -1, --round N)
polyhattrick players list             # the squad with skills
polyhattrick player show PLAYER_ID    # one player in full
polyhattrick training show            # this week's and last week's training
polyhattrick club show                # staff levels and youth academy
polyhattrick matches list             # recent and upcoming matches
polyhattrick matches history          # every match of this season (--season -1 for the last one, --type league)
polyhattrick match show MATCH_ID      # ratings, key moments and both lineups (--events, --no-lineups, --team ID)
polyhattrick challenges list          # friendly challenges made and received
polyhattrick cups list                # your league's cups and the round each has reached
polyhattrick cup show                 # your cup round, starting at your match (CUP_ID, --round, --after for the next page)
polyhattrick browse                   # the full-screen interface

Commands about a team use your primary club; pass --team TEAM_ID for another one (polyhattrick team list shows the identifiers). The match lists show each match's identifier for match show. Tournament and ladder matches have their own numbering, so their identifiers carry a prefix (hto-41870715); --json output has the plain number with "source_system" instead.

In scripts

Every read command takes --json and then prints the server's response unchanged on stdout. Errors go to stderr, and the exit code tells what went wrong: 0 success, 1 something to fix on your side (not logged in, wrong identifier, not your team), 2 the server or Hattrick failed.

polyhattrick players list --json | jq '.[] | {name: .last_name, playmaking: .skills.playmaking}'

The full-screen interface

polyhattrick browse shows the same sections on one screen. Arrow keys move, enter on a section moves into it, enter on a player or a played match opens it, escape goes back, r refreshes, t switches to your next team, q quits.

Integration with polybar

polyhattrick match live watch

prints the first match on your Hattrick live ticker as one line, and nothing at all if something fails, so the bar never fills with error text. Add it as a module:

[module/hattrick]
type = custom/script
exec = polyhattrick match live watch

To show a different match, reorder your live ticker on the Hattrick website.

Configuration

Optional, in ~/.config/polyhattrick/configuration.toml:

server = "https://api.polyhattrick.sesamemonster.de"   # the polyhattrick server to use

POLYHATTRICK_SERVER overrides server for a single run.

Notes

  • Made for Linux.
  • The polyhattrick login authenticate and login exchange commands from version 0.1.0 still work.

Metadata

Release files for polyhattrick 0.4.0

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

Source distribution (sdist)

Source distribution for polyhattrick 0.4.0
File Size Uploaded Provenance Actions
polyhattrick-0.4.0.tar.gz 24.5 kB Without provenance Details for polyhattrick-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 52.3 kB

Release files / polyhattrick-0.4.0.tar.gz

Download URL polyhattrick-0.4.0.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db594818eed1f1ac4db5fb4fcc5a422a03325c282ace73c6283abd59c64e67f4
BLAKE2b-256 checksum
How to use checksums
cd899504468aa81437c7ed1e78b784dd559d38d7e09ed357d8a68ffefcda4e5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / polyhattrick-0.4.0-py3-none-any.whl

Download URL polyhattrick-0.4.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c37b4092556d6b4dfdfb96e5f5fdd9e8c6fc434d9014cf83fc38b2dcc236717c
BLAKE2b-256 checksum
How to use checksums
b35a157fc7358755b834af56e0da3b40ca5e3cdc528735cc02f875e50efb3c63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for polyhattrick 0.4.0

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