Skip to content

Commit 5e48678

Browse files
tobixenclaude
andcommitted
docs: update docs/source for v3.0 API
- tutorial.rst: fix config file path (caldav.conf→calendar.conf), fix format (INI→YAML with caldav_ key prefix), use get_principal() instead of deprecated principal() - async.rst: replace all uses of deprecated client.principal() with client.get_principal() - about.rst: update backward-compat section for v3.0 release, fix Python minimum version (3.9→3.10), modernise test command (setup.py→pytest) - configfile.rst: note get_calendar/get_calendars now exist; update calendar parameters section (no longer unimplemented) - performance.rst: update niquests reference from "2.x" to "v3.x default" - jmap.rst: fix typo "jap support" → "JMAP support" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3acbacc commit 5e48678

6 files changed

Lines changed: 43 additions & 36 deletions

File tree

docs/source/about.rst

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,34 @@ icalendar data.
3232
Backward compatibility support
3333
==============================
3434

35-
The 1.x version series is intended to be maintained at least until
36-
2026-01.
35+
If you stumble upon problems and cannot easily resolve them, feel free
36+
to get in touch, i.e. by the issue tracker.
3737

38-
The 2.x version series (not released as of 2025-06-01) is supposed to
39-
be fully backwards-compatible with version 1.x, and is intended to be
40-
maintained at least until 2027.
38+
The 1.x version series is not maintained anymore.
4139

42-
2.0 sheds compatibility with python 3.7 and python 3.8, and one
43-
obscure deprecated method has been ripped out.
40+
If serious problems are found with v2.2.6 during 2026, v2.2.7 will be
41+
released.
4442

45-
API that is marked as deprecated 2.x will most likely be removed in version 3.0
46-
If you have any suggestions on API-changes, please
47-
comment on https://github.com/python-caldav/caldav/issues/92
43+
The 3.x version series (released 2026-03) is almost
44+
backwards-compatible with version 2.x. Python 3.10+ is required
45+
(Python 3.8 and 3.9 are no longer supported). The
46+
``caldav/objects.py`` backward-compatibility shim has been removed;
47+
any code doing ``from caldav.objects import <something>`` must be
48+
updated to import directly from ``caldav``. The wildcard import has
49+
also been removed, so if you were doing weird imports from ``caldav``,
50+
things may break.
4851

49-
Warnings will be issued when using legacy interface.
52+
API deprecated with a warning in 2.x may be removed in a future 4.0 release.
53+
API deprecated without a warning in 2.x will get a deprecation warning in 4.0.
5054

55+
If you have any suggestions on API-changes, please
56+
comment on https://github.com/python-caldav/caldav/issues/92
5157

5258
Python compatibility notice
5359
===========================
5460

5561
Most of the code is regularly tested towards different versions of
56-
Python, the oldest being Python 3.9.
62+
Python, the oldest being Python 3.10 (as of v3.0).
5763

5864
Support for Python2 was officially not supported starting from caldav
5965
version 1.0.
@@ -256,11 +262,12 @@ CalDAV URLs can be quite confusing, some software requires the URL to the calend
256262
Unit testing
257263
============
258264

259-
To start the tests code, install everything from the setup.tests_requires list and run:
265+
To run the tests, install the test dependencies and use pytest:
260266

261267
.. code-block:: bash
262268
263-
$ python setup.py test
269+
$ pip install -e ".[test]"
270+
$ pytest
264271
265272
tox should also work:
266273

