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.2

Usage

Logger

from test_common_utils.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.2.tar.gz (2.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.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_common_utils-0.1.2.tar.gz
  • Upload date:
  • Size: 2.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.2.tar.gz
Algorithm Hash digest
SHA256 7a83ab6524145bfa07f9aa5ee2912879637fb0259e7497b9aefb939213dadcf4
MD5 6e4a8ce86532d0c0a53c29a92388bbc0
BLAKE2b-256 465286de2fa9c78e2b96fa921eef816fc855cd88b38ee8f4aaa0e2c44bd8c382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for test_common_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00391f6b9cc8a80de43d91b5a9c773f7e943d56eb9ca230dfd4ebbe52034ed0d
MD5 596409bb10545642bdade18527a2ebc5
BLAKE2b-256 52007abd367b690a65f3657cac4589fd8f646114a6331719c778effdbd06ae85

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