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] [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.

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.

# install from PyPI
pipx install lunar-birthday-ical

# install from Test PyPI
pipx install lunar-birthday-ical \
    --index-url https://test.pypi.org/simple/ \
    --pip-args "--extra-index-url https://pypi.org/simple/"

About pastebin

The YAML config lets you decide whether to upload the created .ics file to a pastebin service. This uses SharzyL's Cloudflare Workers-based pastebin (SharzyL/pastebin-worker), hosted by the repo 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:

$ lunar-birthday-ical config/example-lunar-birthday.yaml
iCal saved to config/example-lunar-birthday.ics
HTTP Request: POST https://komj.uk/ "HTTP/1.1 200 OK"
{"url": "https://komj.uk/Kree41N5W28qJC70XQU4Kj1F", "suggestUrl": "https://komj.uk/Kree41N5W28qJC70XQU4Kj1F/example-lunar-birthday.ics", "admin": "https://komj.uk/Kree41N5W28qJC70XQU4Kj1F:i9Jq1bd3KMscrEsyUzm0ksgQ", "isPrivate": true, "expire": 1800}

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.5.0.tar.gz (52.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.5.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lunar_birthday_ical-0.5.0.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lunar_birthday_ical-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bc97c6fcb6a1bda3dac15e2995958404c9f0ad396e4e98e0ee2d5b55b1ce14e2
MD5 74cdccdb5e7dad20dd1d630d2b06370f
BLAKE2b-256 7f736efc3ed79fb5d862f8845b917ad19b5fde5f3c4ed0c1642cafd077a56d83

See more details on using hashes here.

Provenance

The following attestation bundles were made for lunar_birthday_ical-0.5.0.tar.gz:

Publisher: publish-to-pypi.yaml on ak1ra-lab/lunar-birthday-ical

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for lunar_birthday_ical-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95a9bbc08ad163ac7516d48a790943db401ca32588540d68cdd0d2e56ae63e46
MD5 badf9bb74203cf7ab46d22dd4080f93a
BLAKE2b-256 5a7bdc5de27beda43b4d9adf3e09c3b55ba242e8b331ffffa0bcf18aebfd7773

See more details on using hashes here.

Provenance

The following attestation bundles were made for lunar_birthday_ical-0.5.0-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on ak1ra-lab/lunar-birthday-ical

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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