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.0.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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_common_utils-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 fff7280e5d6f25094a672e754a2e31a1b2fe23d9e75303649a53d3336c992981
MD5 23ef8751de686d50881580df7c752231
BLAKE2b-256 b0ad6bee9241e97830afeca5c4a42ccba7f949ea691acba8015f24f466d3db8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for test_common_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d23098fb89605047ab127d4584c7405152e5c09c4ac61f1ce5840bbde05849b
MD5 ade06fe810f6088a279ec767251bed1a
BLAKE2b-256 10d97cc16a369f04fd06a1487fc8aaa32301e554d053a27a16f290774044778c

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