semvec/pypi-packages huggingface dataset:
fk_util_tools 0.2.0
This repository provides utility tools and common functions for FK projects, including helpers for configuration, logging, middleware, AWS integration, and OpenTelemetry instrumentation for Python web frameworks.
License: MIT
Requires Python: <4.0,>=3.10

# fk-util-tools

Utility tools and shared functions for FK projects: centralized configuration, logging, middlewares, AWS integration, and OpenTelemetry tracing for Python web frameworks.

## Installation

```bash
pip install fk-util-tools
```

## Main Features

- **Centralized Configuration**: `Config` class for global settings management.
- **Cache**: Redis integration.
- **Environment Variables & AWS**: Access to AWS Parameter Store and Secrets Manager.
- **Custom Exceptions**: HTTP error handling with custom codes.
- **Structured Logging**: Logging for FastAPI and other frameworks.
- **Middlewares**: SQL Printer, error handling, internationalization, and language support for Flask, Django, and FastAPI.
- **OpenTelemetry Tracing**: Instrumentation for Flask, Django, FastAPI, and AWS Lambda.
- **Type Hints**: PEP 561 support.

## Usage Examples

### Configuration

```python
from fk_utils import SETTINGS
print(SETTINGS.ENV)
```

### Structured Logging in FastAPI

```python
from fastapi import FastAPI
from fk_utils.logging.fastapi.logging import setup_logging

app = FastAPI()
setup_logging(app)
```

### SQL Printer Middleware

#### Flask

```python
from flask import Flask
from fk_utils.middlewares.flask.sql_middleware import SqlPrintingMiddleware

app = Flask(__name__)
app.config['DEBUG'] = True
SqlPrintingMiddleware(app)
```

#### Django

```python
from fk_utils.middlewares.django.sql_middleware import SqlPrintingMiddleware

SqlPrintingMiddleware()
```

#### FastAPI

```python
from fk_utils.middlewares.fastapi.sql_middleware import SqlPrintingMiddleware

app = FastAPI()
SqlPrintingMiddleware(app)
```

### OpenTelemetry Instrumentation

```python
from fk_utils.traces.opentelemetry.fastapi.trace import instrument_app

app = FastAPI()
instrument_app(app)
```

### AWS Lambda Instrumentation

```python
from fk_utils.traces.opentelemetry.fastapi.aws_lambda.trace import instrument_app

app = FastAPI()
is_lambda = instrument_app(app, instrument_lambda=True)
print("Lambda instrumented:", is_lambda)
```

## License

MIT
demo137 0.1.0
A sample Python package for demonstration purposes.
License: MIT
Requires Python: >=3.6

# demo137

A sample Python package for demonstration purposes.

[![PyPI version](https://badge.fury.io/py/demo137.svg)](https://badge.fury.io/py/demo137)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/demo137)](https://pepy.tech/project/demo137)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)

demo137 is a small, pure-Python package that provides a handy utility for summarizing a list of integers.

Installation
-------------
pip install demo137

Usage
-----
The package exposes a single pure function:

- summarize_numbers(numbers)
  - Input: a sequence of integers (e.g., list or tuple)
  - Output: a dictionary with the following keys:
    - count: number of elements
    - total: sum of elements
    - min: minimum value or None if empty
    - max: maximum value or None if empty
    - average: arithmetic mean or None if empty

Example
-------
```python
from demo137 import summarize_numbers

numbers = [1, 2, 3, 4, 5]
summary = summarize_numbers(numbers)
print(summary)
# Output: {'count': 5, 'total': 15, 'min': 1, 'max': 5, 'average': 3.0}
```

License
-------
MIT License

Author
------
Eugene Evstafev <hi@eugene.plus>

Repository
----------
https://github.com/chigwell/demo137