Skip to content

Auriora/admin-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Admin Assistant

License: GPL v3 Python 3.12+ Tests codecov GitHub issues GitHub last commit Status: Development

A comprehensive calendar management and timesheet automation system for Microsoft 365 users. Admin Assistant automates calendar archiving, appointment categorization, overlap resolution, privacy management, and timesheet generation for professional service providers.

πŸš€ Project Status

Current Status: Core infrastructure complete (80%), implementing timesheet generation and travel management features.

  • βœ… Infrastructure Complete: Microsoft Graph integration, database schema, CLI interface, testing framework
  • βœ… Phase 1 Workflows: Calendar archiving, category processing, overlap resolution, privacy automation
  • πŸ”„ In Progress: PDF timesheet generation, travel detection, Xero integration
  • πŸ“‹ Next: Enhanced web interface, email notifications, client communications

For detailed status and implementation roadmap, see Consolidated Action Plan.

πŸ“š Documentation

Quick Start Documents

Complete Documentation Structure

docs/
β”œβ”€β”€ 1-requirements/          # System requirements and use cases
β”œβ”€β”€ 2-design/               # Architecture and design documents
β”œβ”€β”€ 3-implementation/       # Implementation guides
β”œβ”€β”€ 4-testing/             # Test cases and plans
β”œβ”€β”€ guidelines/            # Development guidelines
└── CAP-001-Consolidated-Action-Plan.md  # Main project roadmap

πŸ› οΈ CLI Usage

The Admin Assistant provides a powerful CLI for managing calendars, archives, categories, and timesheet operations.

Quick Start

# Set user environment variable to avoid repeating --user
export ADMIN_ASSISTANT_USER=123

# Login to Microsoft 365
admin-assistant login msgraph --user 123

# Archive calendar events
admin-assistant calendar archive --archive-config 1 --date "last 7 days"

# List categories
admin-assistant category list

# Generate timesheet (coming soon)
admin-assistant timesheet export --output PDF

Core Commands

Calendar Operations

# Archive calendar events using a specific config
admin-assistant calendar archive "Work Archive" --user <USER_ID> --date "last week"

# List calendars for user
admin-assistant calendar list --user <USER_ID> --store msgraph

# Create new calendar
admin-assistant calendar create --user <USER_ID> --store msgraph --name "Archive Calendar"

# Analyze overlapping appointments
admin-assistant calendar analyze-overlaps --user <USER_ID> --start-date "2024-01-01"

# Backup calendar to file
admin-assistant calendar backup --user <USER_ID> --source "Work Calendar" --destination "/backups/work.csv" --format csv

# Backup calendar to another calendar
admin-assistant calendar backup --user <USER_ID> --source "Work Calendar" --destination "Work Backup" --format local_calendar

Category Management

# List categories
admin-assistant category list --user <USER_ID> --store local

# Add new category
admin-assistant category add --user <USER_ID> --name "Client Work" --description "Billable client work"

# Validate appointment categories
admin-assistant category validate --user <USER_ID> --start-date "2024-01-01" --stats

Configuration Management

# List all archive configs for a user
admin-assistant config calendar archive list --user <USER_ID>

# Create a new archive config (interactive prompts for missing fields)
admin-assistant config calendar archive create --user <USER_ID>

# Create a new archive config (all options provided)
admin-assistant config calendar archive create --user <USER_ID> --name "Work Archive" --source-uri "msgraph://source" --dest-uri "msgraph://dest" --timezone "Europe/London" --active

# Activate/deactivate/delete a config
admin-assistant config calendar archive activate --user <USER_ID> --config-id <CONFIG_ID>
admin-assistant config calendar archive deactivate --user <USER_ID> --config-id <CONFIG_ID>
admin-assistant config calendar archive delete --user <USER_ID> --config-id <CONFIG_ID>

Authentication

# Login to Microsoft 365
admin-assistant login msgraph --user <USER_ID>

# Logout
admin-assistant login logout --user <USER_ID>

Background Jobs

# Schedule automatic archiving
admin-assistant jobs schedule --user <USER_ID> --config-id <CONFIG_ID> --frequency daily

# Check job status
admin-assistant jobs status --user <USER_ID>

# Trigger manual archive
admin-assistant jobs trigger --user <USER_ID> --config <CONFIG_ID>

# Schedule automatic backup
admin-assistant jobs schedule-backup --user <USER_ID> --source "Work Calendar" --destination "/backups/work.csv" --type daily --hour 2

# Check backup job status
admin-assistant jobs backup-status --user <USER_ID>

