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

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.2.1

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.1
File Size Uploaded Provenance Actions
polyhattrick-0.2.1.tar.gz 15.9 kB Without provenance Details for polyhattrick-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 35.6 kB

Release files / polyhattrick-0.2.1.tar.gz

Download URL polyhattrick-0.2.1.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b33d32926feeb93ec953ee0d72de415fe9db77d434ad9d2e5aa4fda6c70fdeaf
BLAKE2b-256 checksum
How to use checksums
d10fae934355a8264dfa1dfec0edd7a7d5e68f48dfa4ffd1cab90143d3c8f71b
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.1-py3-none-any.whl

Download URL polyhattrick-0.2.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a83244a6b5c8bf525324f6c4497c806e76c748e381a09a9ecba47ed62aabde6
BLAKE2b-256 checksum
How to use checksums
1ca77a096f99515a5f29befaf2d933d128a800df9d241760e491163c141bc45e
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.1

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