Makes an ICS calendar with concerts of your favorite artists
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-02-08 17:43:30 +01:00
config.yaml.example Switch to config file and add ListenBrainz support with time range 2025-10-23 20:56:07 +02:00
gigs-calendar.service Add README 2025-10-23 20:56:07 +02:00
gigs-calendar.timer Add README 2025-10-23 20:56:07 +02:00
gigs.py Move shebang to first line 2025-11-25 21:25:30 +01:00
LICENSE Add license 2025-10-23 20:56:07 +02:00
README.md Add license section to README 2026-02-08 17:43:30 +01:00

Gigs Calendar Generator

This script fetches your top artists from Last.fm or ListenBrainz and creates an ICS calendar with their upcoming concerts in specified countries using the BandsInTown API.

Installation

Ubuntu/Debian

sudo apt install python3 python3-yaml python3-requests

Arch Linux

sudo pacman -S python python-pip python-yaml python-requests

Configuration

  1. Copy the example config file:
cp config.yaml.example config.yaml
  1. Edit config.yaml and set up either Last.fm or ListenBrainz:

For Last.fm:

For ListenBrainz:

  1. Adjust other settings as needed:
  • Change the list of countries to monitor
  • Modify the number of top artists to fetch
  • Set the time range for top artists stats
  • Configure the output calendar filename

Manual Usage

python3 gigs.py

Or with a custom config file:

python3 gigs.py --config /path/to/config.yaml

Automated Updates with Systemd

  1. Create the systemd service and timer files:

Create /etc/systemd/system/gigs-calendar.service:

[Unit]
Description=Update gigs calendar with upcoming concerts
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
# Replace with your username and installation path
User=your_username
WorkingDirectory=/home/your_username/projects/gigs
ExecStart=/usr/bin/python3 /home/your_username/projects/gigs/gigs.py

[Install]
WantedBy=multi-user.target

Create /etc/systemd/system/gigs-calendar.timer:

[Unit]
Description=Update gigs calendar weekly

[Timer]
OnCalendar=weekly
Persistent=true

[Install]
WantedBy=timers.target
  1. Enable and start the timer:
sudo systemctl enable gigs-calendar.timer
sudo systemctl start gigs-calendar.timer
  1. Verify the timer is active:
systemctl list-timers gigs-calendar.timer

Notes

  • The script will only include future events in the calendar
  • Concert data is fetched from BandsInTown with a delay between requests to avoid rate limiting
  • The calendar file is overwritten each time the script runs, adding new events and removing past ones
  • If you want to change the update frequency, edit the OnCalendar value in the timer file
    • Example values: daily, weekly, monthly, Mon *-*-* 00:00:00
    • See man systemd.time for more timing options

License

GNU General Public License 3.0