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 []events field, with other fields left as default, for example:

events:
  - name: 张三
    start_date: 1989-06-03
    event_keys:
      - lunar_birthday

  - name: 李四
    start_date: 2006-02-01
    event_keys:
      - integer_days
      - solar_birthday

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/ABCDABCDABCDABCDABCDABCD",
  "suggestUrl": "https://komj.uk/ABCDABCDABCDABCDABCDABCD/example-lunar-birthday.ics",
  "admin": "https://komj.uk/ABCDABCDABCDABCDABCDABCD:WXYZWXYZWXYZWXYZWXYZWXYZ",
  "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.4.0.tar.gz (16.1 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.4.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lunar_birthday_ical-0.4.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.24.1 CPython/3.11.12 Linux/6.11.0-1014-azure

File hashes

Hashes for lunar_birthday_ical-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3bb13dd0ab886f3f3df06bb6d502f3cc59bd53b07d1ae28f6ad42d3f5bca95bb
MD5 f6f22218fd1ad0bc8abec0345ae388d5
BLAKE2b-256 5a3800c698c20c18a998632d98b68e6e443a94cd5d129690abebc15b8906915e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lunar_birthday_ical-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.24.1 CPython/3.11.12 Linux/6.11.0-1014-azure

File hashes

Hashes for lunar_birthday_ical-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 333a8b678a9a0f8c16af403e81424607eb92dcd2936703a88ec2188b848408e7
MD5 294945b761e7ece804313ced96aa1dd6
BLAKE2b-256 5eb3f0cb5c0d19ee17a75d4e6bd275cc923c33e9bda0924d4945285f29d6f88c

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