Archive Plugin — generic data archival #44

Open
opened 2026-02-20 17:23:50 +00:00 by doxios · 0 comments
Collaborator

Summary

A plugin for archiving data to local files with configurable formats and rotation.

Split from #3 (Logbot infrastructure).

Interface

class ArchiveProvider(ABC):
    @abstractmethod
    def write(self, channel: str, timestamp: int, data: dict) -> str:
        """Write data to archive, returns file path."""
        pass
    
    @abstractmethod
    def get_archive_path(self, channel: str, date: str) -> Path:
        """Get archive file path for channel and date."""
        pass

Configuration

archive:
  format: jsonl       # jsonl | markdown | csv
  rotation: daily     # daily | hourly | none
  base_path: ./archive
  channels:
    dev-chat:
      format: markdown  # Per-channel override

Extension Points

  • archive.on_write — Called after data is written (for downstream plugins like git-sync)

Use Cases

  • Telegram message logging
  • Event archival
  • Backup storage
  • #3 (original logbot issue)
  • #35 (cron for scheduled archival)
  • Needs Git plugin for auto-commit
## Summary A plugin for archiving data to local files with configurable formats and rotation. Split from #3 (Logbot infrastructure). ## Interface ```python class ArchiveProvider(ABC): @abstractmethod def write(self, channel: str, timestamp: int, data: dict) -> str: """Write data to archive, returns file path.""" pass @abstractmethod def get_archive_path(self, channel: str, date: str) -> Path: """Get archive file path for channel and date.""" pass ``` ## Configuration ```yaml archive: format: jsonl # jsonl | markdown | csv rotation: daily # daily | hourly | none base_path: ./archive channels: dev-chat: format: markdown # Per-channel override ``` ## Extension Points - `archive.on_write` — Called after data is written (for downstream plugins like git-sync) ## Use Cases - Telegram message logging - Event archival - Backup storage ## Related - #3 (original logbot issue) - #35 (cron for scheduled archival) - Needs Git plugin for auto-commit
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#44
No description provided.