Metadata-Version: 2.4
Name: sylriekit
Version: 0.38.0
Summary: A personal Python toolbox of utilities.
Author: Kasterfly
License-Expression: MIT
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: PyYAML
Requires-Dist: psutil
Dynamic: license-file

# Sylriekit

A versatile Python utility kit designed to accelerate the development of personal projects. It provides a collection of modular tools for common tasks, ranging from file management and logging to GUI development and LLM integration.

---

## Disclaimer

**Warning**: This is a personal kitchen-sink project. It is mainly coded for convenience and rapid prototyping over peak optimization. Features may be incomplete or experimental. Use at your own risk.

---

## Installation

```bash
pip install sylriekit
```

---

## Tool Reference

| Tool | Type | Description                                                                                          |
| :--- | :--- |:-----------------------------------------------------------------------------------------------------|
| **LLM** | Normal | Multi-provider single-chat client (Anthropic, OpenAI, Google, etc.) with tool calling and streaming. |
| **ThreadedLLM** | Normal | `LLM` subclass that runs sends on a background worker thread and delivers results via callbacks.      |
| **Background** | Normal | Launch detached background processes that survive the script exiting, and stop/list them later (even from another run). |
| **Archive** | Normal | Create, extract, inspect, and validate `.tar.zst` archives. |
| **Logging** | Normal | Tiny timestamped file logger with `log()` and an `auto()` function-call decorator. |
| **StaticUtils** | Static | Small static helpers: `Cache.ttl()`, `Timeout.ttl()`, and extension-aware `Files.read()` / `Files.write()`. |
| **Network** | Static | Simple TCP/UDP senders, UDP broadcast, decorator listeners, and public/LAN IP helpers. |
| **NetworkDiagnosis** | Normal | PID-aware connection tracker, new-PID watcher, TCP port scanner, and network event/message recorder. |

---

## Change Log
### 0.38.0
- **NetworkDiagnosis**: new PID-aware network diagnosis tool with `start()`, `stop()`, `add()`, `drop()`, `@OnNewPID()`, `connections()`, `messages()`, `scan()`, and `save()`; packet capture is optional via scapy when enabled

### 0.37.0
- **Network**: new simple network helper with `TCP()`, `UDP()`, `UDP_Broadcast()`, `@listen()`, `GetPublicIP()`, and `GetLANIP()`; packet capture/diagnostics intentionally left for a separate tool

### 0.36.0
- **Archive**: new `.tar.zst` archive tool with `create()`, `extract()`, `contents()`, and `is_archive()`
- **Logging**: re-added as a simplified timestamped file logger with `log()` and `auto()`
- **StaticUtils**: added `Cache.ttl()`, `Timeout.ttl()`, and extension-aware `Files.read()` / `Files.write()`; package now requires Python 3.14+

### 0.35.0
- **Background**: new tool — `start()` launches a detached background process (e.g. a server) that keeps running after your script exits; `stop()`/`stop_all()`/`list()`/`is_running()` manage them via a shared JSON state file, so any later run can stop them

### 0.34.0
- **LLM**: major simplification — split into smaller classes. Each `LLM` instance is now a single chat (removed `generate_chat`, `use_chat`, and per-call `chat_id` handling); create multiple instances for multiple chats
- **LLM**: added `copy(other)` to duplicate another instance's chat contents (config, tools, message history); works across `LLM` and `ThreadedLLM`
- **LLM**: removed all threading from the base class (`threaded()`, `on_reply()`, `on_live_reply()`); `send()`/`send_live()` are now synchronous-only and `get_current_context_length()` takes no arguments
- **ThreadedLLM**: new tool — an `LLM` subclass that enqueues `send()`/`send_live()` on a background worker and delivers results via `on_reply()`/`on_live_reply()` callbacks

### 0.33.0
- **Major slimming pass**: the kit is now just `LLM`
- **Removed tools**: `ConfigLoader` — `LLM` now handles its own config data without depending on a shared config loader
- **Removed tools**: `Logging`, `PyIndex`, `SMS`, `StartUp`, `Telegram`, `ToExecutable`, `TTS`, `Window`, `ComputerControl`, `JHtml` — all niche/unused; src, docs, and tests deleted
- **Packaging**: dependencies reduced to `requests` and `PyYAML`; removed JavaScript package data

### 0.32.0
- **Rust**: removed the tool entirely (PyO3/maturin compile-and-import helper) — too niche for this kit; src, docs, and tests deleted

### 0.31.1
- **Window**: `LINK_PYTHON`/component discovery no longer lets an imported module kill the host app — a module that calls `sys.exit()` (or raises any `BaseException`) at import time is now skipped with a stderr warning instead of propagating `SystemExit`; `KeyboardInterrupt` still propagates. Docs now note that discovery executes module top-level code.

### 0.31.0
- **All tools**: simplification + cleanup pass; UPPER_CASE config keys everywhere; one plain `pytest` now runs the full suite
- **ConfigLoader**: `class_name` is now required (auto-detection removed); `get_defaults()` returns plain values; unparseable string configs raise
- **Files**: unified return conventions (`None`/`False` instead of raising on missing sources); removed the `@iN` shortcut
- **Logging**: removed `LoggingError`; `log()` narrowed to `(message, level, log_name)`
- **StartUp**: `purge()` merged into `remove(name, force=True)`
- **LLM**: removed response cache, presets, MCP stub, and tiktoken; added `MAX_TOKENS`; compat adapters collapsed
- **Window**: removed `register_class`, `layouts.specs` writing, and dead JS paths; pylink JS extracted to a template file
- **Telegram**: removed `send_formatted`; added `RESOLVE_TIMEOUT` config key
- **SMS**: `batch_send` is now sequential (fixes double rate-limiting)
- **TTS**: added one-call `speak()` convenience
- **PyIndex**: folder indexing always returns a list
- **Rust / ToExecutable**: toolchain checks deferred to `compile()`; maturin/pyinstaller installed on demand
- **ComputerControl / JHtml**: now top-level imports (`from sylriekit.JHtml import JHtml`)
- **Packaging**: pruned unused dependencies; added missing `miniaudio`; new development guidelines

### 0.30.2
- **Window**: `EXTRA_PYTHON_FEATURES` polishing

> Previous change log entries are available in the description of older versions.
