semvec/pypi-packages huggingface dataset:
sonnerrise-tools 0.1.0
Tools module for Sonnerrise - database export/import utilities
Requires Python: >=3.11

# sonnerrise-tools

Tools module for the Sonnerrise suite - database export/import utilities.

## Features

- Export entire database to JSON or YAML files
- Import data from backup files
- Automatic schema versioning and migration
- Selective export/import by entity type
- Data validation on import

## Installation

```bash
pip install sonnerrise-tools
```

## Usage

### Python API

```python
from sonnerrise_core import load_config, get_database
from sonnerrise_tools import ExportService, ImportService

config = load_config()
db = get_database(config)

# Export all data
exporter = ExportService(db)
exporter.export_all("backup.json")

# Export specific entities
exporter.export_personas("personas.json")
exporter.export_tracks("tracks.yaml", format="yaml")

# Import data
importer = ImportService(db)
result = importer.import_all("backup.json")
print(f"Imported {result.total_records} records")

# Import with options
result = importer.import_all(
    "backup.json",
    skip_existing=True,  # Skip records that already exist
    create_tables=True,   # Create missing tables
)
```

### CLI

```bash
# Export all data to JSON
sonnerrise-tools export backup.json

# Export to YAML
sonnerrise-tools export backup.yaml --format yaml

# Export specific entities
sonnerrise-tools export personas.json --only personas
sonnerrise-tools export tracks.json --only tracks,definitions

# Import data
sonnerrise-tools import backup.json

# Import with options
sonnerrise-tools import backup.json --skip-existing --create-tables

# Show backup info
sonnerrise-tools info backup.json

# Validate backup without importing
sonnerrise-tools validate backup.json
```

## Export Format

The export file contains all entities with their relationships:

```json
{
  "version": "1.0",
  "created_at": "2024-03-15T10:30:00",
  "entities": {
    "personas": [...],
    "definitions": [...],
    "definition_links": [...],
    "tracks": [...],
    "track_links": [...],
    "track_events": [...],
    "promos": [...],
    "promo_links": [...]
  },
  "counts": {
    "personas": 10,
    "definitions": 25,
    "tracks": 50,
    ...
  }
}
```

## Migration Support

When importing data with a different schema version:
- Missing tables are automatically created
- New columns use default values
- Removed columns are ignored
- Data validation ensures integrity
sonnerrise-calendar 0.1.0
Calendar module for Sonnerrise - track events calendar view
Requires Python: >=3.11

# 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

```bash
pip install sonnerrise-calendar
```

## Usage

### Python API

```python
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

```bash
# 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