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.name and pastebin.password empty on the first run. After that, extract pastebin.name and pastebin.password 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
}

Extract XXXXXXXXXXXXXXXXXXXXXXXX as pastebin.name and YYYYYYYYYYYYYYYYYYYYYYYY as pastebin.password.

The suggestUrl in the response can be subscribed to by the 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.5.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.5-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lunar_birthday_ical-0.3.5.tar.gz
Algorithm Hash digest
SHA256 6d91e5a099db693e44b45a1ee1c9f36543d58608cba19be1b4562929bc3948b0
MD5 4238b6245a0a84a926202b52bdb2ae90
BLAKE2b-256 e49d3ab34e4384603cec528d93e4f91b5e63f9a569213332b37c26bc7321f182

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lunar_birthday_ical-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d2479ee6cda41f2192a74dbd4febedbb41a1074e77795caddb646d42d83e588c
MD5 03279055fdac222cb5d8149271fa459b
BLAKE2b-256 d30379e840a4094e0c97db11a40e34cec9f8cbc68aa74c33117104d9c7fdbc2e

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