Skip to main content

Common utilities using FastAPI and Pydantic

Project description

Test Common Utils

A collection of common utilities including a configurable logger with type hints and Pydantic integration.

Installation

You can install this package directly from GitHub using pip:

pip install git+https://github.com/YOUR_USERNAME/test-common-utils.git

Or add it to your project's requirements.txt:

git+https://github.com/YOUR_USERNAME/test-common-utils.git

To install a specific version:

pip install git+https://github.com/YOUR_USERNAME/test-common-utils.git@v0.1.0

Usage

Logger

from src.utils import create_logger

# Basic usage
logger = create_logger(name="my_app")
logger.info("Hello, world!")

# Custom configuration
logger = create_logger(
    name="my_app",
    level="DEBUG",
    format="%(asctime)s - %(levelname)s - %(message)s"
)

Development

To set up the development environment:

# Clone the repository
git clone https://github.com/YOUR_USERNAME/test-common-utils.git
cd test-common-utils

# Install with development dependencies
pip install -e ".[dev]"

Running Tests

pytest

Code Quality

# Format code
black .

# Lint code
ruff check .

# Type check
mypy src tests

Version Management

To bump the version:

# Bump patch version (0.1.0 -> 0.1.1)
./scripts/bump_version.py patch

# Bump minor version (0.1.0 -> 0.2.0)
./scripts/bump_version.py minor

# Bump major version (0.1.0 -> 1.0.0)
./scripts/bump_version.py major

CI/CD

The project uses GitHub Actions for:

  • Running tests on Python 3.8, 3.9, 3.10, and 3.11
  • Code quality checks (black, ruff, mypy)
  • Automatic publishing to PyPI when a version tag is pushed

To release a new version:

  1. Bump the version using the script
  2. Push the changes and tags
  3. The CI/CD pipeline will automatically publish to PyPI

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

test_common_utils-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

test_common_utils-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file test_common_utils-0.1.1.tar.gz.

File metadata

  • Download URL: test_common_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for test_common_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ef629abbd38d48055c6c521e03de712e19b58b74a8ca185ba2d07282c872ce0
MD5 e461f337a1d1ddf137b2babc532068b8
BLAKE2b-256 f253224d5e04012f9fc48fe4b321370ac05b3ee099b8f6f5ee5d69f499538766

See more details on using hashes here.

File details

Details for the file test_common_utils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for test_common_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7aedb12302a846b501bc2fef95dd4ce9ad0bd1c51f9abe15991ef982a2a88cc2
MD5 86761e2c228d1a61e2890422bf188800
BLAKE2b-256 526ad6187dd6103a347246ad766a6f32ad04dfffd19674060ed8e295ceddc468

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