Skip to main content

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:

  1. Update version in pyproject.toml
  2. Create a GitHub release (tag: v1.5.0)
  3. GitHub Actions automatically publishes to PyPI

PyPI API Token Setup:

  1. Go to https://pypi.org/manage/account/token/
  2. Create API token with "Upload packages" scope
  3. Add as secret PYPI_API_TOKEN in 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)

Uploaded Source

Built Distribution

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

trackvault_shared-1.5.0-py3-none-any.whl (65.5 kB view details)

Uploaded Python 3

File details

Details for the file trackvault_shared-1.5.0.tar.gz.

File metadata

  • Download URL: trackvault_shared-1.5.0.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for trackvault_shared-1.5.0.tar.gz
Algorithm Hash digest
SHA256 5de427c7f6110bf69bbffb2d6f08658e8cb88b4b888651947b5d537480513451
MD5 d74ab96519d2ac4a5e166f8861bb29ae
BLAKE2b-256 3e838f3723d3c6ae4996dfd33786dc1b8b6b2e2b871c470093ef5727b4f51a1b

See more details on using hashes here.

File details

Details for the file trackvault_shared-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trackvault_shared-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0abe7d3d722ace5ea7cb96b4d6145ab35caa5bc237fe7ff30ccfba00d560beb2
MD5 6777de16e0393d892d0e0e98654adedc
BLAKE2b-256 3e119bfc41ff29111445245d3a467027b8414efc7a6344ed165efe45752f70f9

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