Metadata-Version: 2.4
Name: python-devops-logging-decorators
Version: 0.1.4
Summary: Factory-based logging decorators and batch ETL utilities
Author: wilso
Project-URL: Homepage, https://bitbucket.org/ssw1991/python_devops
Project-URL: Repository, https://bitbucket.org/ssw1991/python_devops
Project-URL: Documentation, https://bitbucket.org/ssw1991/python_devops
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Logging
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.6.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.30.0; extra == "docs"

# 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)

```powershell
py -m venv .venv
```

### 2) Install dependencies from root requirements

- Runtime only:

```powershell
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
```

- Development profile:

```powershell
.\.venv\Scripts\python.exe -m pip install -r requirements-dev.txt
```

- Docs profile:

```powershell
.\.venv\Scripts\python.exe -m pip install -r requirements-docs.txt
```

### 3) Run deployment/build from root

- PowerShell:

```powershell
.\deploy.ps1 -Profile dev
```

- Bash:

```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:

```bash
pip install python-devops-logging-decorators
```

Or install locally from this repository root (editable):

```bash
pip install -e .
```

Then import both subprojects as:

```python
import logging_decorators
import batch_etl
```

Install command:

```bash
pip install python-devops-logging-decorators
```

After install, you can import both packages:

```python
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`.
