Skip to main content

Shared models and utilities for Event Bridge Log Analytics Platform

Project description

Event Bridge Log Analytics - Shared Package

PyPI version Python 3.13 License: MIT Code style: black

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:

  1. Trigger Release: Run "Release" GitHub Action
  2. Automatic PR: Creates release branch with version bump
  3. Auto-merge: PR automatically merges after CI passes
  4. Auto-tag: Creates Git tag and GitHub Release
  5. 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.toml for complete list
  • Development: UV package manager recommended

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Ensure all checks pass: make test lint
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

📄 License

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

🔗 Related Projects

📞 Contact


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

event_bridge_log_shared-1.0.3.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

event_bridge_log_shared-1.0.3-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file event_bridge_log_shared-1.0.3.tar.gz.

File metadata

  • Download URL: event_bridge_log_shared-1.0.3.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for event_bridge_log_shared-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c8f27c36f2eed81ff288fa632bb5b0026b7aefa4b2624a84394ec38e630daf43
MD5 ca2604a730fe7cffde357dec75bd112d
BLAKE2b-256 c61f3c0ff9ca68e9fd8014de174abe68886decc77ca7a93d96b44983fd984e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for event_bridge_log_shared-1.0.3.tar.gz:

Publisher: deploy-build.yml on cblack2008/event-bridge-log-shared

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file event_bridge_log_shared-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for event_bridge_log_shared-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dcdd6c440c7a2602b246d383990b2e19943d9059fa5f4312f1afcc27d1bf7387
MD5 300140ca708cd739aff22c51dbe8b9de
BLAKE2b-256 33ba1f6b3f79730b31b8c2603dc58e4a168bd7510a38c44517d0842b219e2986

See more details on using hashes here.

Provenance

The following attestation bundles were made for event_bridge_log_shared-1.0.3-py3-none-any.whl:

Publisher: deploy-build.yml on cblack2008/event-bridge-log-shared

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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