Skip to content

marlen-myn/waste-collection-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗑️ Waste Collection Notifier

A Telegram bot that sends reminder notifications the evening before waste collection days. Built for the Panda Recycling Suttonfield 2026 bi-weekly schedule.

Runs daily at 8 PM via cron, checks a JSON schedule for next-day collections, and sends a formatted Telegram message listing which bins to put out — with emoji indicators, bin colors, and dates. If nothing is due, it silently logs and exits.

Install

pip3 install requests

For running tests:

pip3 install hypothesis pytest

Configure

Copy the example config and fill in your credentials:

cp config.json.example config.json

Then edit config.json:

{
    "bot_token": "YOUR_BOT_TOKEN",
    "chat_id": "YOUR_CHAT_ID",
    "schedule_path": "schedule.json",
    "log_path": "notifier.log"
}

config.json is gitignored — your token stays local.

  • bot_token — get one from @BotFather
  • chat_id — add the bot to a channel/group, send a message, then call https://api.telegram.org/bot<TOKEN>/getUpdates to find the chat ID (channels use -100 prefix)

Run

Test manually:

python3 notifier.py

Cron

Already configured to run daily at 8 PM:

0 20 * * * ~/.local/share/mise/installs/python/3.12.10/bin/python3 /home/mynz/projects/telegram_notifier/waste_notifier/notifier.py

Logs are written to notifier.log in the project directory.

Schedule Format

schedule.json contains the year's collection dates organized by waste type and month. Collections are bi-weekly:

{
    "year": 2026,
    "collections": {
        "recycling":     { "1": [9, 23], "2": [6, 20], ... },
        "general_waste": { "1": [3, 17, 31], "2": [13, 27], ... },
        "compost":       { "1": [10, 24], "2": [7, 21], ... }
    }
}

Each waste type maps month numbers (as strings) to arrays of collection day-of-month integers. To update for a new year, change the year field and update the day arrays.

Waste Types

Type Emoji Bin Color
general_waste Black
recycling ♻️ Green
compost 🟤 Brown

Tests

python3 -m pytest tests/ -v

About

Daily cron job that checks a bi-weekly waste collection schedule and sends Telegram reminders the evening before collection day. Supports recycling, general waste, and compost bin types.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages