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]: ...
Metadata
Release files for ulfblk-calendar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ulfblk_calendar-0.1.0.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ulfblk_calendar-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.7 kB
Release files / ulfblk_calendar-0.1.0.tar.gz
| Download URL | ulfblk_calendar-0.1.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2bc1781c789c2e80eb4dfc15023d7d321eeb55038cff5b534b99239391f4063
|
|
BLAKE2b-256 checksum How to use checksums |
93317f28220bfcd74f266b562e9ef556b8b6ee7f554f57c8f0ee9cd717af10b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / ulfblk_calendar-0.1.0-py3-none-any.whl
| Download URL | ulfblk_calendar-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddaee2307f7edecac8b00ce8f80b9a61b7b5c0f8da1c05f7121dc1a4b8076509
|
|
BLAKE2b-256 checksum How to use checksums |
67d41de7d35ef05f44afceed9f02c8752ceeb0408a052e1140f4e4c2f3fc08e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|