Skip to main content

OGuild utilities — reusable logging and helpers for Python projects

Project description

OpsGuild Logo
                🚀 Multi-Language Utilities Pack 🚀
                🐍 Python • 🔷 Node.js • 🦀 Rust • 🐹 Go
                ☕ Java • 🔵 C# • 🐘 PHP • 🦎 Python
                📦 Configuration • 🔍 Monitoring • 🛠️ Operations

OpsGuild Utilities Pack

License: GPL v3 Python 3.9+ Poetry

A comprehensive multi-language utilities pack providing essential tools and helper functions for modern software development. Currently featuring Python utilities with plans to expand to multiple programming languages.

🚀 What is OpsGuild Pack?

OpsGuild Pack is a collection of utility libraries designed to solve common development challenges across different programming languages and platforms. Think of it as your Swiss Army knife for software development operations.

Current Components

📦 Installation

Prerequisites

  • Python 3.9 or higher
  • Poetry (recommended) or pip

Using Poetry (Recommended)

poetry add oguild

Using pip

pip install oguild

🎯 Quick Start

Python Logger

from oguild.logs import logger

# Simple logging
logger.info("Hello, World!")
logger.debug("Debug information")

# The logger automatically detects the module name
# Output: INFO: (your_module_name) == Hello, World! [timestamp]

📖 Full Python Logger Documentation

Python Response Handling

from oguild.response import Ok, Error, police

# Success response
def get_user(user_id: int):
    user = {"id": user_id, "name": "John Doe"}
    return Ok("User retrieved successfully", user, status_code=200)

# Error handling with decorator
@police(default_msg="Failed to process request", default_code=500)
def process_data(data):
    # Your function logic here
    return processed_data

📖 Full Python Response Documentation

Python Utils

from oguild.utils import encode_json_fields, sanitize_fields

# JSON field processing
data = [{"id": 1, "metadata": {"key": "value"}}]
encoded = await encode_json_fields(data, ["metadata"])

# Data sanitization
clean_data = await sanitize_fields({
    "id": 1, "name": "John", "email": "", "age": None
})
# Result: {"id": 1, "name": "John"} - empty values removed

📖 Full Python Utils Documentation

🤝 Contributing

We welcome contributions across all planned languages! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone and setup
git clone https://github.com/OpsGuild/guildpack.git
cd guildpack

# Install development dependencies
poetry install --with dev

# Run tests
poetry run pytest

Contributing to New Languages

When contributing utilities for new languages:

  1. Create a new directory for the language (e.g., javascript/, go/, rust/)
  2. Follow the established project structure
  3. Include comprehensive tests
  4. Create a dedicated README.md for the package
  5. Update this main README with links to the new package
  6. Ensure consistent API design across languages

📄 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

🆘 Support

🔄 Changelog

Version 0.2.0

  • 🛡️ Response Module - Universal response handling and error management
    • Framework-agnostic error handling (FastAPI, Django, Flask, Starlette)
    • Smart error classification with specialized handlers
    • Async/sync support with automatic context detection
    • Comprehensive logging and stack trace capture
    • @police decorator for automatic error handling
  • 🔧 Utils Module - Data processing and sanitization utilities
    • JSON field encoding/decoding for database operations
    • Advanced data sanitization with customizable rules
    • Pydantic model integration
    • Type-safe async operations
    • Flexible field processors and mapping

Version 0.1.4

  • Initial release with Python logging utilities
  • Smart logger with automatic formatting
  • Logstash integration support
  • Multi-output logging (console, file, logstash)
  • Automatic module detection
  • Foundation for multi-language utilities pack

🌟 Why OpsGuild Pack?

OpsGuild Pack is designed to solve common development challenges across multiple programming languages:

  • Multi-Language Support - Consistent utilities across different tech stacks
  • Production Ready - Built with enterprise needs in mind
  • Developer Friendly - Automatic configuration and intelligent defaults
  • Extensible - Easy to customize and extend for specific use cases
  • Performance - Efficient utilities with minimal overhead
  • Standards Compliant - Follows best practices for each language
  • Unified Experience - Consistent API design across all supported languages

🎯 Use Cases

  • Microservices Architecture - Consistent logging, error handling, and data processing across services
  • Web API Development - Universal response handling and error management for any Python framework
  • Data Processing Pipelines - JSON encoding/decoding and data sanitization for ETL operations
  • Polyglot Teams - Unified utilities regardless of language choice
  • DevOps & SRE - Standardized operational tools across infrastructure
  • Enterprise Development - Consistent patterns for large-scale applications with robust error handling
  • Database Operations - JSON field processing and data normalization for database interactions
  • Open Source Projects - Reusable utilities for community projects

Made with ❤️ by the OpsGuild team

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

oguild-0.1.7.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

oguild-0.1.7-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file oguild-0.1.7.tar.gz.

File metadata

  • Download URL: oguild-0.1.7.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for oguild-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1253f5fa02fe235a74e763ae015693dcba8a1a21ad29bcbdcfe91f572c3d5acd
MD5 5c2c8209f85c1b9a28f1279d9c2c08bc
BLAKE2b-256 137e28dee520077ea42d3fc4947465e46d5371dda4060d8a272ee664f6a7aafe

See more details on using hashes here.

File details

Details for the file oguild-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: oguild-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 46.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for oguild-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7d11dec867c424621371d51aa1cc33085689b85cc2796c44e3af98bafa4f0a4c
MD5 bf4845cdc26c10d3c8f005dd243cb0ac
BLAKE2b-256 f940970a72da858be1e4d139a74905935426cde91067b606a60eec1899c711ff

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