Skip to content

Commit ab824b5

Browse files
committed
doc
1 parent d97462a commit ab824b5

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This library should contain logic for searching, filtering and sorting icalendar data, as well as logic for storing and representing an icalendar search query.
44

5+
## Audience
6+
7+
* This will be used for the python CalDAV client library, both for boundling search parameters together in one object and for doing client-side filtering when the server does not support the desired search query.
8+
* This may be useful in any kind of software handling collections of calendar content and needing to do filtering or searches on it.
9+
* This may also be useful by calendar server developers.
10+
511
## Status as of v0.x.x
612

713
This library is full of stubbed implementations as for now. The maintainer will urgently prioritize the bare minimum needed for refactoring the search functionality in the CalDAV library. Version 1.0 may still contain some stubs, but should contain a relatively well-defined feature set.
@@ -10,6 +16,10 @@ This library is full of stubbed implementations as for now. The maintainer will
1016

1117
This is a spin-off from the python caldav project, started by Tobias Brox in 2025-11, the maintainer of the Python CalDAV client library at that time, in collaboration with the main contributors of the icalendar library.
1218

19+
## Performance
20+
21+
In the early versions, the filter method will take the calendar contents one by one and check if it matches or not. This will work out well enough for small calendar sets. If lots of searches are to be done on fairly static data (like what typically may happen at the server side in a calendaring system), then it would be an idea to add indexes.
22+
1323
## License
1424

1525
As for now I'm releasing this under the GNU Affero General Public License v.3.0. If you find this too restrictive or if this causes license compatibility issues for you, please get in touch with me and I will consider to fix some dual licensing, like it's done with the python CalDAV library.

src/icalendar_searcher/__init__.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class Searcher:
2020
* Allow to build up a calendar search query.
2121
* Help filterering or sorting a list of calendar components
2222
23+
Primarily VJOURNAL, VTODO and VEVENT Calendar components are
24+
intended to be supported, but we should consider if there is any
25+
point supporting FREEBUSY as well.
26+
2327
This class is a bit stubbed as of 2025-11, many things not working
2428
yet. This class was split out from the CalDAV library and is
2529
intended for generic search logic not related to the CalDAV
@@ -48,7 +52,10 @@ class Searcher:
4852
``start`` and ``end`` is giving a time range. The CalDAV logic
4953
will be honored, see RFC4791, section 9.9 for very clear
5054
definitions of what should be returned and what should be filtered
51-
away.
55+
away. Timestamps should ideally be with a time zone, if not given
56+
the local time zone will be assumed. All-day events may be tricky
57+
to get correct when timestamps are given and calendar data covers
58+
multiple time zones.
5259
5360
``alarm_start`` and ``alarm_end`` is similar for alarm searching
5461
@@ -86,6 +93,10 @@ class Searcher:
8693
robust enough to handle multiple independent components embedded
8794
in a single Calendar.
8895
96+
Other ideas that one may consider implementing:
97+
* limit, offset.
98+
* fuzzy matching
99+
89100
"""
90101

91102
todo: bool = None
@@ -153,8 +164,14 @@ def check_component(
153164
self, component: Union["Calendar", "CalendarObjectResource"]
154165
) -> Union["Calendar", "CalendarObjectResource"]:
155166
"""
156-
Checks if a component (or a recurrence set) matches the filters.
157-
Expands a recurring component if needed. Returns the component.
167+
Checks if a component (or recurrence set) matches the filters. If the component parameter is a calendar containing several independent components, an Exception may be raised.
168+
169+
* On a match, the component will be returned, otherwise ``None``.
170+
* If a time specification is given and the component given is a
171+
recurring component, it will be expanded internally to check if
172+
it matches the given time specification.
173+
* If ``self.expand`` is set, the expanded recurrence set matching
174+
the time specification will be returned.
158175
"""
159176
raise NotImplementedError()
160177

0 commit comments

Comments
 (0)