Skip to main content

Command line utility to interact with CalDAV servers

Project description

caldavctl

PyPI - Version PyPI - Python Version


Table of Contents

⚠️WARNING - This software is in the early stages of development, use at your own risk.

Installation

To install:

pipx install caldavctl

On windows make sure you create an environment variable called VISUAL pointing to an editor of your choice. For instance:

set VISUAL=nvim

or

set VISUAL=notepad

Completion

Optionally enable completion:

  • bash, add this to ~/.bashrc:

    eval "$(_CALDAVCTL_COMPLETE=bash_source caldavctl)"
    
  • zsh, add this to ~/.zshrc:

    eval "$(_CALDAVCTL_COMPLETE=zsh_source caldavctl)"
    
  • fish, add this to ~/.config/fish/completions/foo-bar.fish:

    _CALDAVCTL_COMPLETE=fish_source caldavctl | source
    

Configuration

caldavctl is configured in $HOME/.config/caldavctl/config.toml:

[server.server_01_nickname]
username="your user"
password="your pass"
url="https://oneserver.org/cal"

[server.server_02_nickname]
username="your user"
password="your pass"
url="https://anotherserver.org/cal"

[default]
server="server_01_nickname"
calendar="Default"
timezone="Asia/Tokyo"

Make sure to make this file readable only by the user owner of the file otherwise the configuration will not be read:

$ chmod go-rwx $HOME/.config/caldavctl/config.toml

In windows this check is not made, however it's good practice to make sure the configuration is only readable by the user running caldavctl.

Usage

caldavctl uses sub commands to expose its functionality:

$ caldavctl --help
Usage: caldavctl [OPTIONS] COMMAND [ARGS]...

  caldavctl - command line CalDAV client

Options:
  -c, --config TEXT  Configuration file
  --name TEXT        Server nickname
  --username TEXT    Username on the CalDAV server
  --passwd TEXT      Password on the CalDAV server
  --url TEXT         Calendar CalDAV url
  --timezone TEXT    Your time zone
  --server TEXT      Default server (use nickname)
  --calendar TEXT    Default calendar id
  --help             Show this message and exit.

Commands:
  br        Backup or restore a calendar
  calendar  Commands that deal with the calendars on the server
  event     Event management
  ics       iCalendar file operations
  journal   Journal management
  todo      Todo management

Notes:

  • The options to the main command override the configuration file;
  • By default the configuration file is $HOME/.config/caldavctl/config.toml;
  • Currently the journal sub-command is only a place holder;

To get help about a sub-command do:

$ caldavctl <sub-command> --help

For example:

$ caldavctl event --help
Usage: caldavctl event [OPTIONS] COMMAND [ARGS]...

  Event management

Options:
  --help  Show this message and exit.

Commands:
  create  Create new event
  delete  Delete an event on the server
  list    List events from the server list.

This holds true for sub-sub-commands:

$ caldavctl todo list --help
Usage: caldavctl todo list [OPTIONS]

  List todos from the default server and default calendar

Options:
  -d, --description  Show the event's description.
  -a, --all          Show all todos, including completed todos.
  --help             Show this message and exit.

The create event command

The create event command uses a simple key: value format to define the elements of an event. If the --edit option is used without specifying a file, an example file is opened on your $EDITOR:

# Mandatory
DTSTART: 2025-02-02 09:00
DTEND: 2025-02-02 09:45

# Recommended
SUMMARY:

# Optional
LOCATION:
CATEGORIES:
TIMEZONE:
PRIORITY: 5
ALARM: P0D
DESCRIPTION: [[ ]]

# NOTES:
#
#   * Date and time:
#       * The dates must be in iso format, for instance: 2024-12-29 13:45;
#       * The timezone used is the one defined by default or the one defined in
#         the "TIMEZONE" key;
#   * Categories: the categories are a comma separated list;
#   * Priority: 1 - highest priority, 9 - lowest priority
#   * Description: The description can be multi line, just make sure it's
#     delimited by [[ ]].
#   * Alarms:
#       * By default an alarm is defined the moment the event begins;
#       * The alarms are defined using:
#           ALARM: <trigger> [<description>]
#       * The trigger is defined according to:
#           https://datatracker.ietf.org/doc/html/rfc5545#autoid-38
#       * For example, to trigger an alarm 30 minutes before the event start, use:
#           ALARM: -PT30M
#       * The alarm description is optional

The start and end dates are, by default the next day from 9 to 9:45.

License

caldavctl is distributed under the terms of the GPL-3.0-or-later license.

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

caldavctl-0.0.20.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

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

caldavctl-0.0.20-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file caldavctl-0.0.20.tar.gz.

File metadata

  • Download URL: caldavctl-0.0.20.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for caldavctl-0.0.20.tar.gz
Algorithm Hash digest
SHA256 fdbf65ccfdb01e366afeae9ee6885ea39c6b88c47a92ae2703a8cbd6305c3f06
MD5 dfed7637a4023610a13718fb40467df6
BLAKE2b-256 c69184e0a2605818c93850ffe193246b07cf949f5244c67d6d336e78035df501

See more details on using hashes here.

File details

Details for the file caldavctl-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: caldavctl-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for caldavctl-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 9ba419fa1230f3dce7b51c26dc31d3d0027d67797da0c50d78fb4d2e0d185b21
MD5 b83ee79d5eb1b3c64ccc7283cc0f9c64
BLAKE2b-256 df4b0b56380d60df3ba5019eb8909df432f121642731fedbf6a6c9cfd23b6395

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