GitDiaryBot
Telegram bot, that writes incoming messages to a text file and synchronizes using Git repository. In addition to plain text input it also understands locations, voice recordings and photos.
The bot is meant to be self-hosted. Demo bot is running in multi-user mode and can be used for trial.
Decisions and Trade-offs
Problem
I want to keep a private journal/diary. I post there what’s important for me at the moment. Sometimes I reorganize the content, edit old records. I don’t want to share any part of it.
Requirements
GitDiaryBot has to be:
Private - no third party should be able to the diary, or control it.
Simple - no special software should be needed to read/write the records.
Reliable - network/hard drive failures should not result in lost or unsaved records.
Independent - supports self-hosted server side, private repositories.
Choices
GitDiaryBot is designed from three assumptions:
Diary is a single plain text file, that grows by appending records.
Git is used for synchronization and backup.
New records come from messages to a chat bot.
While each part can be replaced, the primary goal is to have this combination working.
OOP Architecture
Dispatcher is reacting to Telegram.Bot updates by delegating to 2 classes:
Installer
Receiver
Receiver attempts to load tenant using effective user ID from incoming update. If tenant does not exists, Dispatcher calls Installer to run installation flow.
For successfully loaded Tenant, Dispatcher calls Receiver which extracts GitDiaryBot Events from Telegram Update Message and invokes appropriate handler.
Handlers processes Events using Core classes.
Core classes’ responsibilities are:
Save journaling records.
Synchronize with upstream.
Transcribe voice.
Geocode coordinates.
Annotate photos.
Core classes are not allowed to import anything outside core directory.
Transformers use core classes to extract plain text records from other media.
Skill combines telegram filter, extractor, event type and handler. Skillset defines capabilities available to a Tenant.
Metadata
Release files for GitDiaryBot 0.0.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 | Provenance | Actions |
|---|---|---|---|---|
| GitDiaryBot-0.0.1.tar.gz | 17.5 kB | Without provenance | Details for GitDiaryBot-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| GitDiaryBot-0.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for GitDiaryBot-0.0.1-py2.py3-none-any.whl |
Total release size: 40.6 kB
Release files / GitDiaryBot-0.0.1.tar.gz
| Download URL | GitDiaryBot-0.0.1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15a2a2055c8ec2db530e86eeb06b5025b1f841d523852fcdf8e6b9981a48c4ca
|
|
BLAKE2b-256 checksum How to use checksums |
04eb402526d0ad4628c858e1232887a0ef206d62550f21bec2280b20c1f11fa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8
|
Release files / GitDiaryBot-0.0.1-py2.py3-none-any.whl
| Download URL | GitDiaryBot-0.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f6b56be2fac54583ac59e194c5ad1ec1371b3430a09316eb252db240f07e02bb
|
|
BLAKE2b-256 checksum How to use checksums |
80233d98966d47d57f4f0492b7698a24e82267a44a47fc8ae1b28a87f4a93ab7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8
|
Security for GitDiaryBot 0.0.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.