Dalec plugin to retrieve caldav data
Project description
📅 dalec-caldav
Django Aggregate a Lot of External Content -- CalDav
Aggregate last event from a given CalDav instance.
Plugin of 🤖 dalec.
Installation
pip install dalec-caldav
In django settings INSTALLED_APPS
, add:
INSTALLED_APPS = [
...
"dalec",
"dalec_prime",
"dalec_caldav",
...
]
Usage
General usage:
{% load dalec %}
{% dalec "caldav" content_type [channel=None] [channel_object=None] [template=None] [ordered_by=None] %}
Events
Retrieves latest updated events of all calendars accessible for the current user:
{% dalec "caldav" "event" %}
Retrieves latest updated events of a calendar defined by an url:
{% dalec "caldav" "event" channel="url" channel_object="https://nextcloud.org/remote.php/dav/public-calendars/<calendarID>" %}
Settings
Django settings must define:
DALEC_CALDAV_BASE_URL
: CalDav instance url (ex:https://caldav.org/
)DALEC_CALDAV_API_USERNAME
: CalDav username (ex:admin
)DALEC_CALDAV_API_PASSWORD
: CalDav user password (ex:azeazeaezdfqsmlkrjzr
)
Some other settings are optionnal:
DALEC_CALDAV_SERCH_EVENT_START_TIMEDELTA
Default to timedelta(days=-1)
. When fetching events from calendar, only events that are newer
from this timedelta will be retrieved. It avoid to retrieve a huge amount of past events.
DALEC_CALDAV_SERCH_EVENT_END_TIMEDELTA
Default to timedelta(days=365)
. When fetching events from calendar, only events that are older
from this timedelta will be retrieved. It avoid to retrieve a huge amount of past events.
Tests
This dalec uses Radicale as tiny python caldav server wich can runs
inside tox out of the box.
If you want to test with other caldavs servers, you can add a local_settings.py
file in
tests/
folder and add a dict conf of extra calendars DALEC_EXTRA_CALDAV_URLS
:
DALEC_EXTRA_CALDAV_URLS = {
"nextclould-v27-public": {
"url": "https://nextcloud.example.com/remote.php/dav/public-calendars/saiGzyBYcWct24W8/",
},
"nextclould-v27-auth": {
"url": "https://nextcloud.example.com/remote.php/dav/calendars/username/calendarname/",
"username": "username",
"password": "secret",
},
"my-other-caldav-events": {
"url": "https://caldav.example.com/xxx/",
},
}
This will perform simple test to check the proxy seems to work with this type of caldav server:
- try to fetch events
- assert there is at least 1 event fetched.
If your calendar has no event, test will fail.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dalec-caldav-0.2.0.tar.gz
.
File metadata
- Download URL: dalec-caldav-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4002a48df768f1298b8206de4fe7b4d31a1a7b1f7cb4d6b4fbec421666cf7edb |
|
MD5 | b9a77db6eee40aa858000c43fb1fb278 |
|
BLAKE2b-256 | fadb3c9e9821619c79b42331e7a815aae2ab848a395105934f1b2b7e10804570 |
File details
Details for the file dalec_caldav-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dalec_caldav-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d405c54fce5146eba121dce5b18f59d0ebd71edabf5286dabaadc5a1b504f24b |
|
MD5 | 8f20a538dab2590449b546ed4aa508ca |
|
BLAKE2b-256 | f3eda986c6dbd4de4502d2dadd25add615f69efadb271c97c3974997843743c8 |