Skip to main content

Search, filter and sort iCalendar components

Project description

icalendar-searcher

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

Audience

  • This will be used for the python CalDAV client library, both for bundling search parameters together in one object, for doing client-side filtering when the server does not support the desired search query.
  • This may be useful in any kind of software handling collections of calendar content and needing to do filtering or searches on it.
  • This may also be useful by calendar server developers.

Usage

No proper usage documentation has been written yet, sorry. There are tons of inline comments and docstrings though. The AI has contributed with quite some verbose comments in the test code, but little of it has been exposed to any proper QA.

Related projects

  • The project depends on the icalendar library, all calendar contents handled by this library is coming in and out as icalendar.Component or icalendar.Calendar. However, the library should also support wrapped objects (like instances of the caldav.Event class).
  • The project depends on the recurring-ical-events library for expanding recurrence sets.
  • The project is used by the Python CalDAV client library

Status as of v0.x.x

This library still has some stubbed implementations:

  • While searcher.check_component(component) can check the search filters on one component (or recurrence set) and even expand recurring objects, the searcher.filter()-method is not yet implemented. It should be a simple thing, it's just some design considerations on weather to support input/output as icalendar.Calendar-objects, wrapper objects from the CalDAV library, lists or whatever.
  • Same goes with searcher.sort(). There is implemented a searcher.sorting_value(component) though.
  • Only operators supported so far is ==, contains and undef. Other operators like !=/<>, <, <=, ~, etc has not been implemented.

As for now. The maintainer will urgently prioritize the bare minimum needed for usage in the CalDAV library.

According to the SemVer rules, it's OK to still change the API in 0.x-versions, but the current API is likely to be quite stable. There exist no changelog as for now, but it will be made prior to the 1.0-release.

History

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.

AI

The author has been experimenting a bit with AI usage while creating this project, both GitHub Copilot and Claude has been tested. Most of the test code has been created by the AI. AI has also been utilized a bit for refactoring, bug hunting, and a little bit code generation, but most of the "business logic" was written by me.

While all the AI-generated changes in the business logic has been looked through thoroughly, very little QA has been done on the test code.

Performance

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.

The expansion part may cause millions of recurrences to be created. It even supports open-ended intervals. It's possible by returning generators. However, things will most likely blow up and eat all the CPU and memory it gets the hands on whenever one wants to do sorting of such a thing.

License

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, I will consider to fix some dual licensing, like it's done with the python CalDAV library.

This also means that any contributor has to accept that the code is released under AGPL v3.0 and at some point in the future may be dual-licensed under some more permissive license, like the EUPL v1.1.

I don't have very strong opinions on licenses. If you have any issues in one way or another, please reach out.

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

icalendar_searcher-0.1.10.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

icalendar_searcher-0.1.10-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file icalendar_searcher-0.1.10.tar.gz.

File metadata

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

File hashes

Hashes for icalendar_searcher-0.1.10.tar.gz
Algorithm Hash digest
SHA256 fa076ac663e7c968c888b2db5c233e855313c7e0bd3d4ac230dab8b18bfa3b1f
MD5 ccdcbb4325dd86f3ff0892c25c29ad0c
BLAKE2b-256 00682a74a5a90f54171a9765dd5d8f6f6483448735be986480cd5105430710fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for icalendar_searcher-0.1.10.tar.gz:

Publisher: publish.yaml on python-caldav/icalendar-searcher

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

File details

Details for the file icalendar_searcher-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for icalendar_searcher-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 6281ccc73640795b579e861a74adc0fbf0970d82ff651ca067367afcbcc6b73e
MD5 2ba01e767bb3ef2bbcda84ea3d39a7d6
BLAKE2b-256 aab8933686936e0669f17c9bfd1259ffae7761e645a0ceeec5cf0151d89483a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for icalendar_searcher-0.1.10-py3-none-any.whl:

Publisher: publish.yaml on python-caldav/icalendar-searcher

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