ggp

command module
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GGP - Golden Gym Predictor Telegram Bot

Go Version License

A Telegram bot that tracks gym occupancy, predicts future load using statistical analysis, and displays visual charts.

Features

  • Periodic gym load data fetching from external API
  • Load prediction using weighted statistical analysis with holiday awareness
  • Visual charts for half-day, day, and week periods
  • Holiday calendar integration
  • CSV data import support
  • Admin-only features via configuration

Requirements

  • Go 1.25 or later
  • Telegram Bot API token (obtain from @BotFather)
  • Gym load data API endpoint
  • Holiday calendar API endpoint (optional)

Installation

make build

Or manually:

go build -o ggp .

Configuration

Create a configuration file based on the example:

cp config.example.toml config.toml

Edit config.toml with your settings:

[base]
timezone = "Europe/London"
admins = [123456789]  # Telegram user IDs
debug = false

[database]
path = "ggp.sqlite"
query_timeout = 5

[fetcher]
active = true
period = 300  # seconds
token = "your_api_token"
url = "https://api.example.com/load"

[holidayer]
active = true
period = 86400  # 1 day
url = "https://calendar.example.com/<YEAR>"

[predictor]
active = true
hours = 4  # prediction horizon (1-24)

[telegram]
active = true
token = "YOUR_TELEGRAM_BOT_TOKEN"

Usage

./ggp -config config.toml

Import historical data from CSV:

./ggp -import data.csv -config config.toml

Development

make test       # Run tests with race detector
make lint       # Run all linters
make precommit  # Full check before committing

Docker

make docker
docker-compose up

Dependencies

License

MIT License - see LICENSE file for details.

Documentation

Overview

Package main implements the GGP Telegram bot application.

Directories

Path Synopsis
Package config provides configuration loading and validation for the application.
Package config provides configuration loading and validation for the application.
Package databaser provides SQLite database connection and operations.
Package databaser provides SQLite database connection and operations.
Package fetcher implements a service that periodically fetches club load data.
Package fetcher implements a service that periodically fetches club load data.
Package holidayer provides functionality to periodically fetch holiday data from an external API and store it in a database.
Package holidayer provides functionality to periodically fetch holiday data from an external API and store it in a database.
Package importer provides functionality to import data from various sources.
Package importer provides functionality to import data from various sources.
Package plotter provides utilities for creating and managing plots.
Package plotter provides utilities for creating and managing plots.
Package predictor provides functionalities for loading predictions based on saved data.
Package predictor provides functionalities for loading predictions based on saved data.
Package watcher provides functionality to monitor Telegram for new messages.
Package watcher provides functionality to monitor Telegram for new messages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL