Skip to main content

jinpy-utils is a collection of minimal, type-safe Python utilities for Caching, Logging, Settings, and ORM. It follows modern Python practices (PEP 8, mypy, Ruff) and maintains high test coverage.

Project description

jinpy-utils

CI PyPI - Version GitHub Release (latest by date including pre-releases) License: MIT Coverage

Status: dev (dev-releases). Latest version badges above are dynamic.

Minimal, type-safe utilities for Caching, Logging, Settings, and ORM. Built with modern Python practices (PEP 8, mypy, ruff) and high test coverage. This is an early release; APIs may evolve.

📚 Docs: See the documentation in docs/ (start with overview.md).

Features

  • 🚀 Caching: Advanced caching utilities with multiple backends
  • 📝 Logging: Structured logging with configurable console/file/REST/WebSocket backends
  • ⚙️ Settings: Configuration management with environment variable support
  • 🗄️ ORM: Database operations and migrations with SQLModel integration
  • ✅ Type Safe: Full type hints and mypy compatibility
  • 🧪 Well Tested: Comprehensive test coverage with pytest
  • 🔧 Developer Friendly: Pre-commit hooks and code quality tools

Requirements

  • Python: 3.12 or higher
  • Package Manager: uv (recommended)

Installation

Using uv (Recommended)

uv add jinpy-utils

Using pip

pip install jinpy-utils

Quick Start (Logging)

from jinpy_utils.logger.config import GlobalLoggerConfig, ConsoleBackendConfig
from jinpy_utils.logger.core import Logger

# 1) Configure once (12-factor friendly; env helpers available)
cfg = GlobalLoggerConfig(backends=[ConsoleBackendConfig(name="console")])
Logger.set_global_config(cfg)

# 2) Get a logger and log
log = Logger.get_logger("app")
log.info("hello", {"env": "dev"})

Core Dependencies

This library is built on top of these excellent packages:

Development

Prerequisites

  • Python 3.12+
  • uv package manager

Setup Development Environment

  1. Clone the repository

    git clone <repository-url>
    cd jinpy-utils
    
  2. Install dependencies

    uv sync --all-extras
    
  3. Install pre-commit hooks

    uv run pre-commit install
    

Commands

  • Format code: uv run ruff format .
  • Lint and fix issues: uv run ruff check --fix .
  • Type checking: uv run mypy .
  • Run tests: uv run pytest
  • Run tests with coverage: uv run pytest
  • Security scanning: uv run bandit -r jinpy_utils
  • Run all pre-commit hooks: uv run pre-commit run --all-files

Code Quality

This project maintains high code quality standards:

  • Code Formatting: Black
  • Linting: Ruff
  • Type Checking: MyPy with strict configuration
  • Security: Bandit for security issue detection
  • Testing: Pytest with coverage reporting
  • Pre-commit Hooks: Automated quality checks before commits

Project Structure (partial)

jinpy-utils/
├── src/
│   └── jinpy_utils/      # Main package directory
│       ├── __init__.py
│       └── py.typed         # Type information marker
├── tests/              # Test suite
├── docs/               # Documentation (coming soon)
├── pyproject.toml      # Project configuration
├── README.md           # This file
└── .pre-commit-config.yaml  # Pre-commit configuration

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details on:

  • Code style and standards
  • Testing requirements
  • Pull request process
  • Issue reporting

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and quality checks
  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

Roadmap (high-level)

  • Core caching implementations
  • Structured logging utilities
  • Settings management system
  • ORM helpers and utilities
  • Comprehensive documentation
  • Performance benchmarks
  • Plugin system

License

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

Author

Jinto A G

Support

If you encounter any issues or have questions:

  1. Check the issues page
  2. Create a new issue with detailed information
  3. Contact the maintainer via email

Made with ❤️ and Python

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

jinpy_utils-0.2.0.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

jinpy_utils-0.2.0-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file jinpy_utils-0.2.0.tar.gz.

File metadata

  • Download URL: jinpy_utils-0.2.0.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.11

File hashes

Hashes for jinpy_utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3239fd57defb8573a51e9dd3184e9bbd5c4606acff843b56591795cf60229613
MD5 7366c7ab7e627a4524c13b9a8ae41c06
BLAKE2b-256 2cc9837a274003e39a3b85ad3723f74097c34c512354042ad6c4b22ad3af24f0

See more details on using hashes here.

File details

Details for the file jinpy_utils-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jinpy_utils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04beb623f6ad7e9ddf20315cf5684b704704e26db3a912c1f193c977e9bf90ab
MD5 c3e486e20d7b7a6f7e7e601f1a1e09c8
BLAKE2b-256 512cee829fbd32cb6ef84502ed05b27a2f6fbd49a4a81ba6e033be90105f9701

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