Skip to main content

A command line tool written in Python 3 for creating lunar birthday events

Project description

lunar-birthday-ical

What is this?

A command line tool written in Python 3 for creating lunar birthday events.

lunar-birthday-ical reads a YAML configuration file and generates an iCalendar .ics file. Optionally, it can upload the calendar to pastebin for easy subscription. For an example configuration file, refer to config/example-lunar-birthday.yaml. The comments should be sufficient to explain the meaning of each option.

You can use the -h or --help option to view the command-line tool's help information.

$ lunar-birthday-ical -h
usage: lunar-birthday-ical [-h] [-L YYYY MM DD | -S YYYY MM DD] [config.yaml ...]

Generate iCal events and reminders for lunar birthday and cycle days.

positional arguments:
  config.yaml           config file for iCal, checkout config/example-lunar-birthday.yaml for example.

options:
  -h, --help            show this help message and exit
  -L YYYY MM DD, --lunar-to-solar YYYY MM DD
                        Convert lunar date to solar date, add minus sign before leap lunar month.
  -S YYYY MM DD, --solar-to-lunar YYYY MM DD
                        Convert solar date to lunar date.

Installation

It is recommended to use pipx to install command-line tools written in Python, including this project.

$ pipx install lunar-birthday-ical
  installed package lunar-birthday-ical {{ version }}, installed using Python 3.11.2
  These apps are now globally available
    - lunar-birthday-ical
done! ✨ 🌟 ✨

About pastebin

In the YAML configuration file, you can choose whether to upload the generated .ics file to pastebin. This pastebin instance is a Cloudflare worker-based pastebin service (SharzyL/pastebin-worker) run by the repository owner.

If pastebin (pastebin.enabled) is enabled, you can leave pastebin.name and pastebin.password in the YAML configuration file empty on the first run. After executing the command, it will automatically upload, and upon successful upload, retrieve the pastebin.name and pastebin.password from the admin field in the lunar_birthday_ical.pastebin log line in the standard output (pastebin.name and pastebin.password are split with :, as shown in the output below with XXXXXXXXXXXXXXXXXXXXXXXX and YYYYYYYYYYYYYYYYYYYYYYYY). Manually fill these into the configuration file. This way, on subsequent executions, it will only update the existing URL instead of re-uploading, thus keeping the URL unchanged and avoiding the need to update the calendar URL.

$ lunar-birthday-ical config/example-lunar-birthday.yaml
[2025-02-08 15:37:54,747][lunar_birthday_ical.ical][INFO] iCal file saved to config/example-lunar-birthday.ics
[2025-02-08 15:37:57,097][lunar_birthday_ical.pastebin][INFO] {'url': 'https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX', 'suggestUrl': 'https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX/example-lunar-birthday.ics', 'admin': 'https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYY', 'isPrivate': True, 'expire': 604800}

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

lunar_birthday_ical-0.3.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

lunar_birthday_ical-0.3.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file lunar_birthday_ical-0.3.2.tar.gz.

File metadata

  • Download URL: lunar_birthday_ical-0.3.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.22.3 CPython/3.11.11 Linux/6.8.0-1020-azure

File hashes

Hashes for lunar_birthday_ical-0.3.2.tar.gz
Algorithm Hash digest
SHA256 bf3cb96c6af6e58e51dd68963471c5b1d9ecbc5071721cadf5bff19f09c0ccf8
MD5 1aef23d34f0bedc46da512dc1c058e4b
BLAKE2b-256 6696d65b26e9d7a0ffe87b1ff74cf98f118749e44aaf2524446541b4ebe5afc0

See more details on using hashes here.

File details

Details for the file lunar_birthday_ical-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: lunar_birthday_ical-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.22.3 CPython/3.11.11 Linux/6.8.0-1020-azure

File hashes

Hashes for lunar_birthday_ical-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81c639642a0275f2c31456989d92d2422e281071049f48f3fc14e97cecbb4c9f
MD5 6c4a2f49a2903582c944ba4b1f70d46c
BLAKE2b-256 f4463d58fc7985945d4f71b2e426ea182b7d52cf71b3f06ee291b13a3121541b

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