semvec/pypi-packages huggingface dataset:
toolsmith 0.2.0
Instantly turn your Python functions into structured, AI-callable tools.
License: MIT
Requires Python: <4.0,>=3.9

# toolsmith

Toolsmith turns your Python functions into structured, AI-callable tools, using type hints and docstrings. Integrates with any LLM provider that is compatible with the OpenAI API.

- **Very easy to use:** Just write normal Python functions with typehints.
- **Pydantic support:** Pydantic types get automatically serialized and deserialized.
- **Unopinionated:** Toolsmith gets out of the way in terms of how you want to wire up the LLM loop.
- **Fast:** Highly performant based on Pydantic's speed.

## Installation

```sh
$ pip install toolsmith
```

## Usage

Simply define any functions you may have normally:

```py
def create_user(name: str, age: int) -> str:
    """Saves a user to the DB"""
    return f"Created user {name}, age {age}"

def search_users(query: str, regex: bool) -> str:
    return "Found some users"
```

Put it all together and call the OpenAI API:

```py
import openai
import toolsmith

toolbox = toolsmith.create([create_user, search_users])

client = openai.OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Make a 33 year old user called Alice"}]
    tools=toolbox.get_schema(),
)

invocations = toolbox.parse_invocations(response.choices[0].message.tool_calls)
results = toolbox.execute_function_calls(invocations)
```
dtpyworker 1.0.0
A package to improved api library to have better development experience.
License: MIT
Requires Python: <3.12.0,>=3.11.9

# Celery Worker with Redis Integration

This package provides a simple implementation to register and manage tasks for a Celery worker, with Redis as the broker and result backend. It includes functionality for registering regular tasks, periodic tasks, and configuring various aspects of the Celery worker and Redis connection.

## Features

- Register and manage tasks with optional queues.
- Register periodic tasks with customizable schedules using crontab or timedelta.
- Configure Celery worker settings such as time zone, task serializers, result backend, and retry options.
- Set up Redis as the broker and backend with SSL support for secure connections.
- Automatically discover tasks for the Celery worker.

## Requirements

- Python 3.11+
- Celery
- dtpyredis

## Requirements

```bash
pip install dtpyworker
```

## Usage

### Define Tasks

To define tasks, create a Task object and register your routes:

```python
from dtpyworker.task import Task, crontab

task_manager = (
    Task()
    .register(route="my_task_route")
    .register_periodic_task(
        route="my_periodic_task_route",
        schedule=crontab(minute="*/5"),
        queue="default_queue"
    )
)
```

### Set Up Worker

Create a Worker instance, configure it with the Redis instance and registered tasks, and then create the Celery app

```python
from dtpyworker.worker import Worker
from dtpyredis.config import RedisConfig
from dtpyredis.connection import RedisInstance

# Initialize Redis connection
redis_config = RedisConfig()
redis_config.set_redis_host('localhost')
redis_config.set_redis_port(6379)
redis_config.set_redis_db(0)

redis_instance = RedisInstance(redis_config=redis_config)

# Initialize Worker and configure
worker = (
    Worker()
    .set_redis(redis_instance)
    .set_task(task_manager)
    .set_name("my_worker")
    .set_timezone("UTC")
)

# Create Celery app
celery_app = worker.create()
```

### Task Example

Define a simple task that can be executed by the worker:

```python
from dtpyworker.task import shared_task

@shared_task
def my_task():
    print("Executing my task!")
```

### Running the Worker

To start the Celery worker, run the following command in your terminal:

```bash
celery -A your_package.celery_app worker --loglevel=info
```

For periodic tasks, run the Celery Beat scheduler alongside the worker:

```bash
celery -A your_package.celery_app beat --loglevel=info
```
dtpylog 1.0.0
A light python package for advanced python log system.
License: MIT
Requires Python: <3.12.0,>=3.11.9

# Advanced Logs

`dtpylog` is a lightweight Python package designed to provide an advanced logging system. It allows you to log messages and events both locally and remotely using a configurable API. You can log messages in different levels (info, debug, warning, error) and have them stored or printed depending on your configuration.

## Features

- **Remote Logging**: Send logs to a remote logging service via an API with retries and exponential backoff.
- **Custom Handlers**: Supports console logging and file-based logging using rotating file handlers.
- **Flexible Configuration**: Easily configure logging behavior (e.g., log levels, API keys, etc.) via a Singleton `Config` class.
- **Celery Mode Support**: Special logging configuration for Celery tasks.
- **Custom Formatting**: Custom log message formatting with support for additional details in the logs.

## Installation

You can install the package directly with pip.

```bash
pip install dtpylog
```
dtpyftp 1.0.0
A package that has different utils, wrappers, and functions.
License: MIT
Requires Python: <3.12.0,>=3.11.9

# Python FTP Tools Package

A Python package that have some tools for ftp controlling.

## Installation

To use the `dtpyftp` in your project, you can install it directly via `pip`.

### Installation via `pip`

```bash
pip install dtpyftp
```
dtpyenv 1.0.0
A light python package for managing environment variables.
License: MIT
Requires Python: <3.12.0,>=3.11.9

# Environment Manager

A Python class for managing environment variables in an organized and controlled manner. This package provides an easy-to-use interface to load environment variables from a file, register allowed variables, and access them statically, with support for case-insensitivity and caching.

## Features

- **Load environment variables** from a `.env` file.
- **Override existing variables** with the option to allow or deny.
- **Register allowed variables** to control which variables can be accessed.
- **Case-insensitive access** to environment variables.
- **Caching** for efficient future access to environment variables.
- **Logging** for missing files or unregistered variables.

## Installation

To install this package, run the following command:

```bash
pip install dtpyenv
```