Appointment Restoration

# Restore appointments from audit logs (failed operations)
admin-assistant restore from-audit-logs --user <USER_ID> --start-date "2025-05-29" --end-date "2025-06-06"

# Restore from backup calendars
admin-assistant restore from-backup-calendars --user <USER_ID> --source "Recovered" "Recovered Missing" --destination "Consolidated Recovery"

# Backup a calendar to file
admin-assistant restore backup-calendar --user <USER_ID> --source "Main Calendar" --destination "backup.csv" --format csv

# List restoration configurations
admin-assistant restore list-configs --user <USER_ID>

# Dry run (preview without making changes)
admin-assistant restore from-audit-logs --dry-run

For complete CLI documentation, see CLI Command Structure.

πŸ—οΈ Architecture

Admin Assistant is built as a modular, service-oriented application with:

  • Core Layer: Business logic, domain models, and data access abstractions
  • Web Interface: Flask-based web UI with Bootstrap and Jinja2
  • CLI Interface: Typer-based command-line interface for automation
  • Integration Layer: Microsoft Graph, Google Directions, Xero, OpenAI APIs
  • Data Layer: SQLAlchemy with PostgreSQL/SQLite support
  • Background Processing: Flask-APScheduler for automated tasks

Key architectural patterns:

  • Repository pattern for data access abstraction
  • Service layer for business logic
  • Orchestrator pattern for complex workflows
  • Generic entity associations for extensibility

See System Architecture for detailed technical documentation.

πŸš€ Getting Started

Prerequisites

  • Python 3.8+
  • Microsoft 365 account with calendar access
  • Virtual environment (recommended)

Installation

# Clone the repository
git clone https://github.com/bcherrington/admin-assistant.git
cd admin-assistant

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Initialize database
python -m flask db upgrade

# Login to Microsoft 365
admin-assistant login msgraph --user <YOUR_USER_ID>

First Steps

  1. Create an archive configuration: admin-assistant config calendar archive create --user <USER_ID>
  2. Test archiving: admin-assistant calendar archive "Work Archive" --user <USER_ID> --date "yesterday"
  3. Validate categories: admin-assistant category validate --user <USER_ID> --stats

πŸ§ͺ Development

Running Tests

# Activate virtual environment
source .venv/bin/activate

# Run core application tests (default - excludes utility tests)
python scripts/dev_cli.py test all

# Run all tests including utilities
python scripts/dev_cli.py test all-inclusive

# Run only utility/development infrastructure tests
python scripts/dev_cli.py test utilities

# Run with coverage
python scripts/dev_cli.py test all --coverage

# Run specific test categories
python scripts/dev_cli.py test unit
python scripts/dev_cli.py test integration

Test Organization

  • Core Tests: Application logic, services, repositories (default runs)
  • Utility Tests: Testing infrastructure, development tools (excluded by default)
  • Integration Tests: End-to-end workflows and system integration

Development Guidelines

  • Follow the patterns established in core/ directory
  • Use repository pattern for data access
  • Add comprehensive tests for new features
  • Update documentation for API changes

See Development Guidelines for detailed coding standards.

πŸ“‹ Current Features

βœ… Implemented

  • Calendar Archiving: Automated daily archiving with overlap detection
  • Appointment Restoration: Generic restoration from audit logs, backup calendars, and export files
  • Calendar Backup: Backup calendars to various formats (CSV, JSON, ICS) or other calendars
  • Category Management: Appointment categorization with validation
  • Privacy Automation: Automatic privacy marking and out-of-office detection
  • Overlap Resolution: Smart detection and resolution of conflicting appointments
  • CLI Interface: Comprehensive command-line tools with restoration commands
  • Background Jobs: Scheduled archiving and maintenance tasks
  • Audit Logging: Complete audit trail for all operations with reversible operations support

πŸ”„ In Development

  • PDF Timesheet Generation: Extract and format billable hours
  • Travel Detection: Automatic travel appointment suggestions
  • Xero Integration: Invoice generation with timesheet attachments

πŸ“‹ Planned

  • Enhanced Web Interface: Improved UI for overlap resolution
  • Email Notifications: Client communications and status updates
  • Advanced Reporting: Analytics and insights dashboard

🀝 Contributing

This project follows the Solo-Developer-AI-Process framework for AI-assisted development.

For implementation tasks, see AI Implementation Prompts for ready-to-use development prompts.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“š Documentation

Quick Start

Project Documentation

Technical Documentation

πŸ”— Links

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •