Hattifnatt watches a directory for changes and creates, updates or deletes files in a Telegram channel accordingly. File digests and message IDs are persisted in a state file (named .hat), so even updates that occur when the watcher is not running will be pushed correctly. Note that Telegram will sometimes corrupt the file names on upload; this will not break anything, but cannot be fixed by this tool, either. Any Telegram chat could theoretically be used—not necessarily a channel—but the bot API limits deletion of old messages in personal chats.
A single command-line tool is provided, hat, that watches the current directory, reads the Telegram bot token from the environment variable TOKEN, the Telegram chat ID from the environment variable CHAT, and the glob patterns to watch from the command-line arguments (all files are watched by default). The tool can be stopped by ^C.
Alternatively, the function hattifnatt.push(chat, patterns) performs the same function programmatically. It accepts chat, a telegram.Chat object (obtained from telegram.Bot.get_chat), and a list of glob patterns. For now it does not support pushing directories other than the current one.
Release files for hattifnatt 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hattifnatt-0.2.1.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hattifnatt-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.0 kB
Release files / hattifnatt-0.2.1.tar.gz
| Download URL | hattifnatt-0.2.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f10ff1f1e29590ce4bc25c7bbeecb5778bf4732118294543f0632cdc9139830
|
|
BLAKE2b-256 checksum How to use checksums |
ff1ee1e9220f9ccff8094a71c866128c834211450ac2bb2fac8ad95df58f4484
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
|
Release files / hattifnatt-0.2.1-py3-none-any.whl
| Download URL | hattifnatt-0.2.1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
630893b084af75e460a90d24b51b3185cf0323b68167415719e41e9729d7b467
|
|
BLAKE2b-256 checksum How to use checksums |
4976980faa10787a28d6dfd2b5b3eca18fd1a71c887a3dcb177d90213711eaf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
|