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
To activate
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.venv/Scripts.Activate.ps1
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
Before running deployment, do this preflight checklist:
- Run tests:
.\.venv\Scripts\python.exe -m pytest batch_etl/tests logging_decorators/tests -q -vv
-
Confirm package metadata/version in
pyproject.toml(name/version should match intended release). -
Ensure PyPI credentials are available as environment variables:
$env:PYPI_TOKEN = "<pypi-token>"
$env:TEST_PYPI_TOKEN = "<testpypi-token>" # optional
- (Optional) clear old build artifacts:
Remove-Item -Recurse -Force .\dist -ErrorAction SilentlyContinue
- PowerShell:
.\deploy.ps1 -Profile dev
- Bash:
./deploy.sh dev
Valid profiles are runtime, dev, and docs.
Build artifacts are written to dist/.
After build, validate distributions:
.\.venv\Scripts\python.exe -m twine check .\dist\*
Optional manual uploads:
- TestPyPI
.\.venv\Scripts\python.exe -m twine upload --repository-url https://test.pypi.org/legacy/ -u __token__ -p $env:TEST_PYPI_TOKEN .\dist\*
- PyPI
.\.venv\Scripts\python.exe -m twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p $env:PYPI_TOKEN .\dist\*
Tag note: tag releases as v<version> (example: v0.1.4) so the tag-based pipeline path can publish to PyPI.
PyPI deployment config (Bitbucket)
Use this release checklist for Bitbucket-driven publishing.
-
Confirm release metadata in
pyproject.toml:- distribution name:
python-devops-logging-decorators - version:
project.version - deploy commands:
[tool.python_devops.pypi.commands]
- distribution name:
-
Ensure repository variables are set:
PYPI_TOKENTEST_PYPI_TOKEN(optional; falls back toPYPI_TOKENfor TestPyPI)
-
Validate locally before pushing:
- run tests
- build package from root
- run
twine check dist/*
-
Push to
mainto trigger TestPyPI publishing. -
Create/push a version tag (
v<version>, for examplev0.1.4) to trigger PyPI publishing.
git tag -a v<version> -m "<some message>"
git push origin v<version>
- Verify the release from PyPI install:
pip install 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
Bitbucket pipeline file
Top-level pipeline config: bitbucket-pipelines.yml
- pushes to
mainrun 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
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 python_devops_logging_decorators-0.1.5.tar.gz.
File metadata
- Download URL: python_devops_logging_decorators-0.1.5.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98ddd3d8fd2f3ed1049b34e1fcf44d5ebe9efa235e366345c0aae7277cacf357
|
|
| MD5 |
ff440e851684290f4eea682c25d2f6bc
|
|
| BLAKE2b-256 |
c187f66cbf47eb95e6e4226b23c5754f173c91ff3bbdb43b2851d87023d822f3
|
File details
Details for the file python_devops_logging_decorators-0.1.5-py3-none-any.whl.
File metadata
- Download URL: python_devops_logging_decorators-0.1.5-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29d6b8aeb40c94d6400fd14f07932978d2658e883f0860df12b824cb23b38598
|
|
| MD5 |
8585cd6d6ae2e43c21c0f51eb09d5a29
|
|
| BLAKE2b-256 |
b7e8e20f97c29f0c643864e3f7838481aef88f78455007b7e1f2636d72a268c5
|