Shared models and utilities for Event Bridge Log Analytics Platform
Project description
Event Bridge Log Analytics - Shared Package
Portfolio Project: A production-grade shared library demonstrating enterprise-level Python packaging, automated CI/CD, and modern DevOps practices.
🎯 Project Overview
This package serves as the foundational shared library for a microservices-based Event Bridge Log Analytics Platform. It demonstrates advanced software engineering practices including:
- Type-safe event modeling with Pydantic v2
- Automated release management with semantic versioning
- Modern CI/CD pipelines with GitHub Actions
- Secure PyPI publishing using trusted publishers (OIDC)
- Enterprise-grade code quality with comprehensive testing and linting
🏗️ Architecture & Design
Event-Driven Architecture
The package provides standardized event models for a distributed microservices architecture:
from event_bridge_log_shared.models.events.user import UserRegisteredEvent
from event_bridge_log_shared.models.events.ecommerce import OrderCreatedEvent
# Type-safe event creation with automatic validation
user_event = UserRegisteredEvent(
user_id="user123",
email="user@example.com",
username="newuser",
registration_method="email",
terms_accepted=True,
source="user-service"
)
# Events include automatic timestamping, ID generation, and metadata
print(f"Event ID: {user_event.event_id}")
print(f"Timestamp: {user_event.timestamp}")
Type Safety & Validation
All events extend BaseEvent with built-in features:
- Automatic UUID generation for event tracking
- ISO 8601 timestamps for precise timing
- Environment context (dev/staging/production)
- Correlation IDs for distributed tracing
- Extensible metadata system
- AWS EventBridge compatibility
Utility Functions
Service-agnostic helpers for AWS resource management:
from event_bridge_log_shared.utils import normalize_env, prefix_name, build_role_arn
env = normalize_env("development") # -> "dev"
bus_name = prefix_name(env, "event-bridge-log-bus") # -> "dev-event-bridge-log-bus"
role_arn = build_role_arn("123456789012", "MyExecutionRole")
🚀 Technical Highlights
Modern Python Packaging
- Python 3.13 with cutting-edge features
- Hatchling build backend for optimal package building
- UV for ultra-fast dependency management
- Dynamic versioning from single source
Production-Grade CI/CD
- Automated releases with semantic version bumping
- GitHub Actions workflows with job orchestration
- Repository dispatch for cross-workflow communication
- Trusted Publisher PyPI deployment (no API keys required)
- Comprehensive testing with pytest and coverage reporting
Code Quality & Security
- 100% type coverage with mypy strict mode
- Black and Ruff for consistent code formatting
- Pre-commit hooks for automated quality checks
- Security scanning and dependency validation
- Branch protection and automated testing
📦 Installation
# From PyPI (recommended)
pip install event-bridge-log-shared
# From source (development)
pip install git+https://github.com/cblack2008/event-bridge-log-shared.git
🔧 Development
Quick Start
git clone https://github.com/cblack2008/event-bridge-log-shared.git
cd event-bridge-log-shared
# One-command developer setup
make dev-setup
Available Commands
make test # Run tests with coverage
make lint # Lint and type check
make format # Auto-format code
make coverage-html # Generate HTML coverage report
make clean # Remove build artifacts
Release Process
The project features a fully automated release pipeline:
- Trigger Release: Run "Release" GitHub Action
- Automatic PR: Creates release branch with version bump
- Auto-merge: PR automatically merges after CI passes
- Auto-tag: Creates Git tag and GitHub Release
- Auto-deploy: Publishes to PyPI via trusted publisher
🔒 Security & Best Practices
- Zero secrets in code: All sensitive data via environment variables
- OIDC authentication: Modern secure publishing without API keys
- Input validation: All data validated with Pydantic models
- Type safety: Full type hints prevent runtime errors
- Dependency scanning: Automated vulnerability detection
🛠️ Technology Stack
| Category | Technologies |
|---|---|
| Language | Python 3.13 |
| Packaging | Hatchling, UV, PyPI |
| Validation | Pydantic v2, Type Hints |
| Testing | Pytest, Coverage.py, Pre-commit |
| CI/CD | GitHub Actions, Trusted Publishers |
| Code Quality | Black, Ruff, MyPy |
| Infrastructure | AWS EventBridge, IAM, CloudFormation |
📊 Project Metrics
- Test Coverage: 85%+ maintained
- Type Coverage: 100% with mypy strict mode
- Code Quality: A+ rating with comprehensive linting
- Automation: Fully automated release pipeline
- Documentation: Complete API and usage documentation
🎓 Learning Outcomes
This project demonstrates mastery of:
- Enterprise Python Development with modern tooling
- CI/CD Pipeline Design and workflow orchestration
- Package Distribution and dependency management
- Type System Design with advanced Pydantic usage
- DevOps Automation with GitHub Actions
- Security Best Practices in software delivery
📋 Requirements
- Python: 3.13+
- Dependencies: See
pyproject.tomlfor complete list - Development: UV package manager recommended
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure all checks pass:
make test lint - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Projects
- Event Bridge Log Analytics - Main microservices platform
📞 Contact
- Repository: GitHub
- Issues: GitHub Issues
- Author: cblack2008
This is a portfolio project demonstrating enterprise-level software engineering practices and modern Python development workflows.
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
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