Calendar module for Sonnerrise - track events calendar view
Project description
sonnerrise-calendar
Calendar module for the Sonnerrise suite - provides calendar views for track events.
Features
- Weekly and monthly calendar views of track events
- List of upcoming events with countdown
- Toggle event enabled/disabled status
- Navigate to associated tracks
- Read-only aggregation of events from tracks
Installation
pip install sonnerrise-calendar
Usage
Python API
from sonnerrise_core import load_config, get_database
from sonnerrise_calendar import CalendarService
from datetime import date
config = load_config()
db = get_database(config)
calendar = CalendarService(db)
# Get weekly view
week = calendar.get_week_view(date.today())
for day in week.days:
print(f"{day.date}: {len(day.events)} events")
# Get monthly view
month = calendar.get_month_view(2024, 3)
for week in month.weeks:
for day in week:
if day.events:
print(f"{day.date}: {[e.description for e in day.events]}")
# Get upcoming events
upcoming = calendar.get_upcoming_events(days=14)
for event in upcoming:
print(f"In {event.days_until} days: {event.track_title} - {event.description}")
# Toggle event status
calendar.toggle_event(track_id=1, event_id=5)
CLI
# Show this week's events
sonnerrise-calendar week
# Show specific week
sonnerrise-calendar week --date 2024-03-15
# Show this month's events
sonnerrise-calendar month
# Show specific month
sonnerrise-calendar month --year 2024 --month 3
# List upcoming events
sonnerrise-calendar upcoming --days 14
# Today's events
sonnerrise-calendar today
# Toggle event enabled status
sonnerrise-calendar toggle 1 5 # track_id event_id
Calendar Views
Week View
Shows all events for a 7-day period starting from Monday of the specified week.
Month View
Shows all events organized by weeks for the specified month.
Upcoming Events
Lists all enabled future events within the specified number of days, sorted by date.
Event Information
Each event in the calendar shows:
- Date and time
- Track title
- Event description
- Days until/since the event
- Enabled/disabled status
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 Distributions
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 sonnerrise_calendar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sonnerrise_calendar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5c5490c6c84b951db23ae3ed07c1bb0c4cffcd3d7135f612195298a7a29252c
|
|
| MD5 |
e5c21ccfee0eb8263859949b947564c0
|
|
| BLAKE2b-256 |
bebf6157918db44463a566b3db93d3c7226f2a38ad8b9f4d2825bdf7a38d820d
|