Shared utilities, services, and RBAC system for TrackVault microservices
Project description
TrackVault Shared Library
Shared utilities and services for TrackVault microservices.
🚀 Quick Installation
Option 1: Install from PyPI (Recommended for Production)
# Install from PyPI
pip install trackvault-shared>=1.5.0
Benefits:
- ✅ Standard Python package installation
- ✅ Versioned releases
- ✅ Works in any environment
- ✅ CI/CD friendly
- ✅ No authentication required (public package)
Option 2: Install Locally (Development Only)
For local development, install in editable mode:
# From backend/ directory
cd backend
pip install -e ../trackvault-shared-lib
Benefits:
- ✅ Changes are immediately available (no reinstall needed)
- ✅ Perfect for active development
Note: For production/CI/CD, use PyPI (Option 1).
Features
- Event Bus: Redis Streams-based event publishing and subscription
- Plans Registry: Multi-tenancy plan definitions and validation
- Health Checks: Comprehensive health monitoring utilities
- Circuit Breaker: Prevent cascade failures
- Retry Pattern: Exponential backoff for resilient operations
- Event Schemas: Standardized event types for microservice communication
- Soft Delete: Soft delete mixins for Beanie models
Quick Start
from trackvault_shared import get_project_event_bus, PLANS
# Event Bus
bus = get_project_event_bus("redis://localhost:6379/0")
await bus.publish("project.created", {"project_id": "123"})
# Plans Registry
plan = get_plan_by_name("team")
print(plan["workspace_limits"])
📚 Publishing
To publish a new version:
- Update version in
pyproject.toml - Create a GitHub release (tag:
v1.5.0) - GitHub Actions automatically publishes to PyPI
PyPI API Token Setup:
- Go to https://pypi.org/manage/account/token/
- Create API token with "Upload packages" scope
- Add as secret
PYPI_API_TOKENin GitHub repository settings
License
MIT License - see LICENSE file for details.
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
trackvault_shared-1.5.0.tar.gz
(54.0 kB
view details)
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