Skip to main content

A Telegram bot to interact with Gancio instances

Project description

gancio_telegram_bot

gancio_telegram_bot is a bot which allows to interact with a specified Gancio instance. Gancio is a shared agenda for local communities, a project which wants to provide a self-hosted solution to host and organize events.

screen-gif

Installation

To install the latest version of the bot just download (or clone) the current project, open a terminal and run the following commands:

pip install -r requirements.txt
pip install .

Alternatively, use pip:

pip install gancio_telegram_bot

It's also possible to create a docker image and run the application in a container; see Docker usage.

Dependencies

At the moment I have tested the bot only on python == 3.10.4
The bot requires the dependencies specified in requirements.txt and I haven't still tested other versions.

Usage

Configuration file (.env)

The bot relies on environment variables for its configuration; some parameters are strictly required (e.g. AUTH_TOKEN, INSTANCE_URL), while others just allow to personalize the bot appearance.

Parameter Function
AUTH_TOKEN Telegram bot authentication token
INSTANCE_URL Url of the gancio instance from which fetch the events
SHOW_EVENT_URL Set to "True" if each event must be accompanied by its url on the Gancio instance (default is False)
MENU_ELEMENTS Number of events to show in a single message (default is 3)
CACHE_NAME Path to the database used for caching (default disable the cache mechanism)
HTTP_CACHE_EXPIRATION_SECONDS How many seconds the cache lasts (default is 10 minutes)

Command line interface

python3 -m gancio_telegram_bot

Docker

docker compose up -d

Visualisation

The package comes up with some functions to allow the parsing of the logfile and the visualisation of statistics related to the usage of the bot.

Todolist

  • Better define which versions of python and dependency packages are compatible.
  • Create some tests.
  • Allow to define more fine-grained queries for the events (e.g. display just the events in a specific date).
  • Make more visualisation plots.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gancio_telegram_bot-0.1.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gancio_telegram_bot-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file gancio_telegram_bot-0.1.0.tar.gz.

File metadata

  • Download URL: gancio_telegram_bot-0.1.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for gancio_telegram_bot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b696930562c643784d1cca42e034edb10759f9052ca7d679a2fe9fb185a0baa
MD5 589bc8566cfd5e8cd4d4bf8fe6e25531
BLAKE2b-256 c19851c5e70ac470b2c76956355e980ef2e9cc203cf91c874a0dc03529fb6eda

See more details on using hashes here.

File details

Details for the file gancio_telegram_bot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gancio_telegram_bot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for gancio_telegram_bot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecfc1bdc76a4f3117a4be08e5d300eec6ea463d80ea88fc1ea511faa2c24c257
MD5 309b759386559ddc4a1b35184f9860e1
BLAKE2b-256 f976128f182d757dcaf4983b06c0470276ca0d7b93fb73e95b9d9f52ffb4888a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page