Calendar integration: provider protocol, Google Calendar sync, and in-memory provider for testing
Project description
ulfblk-calendar
Calendar integration for the Bloques ecosystem. Provides a pluggable provider protocol, Google Calendar sync, and an in-memory provider for testing.
Installation
pip install ulfblk-calendar
For Google Calendar support:
pip install ulfblk-calendar[google]
Quick Start
from datetime import datetime, timedelta, timezone
from ulfblk_calendar import (
CalendarSettings,
InMemoryCalendarProvider,
EventCreate,
sync_to_calendar,
sync_from_calendar,
)
# Create a provider (use InMemoryCalendarProvider for testing)
provider = InMemoryCalendarProvider()
# Create an event
now = datetime.now(tz=timezone.utc)
event = EventCreate(
title="Team Standup",
start=now + timedelta(hours=1),
end=now + timedelta(hours=1, minutes=30),
description="Daily standup meeting",
)
# Sync to calendar
import asyncio
created = asyncio.run(sync_to_calendar(event, provider))
print(f"Created: {created.external_id}")
# Sync from calendar
events = asyncio.run(sync_from_calendar(provider, now, now + timedelta(days=1)))
print(f"Found {len(events)} events")
Custom Providers
Implement the CalendarProvider protocol to create your own backend:
from ulfblk_calendar import CalendarProvider, CalendarEvent, EventCreate, EventUpdate
from datetime import datetime
class MyProvider:
async def create_event(self, event: EventCreate) -> CalendarEvent: ...
async def update_event(self, event_id: str, event: EventUpdate) -> CalendarEvent: ...
async def delete_event(self, event_id: str) -> None: ...
async def list_events(self, start: datetime, end: datetime) -> list[CalendarEvent]: ...
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 ulfblk_calendar-0.1.0.tar.gz.
File metadata
- Download URL: ulfblk_calendar-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2bc1781c789c2e80eb4dfc15023d7d321eeb55038cff5b534b99239391f4063
|
|
| MD5 |
048e83f68f68e1e0461e655c540cb000
|
|
| BLAKE2b-256 |
93317f28220bfcd74f266b562e9ef556b8b6ee7f554f57c8f0ee9cd717af10b0
|
File details
Details for the file ulfblk_calendar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ulfblk_calendar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddaee2307f7edecac8b00ce8f80b9a61b7b5c0f8da1c05f7121dc1a4b8076509
|
|
| MD5 |
544cca54245b6bd3b507845e1ba2a63d
|
|
| BLAKE2b-256 |
67d41de7d35ef05f44afceed9f02c8752ceeb0408a052e1140f4e4c2f3fc08e8
|