Metadata-Version: 2.4
Name: sylriekit
Version: 0.23.0
Summary: A personal Python toolbox of utilities.
Author: Kasterfly
License: MIT License
        
        Copyright (c) 2025 Kasterfly
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dill
Requires-Dist: fastmcp
Requires-Dist: flask
Requires-Dist: gunicorn
Requires-Dist: requests
Requires-Dist: cryptography
Requires-Dist: PyJWT
Requires-Dist: boto3
Requires-Dist: psycopg2-binary
Requires-Dist: mysql-connector-python
Requires-Dist: watchdog
Requires-Dist: webviewpy
Requires-Dist: redis
Requires-Dist: RestrictedPython
Requires-Dist: tiktoken
Requires-Dist: miniaudio
Dynamic: license-file

## Sylriekit
A personal toolset I made for myself to speed up the creation of some random personal projects.

**Warning**: This is a personal project and may contain bugs or incomplete features. It is mainly coded for convenience over optimization. Use at your own risk.

---
## Tools
+ ### PHP-like tools:
  #### Constants
  - Immutable constants manager. Define values that cannot be modified or deleted after creation.
  #### InlinePython:
  - Python renderer for inline code blocks in files. (similar to php with `<?py ... ?>`)

+ ### AI-related tools:
  #### LLM
  - LLM API client supports OpenAI, Anthropic, xAI, Gemini, and OpenRouter. Handles chat sessions, tool calling, and MCP server integration.
  #### MCP
  - A simple FastMCP extension/wrapper. Adds some logging and error handling built-in tools for convenience. 
  #### TTS
  - Text-to-Speech tool uses ElevenLabs for the audio generation and the pip package miniaudio for playing the audio.

+ ### Execution and Automation:
  #### Template
  - Sandboxed Python execution engine using RestrictedPython with configurable profiles, pre-code injection, import whitelisting, timeout protection, and save/load support for templates with embedded profiles.
  #### Schedule
  - Scheduler for interval, daily, and file-watch tasks with registry management.
  #### Process
  - Subprocess wrapper for running commands with configurable timeouts, environment, shell usage, and output trimming while returning structured results.

+ ### Development Support:
  #### Log
  - Simple logging tool with Log.log(...) or automatic logging with decorators for functions.
  #### Cache
  - A simple function-based cache using decorators.
  #### Profile
  - Timing and profiling helper with context managers, decorators, and direct measurements plus optional memory tracking and stored records.

+ ### Web and GUI:
  #### Website
  - Flask web server with Gunicorn support. Features `<python>` tag rendering, function caching with JS bridge, session management, and API endpoints. Uses Redis for cross-worker session/rate-limit storage.
  #### Window
  - Desktop GUI applications using webviewpy. Supports HTML/CSS/JS with `<python>` tags for defining Python functions callable from JavaScript. Enables hybrid desktop apps with web technologies.
  #### SharedStore
  - Redis-backed storage for cross-worker data sharing. Handles sessions, rate limiting, and function caching. Used internally by Website but can be used standalone.

+ ### Other Tools:
  #### Files
  - File system utilities with searching, reading, editing, directory operations, grep, etc.
  #### API
  - HTTP request helper with configurable presets for headers, endpoints, API keys, and quick call execution returning structured responses.
  #### Git
  - Local git wrapper for managing repositories, branches, commits, and remotes.
  #### Security
  - Cryptography helper for RSA/Symmetric encryption, hashing, and JWT management.
  #### Database
  - Unified interface for interacting with SQLite, PostgreSQL, MySQL, and DynamoDB.

+ ### Languages:
  #### C
  - Compile and run C code from Python with automatic argument parsing and caching.
  #### GoLang
  - Compile and run Go code from Python with automatic argument parsing and caching.
  #### Rust
  - Compile and run Rust code from Python using Cargo with automatic argument parsing and caching.
  #### Nim
  - Compile and run Nim code from Python with automatic argument parsing and caching.

---

## Config
Each tool has class-level defaults that can be overridden via `load_config()`. Pass a dictionary/JSON where keys are tool names and values are dictionaries of settings (Settings/Variables not provided will use the tool's built-in defaults.)

Example config structure:
```
{
  "Files": {
    "MAX_DEPTH_DEFAULT": 42,
    "PATH_SEP": "/"
  }
}
``` 
using `sylriekit.load_config(config:dict)` will load the config for all tools, to centeralize the configuration of multiple tools.

and using `sylriekit.generate_default_config(file_name: str, include_tools="*")` will generate a file that will contain all (or just selected ones with `include_tools=["ToolName1", ...]`) of the configurable values and their defaults.


---

#### Other Stuff
- `sylriekit.tool_functions(tool_name: str) -> list[str]`: Returns all public functions available in a tool.
- `sylriekit.get_code(tool_name: str, function_name: str) -> str`: Returns the source code of a specific tool's function. Use `"*"` as the function name to get the entire source code of the tool.
- `sylriekit.help()`: Prints a short message for how to use the sylriekit's help-related functions.

---

### Change Log:
**0.23.0**:
 - Added four new tools for coding language support that allow C, GoLang, Rust, and Nim to be compiled in a __(LangaugeName)Cache__ folder and be callable from python.

**0.18.4**:
 - Fixed a scope error in the Website tool.

**0.18.3**:
 - Fixed the Website tool, with an import error preventing it from starting up correctly.

**0.18.2**:
 - Fixed the auto tag in the Database tool to use a better method for getting the current time

**0.18.1**:
 - Updated the Database tool to us an "auto" tags for automatic assignment with auto-id, auto-created_at, auto-updated_at, or just auto if the name of the column is one of those three options.

**0.18.0**:
 - Added a Text-to-speech tool (TTS) that uses ElevenLabs and miniaudio to play the audio.
 - Fixed the LLM tool (accidentally deleted the private classes in 0.17.7)
 - Added delete_table and table_exists to the Database tool.

**0.17.7**:
 - Remade the Database tool entirely. It works better with DynamoDB now and has better built-in encryption, hashing, and fingerprinting.
 - Updated the Website tool to use the new Database tool more effectively.

**0.17.6**:
 - Remade the LLM tool entirely. It now allows serverless tools that are similar to MCP tools, streamed chats, supports OpenRouter, and no longer supports Local LLMs (until I can figure out a way to make it work consistently).
 - Removed the InlinePython's console.log() of the cached functions.

**Previous change log entries are visible in the description of older versions**
