semvec/pypi-packages huggingface dataset:
manageconfig 1.1.2
Small package for working with config files
Requires Python: >=3

# ManageConfig

[![PyPI](https://img.shields.io/pypi/v/manageconfig)](https://pypi.org/project/manageconfig/)
[![Python](https://img.shields.io/pypi/pyversions/manageconfig)](https://pypi.org/project/manageconfig/)
[![License](https://img.shields.io/pypi/l/manageconfig)](https://github.com/guyshe/manageconfig/blob/main/LICENSE)

Tiny, practical config loader that turns JSON and YAML into dot-access objects.
Designed for scripts, CLIs, and small services that want clean config access
without a heavy dependency tree.

## Highlights

- Dot access for nested config values (`conf.db.host`)
- JSON and YAML support with a single API
- Lightweight, no magic beyond clean attribute access
- Friendly to scripts and small apps

## Install

```bash
pip install manageconfig
```

## Quickstart

```python
from manageconfig import Config

conf = Config.load_from_yml("config.yml")

print(conf.string2)
print(conf.string1)

# Prints "localhost"
print(conf.mysqldatabase.hostname)

# i == 3013
i = conf.mysqldatabase.port + 1
```

## Use Cases

- Project settings loaded once and reused across modules
- Local dev secrets and per-environment configuration
- Lightweight config handling in CLI tools

## Example Config (YAML)

```yml
# comment syntax

# basic syntax - key and value separated by colon and space before the value
key: value

# Scalar data types
integerValue: 1                     # integer value
floatingValue: 1                     # floating value

stringValue: "456"                  # string with double quotes
stringValue: 'abc'                   # string with single quotes
stringValue: wer                     # string without quotes

booleanValue: true                   # boolean values - true or false

# Multiline string with literal block syntax - preserved new lines
string1: |
  Line1
  line2
  "line3"
  line4

# Multiline strings with folded block syntax - new lines are not preserved,
# leading and trailing spaces are ignored
string2: >
  Line1
  line2
  "line3"
  line4

# Collection sequence data types
arraylist:
  - One
  - two
  - Three

arraylist2: [one, two , three]

mysqldatabase:
  hostname: localhost
  port: 3012
  username: root
  password: root
```

## JSON Support

Use `Config.load_from_json("config.json")`.

## API

- `Config.load_from_yml(path)` loads YAML into a dot-access object
- `Config.load_from_json(path)` loads JSON into a dot-access object

## Testing

```bash
tox
```
telegram-handler 1.4.5
Small package for working with config files
Requires Python: >=3

# Telegram Handler
Drop-in Python `logging.Handler` that forwards log records to a Telegram chat or channel with buffering, retries, and a background worker so your app stays responsive.

## Highlights
- Works with channel usernames or chat IDs; just pass your bot token and destination.
- Buffered writer batches messages and trims overlong payloads to avoid Telegram limits.
- Automatic retries with backoff when Telegram throttles or transient network errors occur.
- Thread-safe background thread keeps log emission non-blocking for the main application.
- Simple to slot into existing logging setups alongside stream/file handlers.

## Install
```bash
pip install telegram-handler
```

## Quickstart
```python
import logging

from telegram_handler import TelegramLoggingHandler

BOT_TOKEN = "123456:ABCDEF_example_bot_token"
CHANNEL = "example_channel_logger"  # or an integer chat ID

handler = TelegramLoggingHandler(BOT_TOKEN, CHANNEL)
logging.basicConfig(
    handlers=[handler, logging.StreamHandler()],
    level=logging.INFO,
    format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
)

logger = logging.getLogger("demo")
for i in range(5):
    logger.error("iterating %s..", i)
```

## What you need
- Create a bot with [BotFather](https://core.telegram.org/bots#3-how-do-i-create-a-bot) to obtain `BOT_TOKEN`.
- Create a channel or use a chat; add your bot as an admin so it can post messages.
- Find the chat ID if you prefer using IDs instead of a public channel name (guide [here](http://techblog.sillifish.co.uk/2020/03/30/telegram-chat-id-and-token-id/)).

## Usage notes
- `bot_token`: token returned by BotFather (keep it secret; do not commit it).
- `channel`: public channel username (without the leading `@`) or an integer chat ID.
- Messages are buffered and flushed every few seconds in a daemon thread to keep logging non-blocking.
- Payloads are trimmed to stay under Telegram's message size limits; long bursts are split across flushes.
- The handler automatically retries with exponential backoff on Telegram's `429 Too Many Requests` responses.
- Call `handler.close()` during shutdown if you need to stop the background thread cleanly.

## Screenshot
![screenshot](https://github.com/guyshe/telegram_handler/blob/master/screenshot.png?raw=true)

## Development
- Run tests: `tox`
- Lint with ruff: `ruff check`