Metadata-Version: 2.4
Name: polyhattrick
Version: 0.1.0
Summary: Live Hattrick scores in your terminal and polybar
License-Expression: MIT
License-File: LICENSE
Author: Peter Toth
Author-email: work@petertoth.de
Requires-Python: >=3.12,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: anyio (==4.12.0)
Requires-Dist: black (==25.12.0)
Requires-Dist: build (==1.3.0)
Requires-Dist: cachecontrol (==0.14.4)
Requires-Dist: certifi (==2025.11.12)
Requires-Dist: cffi (==2.0.0)
Requires-Dist: charset-normalizer (==3.4.4)
Requires-Dist: cleo (==2.1.0)
Requires-Dist: click (==8.3.1)
Requires-Dist: crashtest (==0.4.1)
Requires-Dist: cryptography (==46.0.3)
Requires-Dist: distlib (==0.4.0)
Requires-Dist: dulwich (==0.24.10)
Requires-Dist: fastjsonschema (==2.21.2)
Requires-Dist: filelock (==3.20.0)
Requires-Dist: findpython (==0.7.1)
Requires-Dist: h11 (==0.16.0)
Requires-Dist: httpcore (==1.0.9)
Requires-Dist: httpx (==0.28.1)
Requires-Dist: idna (==3.11)
Requires-Dist: installer (==0.7.0)
Requires-Dist: jaraco-classes (==3.4.0)
Requires-Dist: jaraco-context (==6.0.1)
Requires-Dist: jaraco-functools (==4.3.0)
Requires-Dist: jeepney (==0.9.0)
Requires-Dist: keyring (==25.7.0)
Requires-Dist: markdown-it-py (==4.0.0)
Requires-Dist: mdurl (==0.1.2)
Requires-Dist: more-itertools (==10.8.0)
Requires-Dist: msgpack (==1.1.2)
Requires-Dist: mypy-extensions (==1.1.0)
Requires-Dist: packaging (==25.0)
Requires-Dist: pathspec (==0.12.1)
Requires-Dist: pbs-installer (==2025.12.5)
Requires-Dist: pkginfo (==1.12.1.2)
Requires-Dist: platformdirs (==4.5.0)
Requires-Dist: poetry (==2.2.1)
Requires-Dist: poetry-core (==2.2.1)
Requires-Dist: pycparser (==2.23)
Requires-Dist: pygments (==2.19.2)
Requires-Dist: pyproject-hooks (==1.2.0)
Requires-Dist: pytokens (==0.3.0)
Requires-Dist: rapidfuzz (==3.14.3)
Requires-Dist: requests (==2.32.5)
Requires-Dist: requests-toolbelt (==1.0.0)
Requires-Dist: rich (==14.2.0)
Requires-Dist: secretstorage (==3.5.0)
Requires-Dist: shellingham (==1.5.4)
Requires-Dist: tomlkit (==0.13.3)
Requires-Dist: trove-classifiers (==2025.12.1.14)
Requires-Dist: typer (==0.20.0)
Requires-Dist: typing-extensions (==4.15.0)
Requires-Dist: urllib3 (==2.5.0)
Requires-Dist: virtualenv (==20.35.4)
Requires-Dist: zstandard (==0.25.0)
Description-Content-Type: text/markdown

# polyhattrick

`polyhattrick` is a simple command-line utility for fetching live match scores from [Hattrick](https://www.hattrick.org). It can be easily integrated into `polybar`, allowing you to see how your team is performing live directly on your desktop.

---

## Installation

Install `polyhattrick` using `pip`:

```bash
pip install polyhattrick
```

## Authentication

Before you can display match results in your terminal or in polybar, you need to authorize polyhattrick to access your match data on Hattrick.

First, start the authentication process:

```bash
polyhattrick login authenticate
```

This command will generate a login link. Open it in your browser to log in to Hattrick and authorize polyhattrick. Once authorized, Hattrick will display a token. Copy this token and complete the authorization process:

```bash
polyhattrick login exchange [TOKEN]
```

## Usage

After authentication, you can start fetching live match results.

To display the score of the first match in your live ticker on Hattrick, run:

```bash
polyhattrick match live watch
```

If you want to see the result of a different match, reorder your live ticker on the Hattrick website so that the desired match appears first.

## Integration with polybar

To display live match results in polybar, add the following module to your polybar configuration:

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

Then place the module wherever you want it to appear in your bar.

## Notes

- This tool is intended for Linux systems.

- Make sure polyhattrick is available in your PATH when used with polybar.

