Skip to main content

Local assistant daemon for PutPlace file uploads (includes pp_client CLI)

Project description

PutPlace Assist

Local assistant daemon for file uploads to the PutPlace server.

Overview

PutPlace Assist is a local FastAPI daemon that runs on client machines to assist with file uploads. It provides:

  • Path Registration: Register directories to be scanned and uploaded
  • File Watching: Automatic detection of file changes via watchdog
  • SHA256 Checksums: Automatic calculation and tracking of file hashes
  • Upload Queue: Background file uploads with retry logic
  • Real-time Activity: SSE and WebSocket endpoints for monitoring
  • SQLite Database: Local tracking of files, upload status, and activity

Installation

pip install putplace-assist

Quick Start

Start the Daemon

# Start in background
ppassist start

# Start in foreground (for development)
ppassist start --foreground

# Check status
ppassist status

# Stop daemon
ppassist stop

Using the API

Register a path:

curl -X POST http://localhost:8765/paths \
  -H "Content-Type: application/json" \
  -d '{"path": "/path/to/watch", "recursive": true}'

Add exclude patterns:

curl -X POST http://localhost:8765/excludes \
  -H "Content-Type: application/json" \
  -d '{"pattern": "*.log"}'

Configure remote server:

curl -X POST http://localhost:8765/servers \
  -H "Content-Type: application/json" \
  -d '{"name": "production", "url": "https://app.putplace.org", "username": "user", "password": "pass"}'

Trigger uploads:

curl -X POST http://localhost:8765/uploads \
  -H "Content-Type: application/json" \
  -d '{"upload_content": true}'

Monitor activity (SSE):

curl http://localhost:8765/activity/stream

API Endpoints

Status

  • GET / - Root endpoint
  • GET /health - Health check
  • GET /status - Daemon status

Paths

  • GET /paths - List registered paths
  • POST /paths - Register a new path
  • GET /paths/{id} - Get path details
  • DELETE /paths/{id} - Unregister a path
  • POST /paths/{id}/scan - Trigger rescan

Excludes

  • GET /excludes - List exclude patterns
  • POST /excludes - Add exclude pattern
  • DELETE /excludes/{id} - Remove pattern

Files

  • GET /files - List tracked files
  • GET /files/{id} - Get file details
  • DELETE /files/{id} - Remove from tracking
  • GET /files/stats - File statistics

Servers

  • GET /servers - List configured servers
  • POST /servers - Add server configuration
  • DELETE /servers/{id} - Remove server
  • POST /servers/{id}/default - Set as default

Uploads

  • POST /uploads - Trigger file uploads
  • GET /uploads/status - Upload status
  • GET /uploads/queue - Queue status

Activity

  • GET /activity - Recent activity events
  • GET /activity/stream - SSE event stream
  • WS /ws/activity - WebSocket events

Scanning

  • POST /scan - Full scan of all paths

Configuration

Configuration can be set via:

  1. Environment variables (prefix: PPASSIST_)
  2. TOML config file (ppassist.toml)
  3. Command-line defaults

Environment Variables

Variable Default Description
PPASSIST_SERVER_HOST 127.0.0.1 Host to bind to
PPASSIST_SERVER_PORT 8765 Port to bind to
PPASSIST_SERVER_LOG_LEVEL INFO Logging level
PPASSIST_DB_PATH ~/.local/share/putplace/assist.db Database path
PPASSIST_WATCHER_ENABLED true Enable file watching

Config File Example

Create ~/.config/putplace/ppassist.toml:

[server]
host = "127.0.0.1"
port = 8765
log_level = "INFO"

[database]
path = "~/.local/share/putplace/assist.db"

[watcher]
enabled = true
debounce_seconds = 2.0

[uploader]
parallel_uploads = 4
retry_attempts = 3

Development

# Install dev dependencies
uv pip install -e '.[dev]'

# Run tests
invoke test

# Run linter
invoke lint

# Format code
invoke format

# Run all checks
invoke check

# Run development server
invoke serve

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

putplace_assist-0.2.1.tar.gz (88.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

putplace_assist-0.2.1-py3-none-any.whl (79.8 kB view details)

Uploaded Python 3

File details

Details for the file putplace_assist-0.2.1.tar.gz.

File metadata

  • Download URL: putplace_assist-0.2.1.tar.gz
  • Upload date:
  • Size: 88.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for putplace_assist-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a1fc27cb05f2d677a8a13b41c990cfc071449ff6b983f04fad2602637d8bb64d
MD5 7f27aeea0cb995011a88778f4f48217e
BLAKE2b-256 473a059a0df5c3b15a8aa7f44b0db318da7a1aabc5d06b662b52d3940a38a3ce

See more details on using hashes here.

File details

Details for the file putplace_assist-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for putplace_assist-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c383dba239597035bf326997256834be47be21cb0d997e41d155675cc13853c
MD5 aacca0d9a1fdf3c4d9a8e553e539cc3b
BLAKE2b-256 a38b790f782c05f10015a1176918db798f20ddad5fbda4c7eef16c10f137f471

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page