Skip to main content

Factory-based logging decorators and batch ETL utilities

Project description

python_devops

This repository is intended to be a DevOps toolkit workspace.

It contains practical, reusable projects and utilities that support common engineering and operations workflows, such as automation, observability, reliability, and deployment-related tasks.

Root-level deployment workflow

You can now deploy/build python-devops-logging-decorators directly from the python_devops root.

1) Create virtual environment (once)

py -m venv .venv

2) Install dependencies from root requirements

  • Runtime only:
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
  • Development profile:
.\.venv\Scripts\python.exe -m pip install -r requirements-dev.txt
  • Docs profile:
.\.venv\Scripts\python.exe -m pip install -r requirements-docs.txt

3) Run deployment/build from root

  • PowerShell:
.\deploy.ps1 -Profile dev
  • Bash:
./deploy.sh dev

Valid profiles are runtime, dev, and docs.

Build artifacts are written to dist/.

PyPI deployment config (Bitbucket)

A top-level TOML config now exists at pyproject.toml with deployment metadata for publishing the root distribution to PyPI from Bitbucket pipelines.

Published distribution name:

  • python-devops-logging-decorators

Import instructions

Install from PyPI:

pip install python-devops-logging-decorators

Or install locally from this repository root (editable):

pip install -e .

Then import both subprojects as:

import logging_decorators
import batch_etl

Install command:

pip install python-devops-logging-decorators

After install, you can import both packages:

import logging_decorators
import batch_etl

It includes:

  • project/dist paths
  • requirements profiles
  • PyPI and TestPyPI upload URLs
  • expected Bitbucket env var names for secrets
  • canonical install/build/check/upload command strings

Set these repository variables in Bitbucket before publishing:

  • PYPI_TOKEN
  • TEST_PYPI_TOKEN (optional; falls back to PYPI_TOKEN for TestPyPI)

Recommended pipeline flow:

  1. install dependencies
  2. build package
  3. run twine check
  4. upload to TestPyPI
  5. upload to PyPI (on release/tag)

Bitbucket pipeline file

Top-level pipeline config: bitbucket-pipelines.yml

  • pushes to main run publish to TestPyPI
  • tags matching v* run publish to PyPI

The pipeline reads [tool.python_devops.pypi.commands] from the root pyproject.toml, so deployment commands stay centralized in one file.

Component projects

logging_decorators

logging_decorators is a component library that provides Python decorators for standardized function logging.

It uses a factory pattern to create decorators by:

  • log level (debug, info, warning, error, critical)
  • handler type (stream, file, rotating_file, timed_rotating_file)
  • level + handler combinations (for example error_file, info_rotating_file)

It also supports optional formatter overrides and includes examples/tests so it can be adopted quickly in application or automation code.

batch_etl

batch_etl is a DAG-oriented ETL component library included in the same published distribution.

It provides:

  • abstract ETL primitives (BaseExtractor, BaseTransformer, BaseLoader)
  • a pipeline orchestrator (Pipeline) with dependency traversal and cycle detection
  • concrete CSV implementations (CsvFileExtractor, PassthroughRowsTransformer, CsvFileLoader)
  • demo utilities for OHLC CSV workflows (batch_etl.demo)

For detailed usage examples, see batch_etl/README.md.

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

python_devops_logging_decorators-0.1.4.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file python_devops_logging_decorators-0.1.4.tar.gz.

File metadata

File hashes

Hashes for python_devops_logging_decorators-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3f2bc2fdb1f69a6320b2339edb151c055bc63d17558b6e5ed8800e6b10d05d5d
MD5 5cedec04bfde27efcd07495c9e865b97
BLAKE2b-256 ff23ea4f4216ed1116e49b5a3fea52e11f5169cf2ce17cf1c513341461d784fa

See more details on using hashes here.

File details

Details for the file python_devops_logging_decorators-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for python_devops_logging_decorators-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5573993da1369db29cf4b2cef9a3d05e307d2a3fef08b0a0b5622c185d04dca
MD5 3a92bb7a53a155be9dbfd231f94b80e3
BLAKE2b-256 23d6dda5a2ac87fc600da589d50d5df0769686691acb4f751ee1538abc7e46db

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