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.

Commands

polyhattrick team list                # your teams
polyhattrick team show                # league, series, cup, power rating
polyhattrick series show              # your series table
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 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).

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 player opens the player, 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
tips = false                      # never show the support reminder

POLYHATTRICK_SERVER overrides server for a single run.

Support

polyhattrick is free. polyhattrick support tells you how to support it. Now and then, after a command, one line reminds you of that; it never shows in scripts, and tips = false turns it off.

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.2.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.2.0
File Size Uploaded Provenance Actions
polyhattrick-0.2.0.tar.gz 15.3 kB Without provenance Details for polyhattrick-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.2 kB

Release files / polyhattrick-0.2.0.tar.gz

Download URL polyhattrick-0.2.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4ef7054324d517331c61dbdf5565773748e8c838e07cc1330a90e9d231bab9f7
BLAKE2b-256 checksum
How to use checksums
39e12ee9b1e580924e2d4e84bd1fd9a5dae31afc699f528c3ebedf75c2fc4f65
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.2.0-py3-none-any.whl

Download URL polyhattrick-0.2.0-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07a55ef54517f731721f8ca0d5e78a90d7f7cbbeded78788f236878c45fa2aa4
BLAKE2b-256 checksum
How to use checksums
6673eca7441180f808bceb672216a272cc4ed0e8c9ded40be799b90e7e8bd511
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.2.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