docs/source/async.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The async API is available through the ``caldav.aio`` module:
2121
2222
async def main():
2323
async with aio.get_async_davclient() as client:
24-
principal = await client.principal()
24+
principal = await client.get_principal()
2525
calendars = await principal.get_calendars()
2626
for cal in calendars:
2727
print(f"Calendar: {cal.name}")
@@ -73,7 +73,7 @@ Example: Working with Calendars
7373
7474
async def calendar_demo():
7575
async with aio.get_async_davclient() as client:
76-
principal = await client.principal()
76+
principal = await client.get_principal()
7777
7878
# Create a new calendar
7979
my_calendar = await principal.make_calendar(
@@ -113,7 +113,7 @@ concurrently:
113113
114114
async def fetch_all_events():
115115
async with aio.get_async_davclient() as client:
116-
principal = await client.principal()
116+
principal = await client.get_principal()
117117
calendars = await principal.get_calendars()
118118
119119
# Fetch events from all calendars in parallel
@@ -158,12 +158,12 @@ The async API closely mirrors the sync API. Here are the key differences:
158158
.. code-block:: python
159159
160160
# Sync
161-
principal = client.principal()
161+
principal = client.get_principal()
162162
calendars = principal.get_calendars()
163163
events = calendar.get_events()
164164
165165
# Async
166-
principal = await client.principal()
166+
principal = await client.get_principal()
167167
calendars = await principal.get_calendars()
168168
events = await calendar.get_events()
169169
@@ -187,7 +187,7 @@ All methods that perform I/O are ``async`` and must be awaited:
187187

188188
**AsyncDAVClient:**
189189

190-
* ``await client.principal()`` - Get the principal
190+
* ``await client.get_principal()`` - Get the principal
191191
* ``client.calendar(url=...)`` - Get a calendar by URL (no await, no I/O)
192192

193193
**AsyncPrincipal:**

docs/source/configfile.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Config file format
33
==================
44

55

6-
The :class:`davclient.get_davclient` method (and perhaps in 2.1, also ``davclient.get_calendar``) can read from a config file. It will look for it in the following locations:
6+
The :func:`caldav.get_davclient`, :func:`caldav.get_calendar`, and :func:`caldav.get_calendars` functions can read from a config file. It will look for it in the following locations:
77

88
* ``$HOME/.config/caldav/calendar.conf``
99
* ``$HOME/.config/caldav/calendar.yaml``
@@ -13,7 +13,7 @@ The :class:`davclient.get_davclient` method (and perhaps in 2.1, also ``davclien
1313

1414
The config file has to be valid json or yaml (support for toml and Apple pkl may be considered).
1515

16-
The config file is expected to be divided in sections, where each section can describe locations and credentials to a CalDAV server, a CalDAV calendar or a collection of calendars/servers. As of version 2.0, only the first is supported.
16+
The config file is expected to be divided in sections, where each section can describe locations and credentials to a CalDAV server, a CalDAV calendar or a collection of calendars/servers.
1717

1818
A config section can be given either through parameters to :func:`caldav.get_davclient` or by enviornment variable ``CALDAV_CONFIG_SECTION``. If no section is given, the ``default`` section is used.
1919

@@ -25,9 +25,8 @@ The section should contain configuration keys and values. All configuration key
2525
Calendar parameters
2626
===================
2727

28-
Not implemented yet.
29-
30-
Probably in version 2.1 or version 2.2, ``calendar_name``, ``calendar_id`` and ``calendar_url`` can be used to specify a calendar.
28+
The :func:`caldav.get_calendar` and :func:`caldav.get_calendars` functions accept
29+
``calendar_name`` and ``calendar_url`` parameters to select a specific calendar.
3130

3231
Inheritance and collections
3332
===========================

docs/source/jmap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
JMAP
33
====
44

5-
**The jap support in v3.0 is experimental, the API may change in v3.1 of the library**
5+
**The JMAP support in v3.0 is experimental, the API may change in v3.1 of the library**
66

77
The caldav library includes a JMAP client for servers that speak
88
`RFC 8620 <https://www.rfc-editor.org/rfc/rfc8620>`_ (JMAP Core) and

docs/source/performance.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
Performance
33
===========
44

5-
The current maintainer of the CalDAV library was born in an age where memory and CPU was limited resources. CPU and memory comes cheaply today (read https://www.aardvark.co.nz/daily/2025/0611.shtml to see what I mean). The CalDAV and iCalendar protocols weren't really written for lean computing in the first place. If you need something that can run around on what used to be a bleeding edge supercomputer, you probably need to scrap those standards and write your own optimized calendaring standard and your own server and client for it - and this probably has to be done in C, not in Python.
5+
The current maintainer of the CalDAV library was born in an age where memory and CPU was limited resources. CPU and memory comes cheaply today (read https://www.aardvark.co.nz/daily/2025/0611.shtml to see what I mean). The CalDAV and iCalendar protocols weren't really written for lean computing in the first place. If you need something that can run around on what used to be a bleeding edge supercomputer some decades ago, you probably need to scrap those standards and write your own optimized calendaring standard and your own server and client for it - and this probably has to be done in C, not in Python.
66

77
Still, sometimes all the extra bloat I've added to the CalDAV library makes me cringe a bit. If you have issues with performance, please reach out (see the :ref:`contact:contact` document).
88

99
Some thoughts:
1010

11-
* While CPU and memory comes cheaply today, latency is often a problem. Creating server requests and particularly initiating TCP connections are typically costly. There are a number of places in the code where it may be possible to reduce the number of requests. As of 2.x, consider reading the top of the CHANGELOG - utilizing the niquests rather than requests library may possibly make the server communication more snappy.
11+
* While CPU and memory comes cheaply today, latency is often a problem. Creating server requests and particularly initiating TCP connections are typically costly. There are a number of places in the code where it may be possible to reduce the number of requests. As of v3.x, **niquests** is used by default for HTTP communication, bringing HTTP/2 and HTTP/3 support, this should make things more snappy. See the :doc:`http-libraries` document for details. It's also possible to enable multiplexing by enabling `http.multiplexing` in the server `features` setting. (it's disabled by default because a handful of servers out there can't handle the authentication if multiplexing is enabled)
1212
* In the early days almost all the necessary handling of icalendar data was done by accessing it as ``event.data``. This may be the most efficient - but the ``vobject`` was also utilized. Due to popular demand, plus the fact that ``vobject`` was not mainained for a while, ``icalendar`` took over. I can imagine it does takes some CPU to convert the data between ical strings and instances. This is done every time the data is accessed in a different format. For performance reasons, I was initially not very happy to use the icalendar library for doing simple things like fetching the UID from an event - but I've come to think that this is necessary. Now the problem is that every here and there there may still be some old code accessing ``event.data`` rather than ``event.icalendar_instance``. This probably causes the burning of quite a lot of CPU cycles!

docs/source/tutorial.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ Real Configuration
2323
------------------
2424

2525
The recommended way to configure caldav is through a config file or
26-
environment variables. Create ``~/.config/caldav/caldav.conf``:
26+
environment variables. Create ``~/.config/caldav/calendar.conf``:
2727

28-
.. code-block:: ini
28+
.. code-block:: yaml
2929
30-
# ~/.config/caldav/caldav.conf
31-
[default]
32-
url = https://caldav.example.com/
33-
username = alice
34-
password = secret
30+
# ~/.config/caldav/calendar.conf
31+
---
32+
default:
33+
caldav_url: https://caldav.example.com/
34+
caldav_username: alice
35+
caldav_password: secret
3536
3637
Or set environment variables:
3738

@@ -62,7 +63,7 @@ Use :func:`caldav.get_calendars` to get all calendars or filter by name:
6263
6364
# First create a calendar to work with
6465
with get_davclient() as client:
65-
my_principal = client.principal()
66+
my_principal = client.get_principal()
6667
my_principal.make_calendar(name="Work")
6768
6869
# Get all calendars

0 commit comments

Comments
 (0)