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
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:
- Pydantic (v2+): Data validation and settings management
- SQLModel (v0.0.24+): SQL databases with Python type hints
- Structlog (v24+): Structured logging
- Cachetools (v5+): Caching utilities
- Alembic (v1.13+): Database migrations
- Python-dotenv (v1+): Environment variables
Development
Prerequisites
- Python 3.12+
- uv package manager
Setup Development Environment
-
Clone the repository
git clone <repository-url> cd jinpy-utils
-
Install dependencies
uv sync --all-extras
-
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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and quality checks
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- Email: project.jintoag@gmail.com
- GitHub: jintoag
Support
If you encounter any issues or have questions:
- Check the issues page
- Create a new issue with detailed information
- Contact the maintainer via email
Made with ❤️ and Python
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file jinpy_utils-0.1.0a2.tar.gz.
File metadata
- Download URL: jinpy_utils-0.1.0a2.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9bb0629e95a5ff0a5f7e172e433819f47320c40dc837d755c85fae9c5df923c
|
|
| MD5 |
0ad5c8db714b2b087ea4dced7b38470a
|
|
| BLAKE2b-256 |
2c0c2783cc048aca94b88419020694d5c799f349a84d19e5f20337b2aa3c3c51
|
File details
Details for the file jinpy_utils-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: jinpy_utils-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 31.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
290b369979cab7b8631a287c6effca82c298f44daff0518e4655747b95b85716
|
|
| MD5 |
a80639077dd64d7d84706c39edce16c9
|
|
| BLAKE2b-256 |
5f7deda47e6e7bc0d01c2fda7b266c8168d893e45b90cfc928ec1ca047d1ba00
|