Local calendar caching and JSON API
Project description
📅 jcalapi
jcalapi is a local calendar cache and JSON API that interacts with Exchange and Confluence calendars. It fetches events and returns them in a JSON format, making it easy to integrate calendar data into other systems.
🚀 Getting Started
📋 Prerequisites
- Python
- uv (or Nix with flakes)
🔑 Setting Up Credentials
To use jcalapi, you'll need to provide credentials for accessing your Exchange or Confluence calendars. These credentials should be stored in a secure location, and you should ensure that they are not exposed in your code or version control system.
For Exchange, you'll need your username and password. For Confluence, you'll need your API token.
See .envrc-sample for an example.
💾 Installation
# pip
pip install --user jcalapi
# pipx
pipx install jcalapi
🏃 Usage
You can run the application directly using Python:
python -m jcalapi
🐳 Blablabla, Docker?
docker run -it --rm -p 127.0.0.1:7042:7042 \
-e ONFLUENCE_URL=https://confluence.example.com \
-e CONFLUENCE_USERNAME=john.doe \
-e CONFLUENCE_PASSWORD=XXX \
-e EXCHANGE_USERNAME=john.doe@example.com \
-e EXCHANGE_PASSWORD=XXX \
-e GOOGLE_CREDENTIALS=/config/xxx.apps.googleusercontent.com.json \
-e GOOGLE_CALENDAR_REGEX='^Work '
ghcr.io/pschmitt/jcalapi
📚 API Usage
The API provides endpoints for fetching calendar events. Here's an example of how to use it:
curl http://localhost:7042/today
This will return a JSON response with the events data:
[
{
"uid": "event1",
"backend": "exchange",
"calendar": "calendar1",
"organizer": "organizer1",
"attendees": {
"name": "hisname",
"email": "his@email.com",
"optional": false,
"response": "Accept"
},
"summary": "event1 summary",
"description": "event1 description",
"body": "event1 body",
"location": "event1 location",
"start": "2023-06-06T00:00:00",
"end": "2023-06-06T01:00:00",
"whole_day": false,
"is_recurring": false,
"categories": [
"Cat1",
"Cat2"
],
"status": "confirmed",
"extra": {
"conference_type": "Teams",
"meeting_workspace_url": "https://teams.microsoft.com/l/meetup-join/...",
"net_show_url": "https://teams.microsoft.com/l/meetup-join/..."
},
"conference_url": "https://teams.microsoft.com/l/meetup-join/..."
},
...
]
To fetch events for tomorrow, you can use the /tomorrow endpoint:
curl http://localhost:7042/tomorrow
This will return a JSON response with the events data for tomorrow.
The /meta endpoint provides metadata about the backends (Confluence/Exchange):
curl http://localhost:7042/meta
The /reload endpoint allows you to reload the calendar data:
curl -X POST http://localhost:7042/reload
🤝 Contributing
Contributions are welcome! Please feel free to submit a pull request.
🧑💻 Development setup
- Clone the repository
git clone https://github.com/pschmitt/jcalapi.git
- Navigate into the cloned repository
cd jcalapi
- Setup the environment
uv sync --group dev # with Nix devshell, dev tools are already available
Alternatives:
- Use Nix flakes:
nix developdrops you into a shell with dev tools and uv; runuv sync --group devto install deps locally anduv run python -m jcalapi
📄 License
This project is licensed under the GNU General Public License v3.0.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jcalapi-0.2.0.tar.gz.
File metadata
- Download URL: jcalapi-0.2.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9c0839ea41657c0db26b551c09873edc4874b894b247c65d93f86afcc46c254
|
|
| MD5 |
e237fa0a997136cb3a32224707ff71e4
|
|
| BLAKE2b-256 |
0a65ec485579d7c6f5372d96606020a9ea6220ac52b7f6ff81800979ceb60527
|
Provenance
The following attestation bundles were made for jcalapi-0.2.0.tar.gz:
Publisher:
release.yaml on pschmitt/jcalapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jcalapi-0.2.0.tar.gz -
Subject digest:
d9c0839ea41657c0db26b551c09873edc4874b894b247c65d93f86afcc46c254 - Sigstore transparency entry: 1503185992
- Sigstore integration time:
-
Permalink:
pschmitt/jcalapi@6c6e535067ef223e01eb5f9097479bb15a7d1183 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@6c6e535067ef223e01eb5f9097479bb15a7d1183 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jcalapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jcalapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d2a7cff4b75e799c601098f48d961ca1f0bf68832e116bf6def7d2ced1faf4
|
|
| MD5 |
e6b216c0732148dd75b873307f3ea931
|
|
| BLAKE2b-256 |
c3902d0a73cda370d93e5c0b607dad9a5f4357779fba14664600631a1eda3fc8
|
Provenance
The following attestation bundles were made for jcalapi-0.2.0-py3-none-any.whl:
Publisher:
release.yaml on pschmitt/jcalapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jcalapi-0.2.0-py3-none-any.whl -
Subject digest:
84d2a7cff4b75e799c601098f48d961ca1f0bf68832e116bf6def7d2ced1faf4 - Sigstore transparency entry: 1503186240
- Sigstore integration time:
-
Permalink:
pschmitt/jcalapi@6c6e535067ef223e01eb5f9097479bb15a7d1183 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@6c6e535067ef223e01eb5f9097479bb15a7d1183 -
Trigger Event:
push
-
Statement type: