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 full example configuration file, refer to config/example-lunar-birthday.yaml, not all fields are required in the config/example-lunar-birthday.yaml. The comments should be sufficient to explain the meaning of each option.

The minimal configuration file can only contain the []persons field, with other fields left as default, for example:

persons:
  - username: 张三
    startdate: 1989-06-03
    solar_birthday: false
    lunar_birthday: true

  - username: 李四
    startdate: 2006-02-01
    solar_birthday: true
    lunar_birthday: false

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] [-v] [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.
  -v, --verbose         Enable debug logging.

Although this tool does not have many command-line options, it supports argcomplete. For configuration methods, refer to the argcomplete documentation.

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 v0.x.x, 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.

When the pastebin.enabled option is set to true, you can leave pastebin.admin_url empty for the first run. After that, set pastebin.admin_url url from the .admin field in the response from the pastebin server.

The response from the pastebin server looks like this:

{
  "url": "https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX",
  "suggestUrl": "https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX/example-lunar-birthday.ics",
  "admin": "https://komj.uk/XXXXXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYY",
  "isPrivate": true,
  "expire": 10800
}

The .suggestUrl can be used by any Calendar App.

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.6.tar.gz (12.2 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.6-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lunar_birthday_ical-0.3.6.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.22.4 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for lunar_birthday_ical-0.3.6.tar.gz
Algorithm Hash digest
SHA256 334a94485452a150a86d14d1c5dc90208900138fd09066c8754a02f8b9af359b
MD5 6ab75fb237c0718fe094e218831ccf54
BLAKE2b-256 d4af4d3ab67930c5258176a35786264bcbc07ec292e37833e526cbb02fd0d463

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lunar_birthday_ical-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3b67e55d74fd493782da505a3f59e0df43d2ad16e6741126357b9fa32c73ffd7
MD5 3e9551127d685ae2fe29bf32e8e0f2b6
BLAKE2b-256 ca8bc3b9f07894f6acc9e9d2e4e7282e43c7500a2c6558b69ec6464a4938404c

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