Skip to main content

Auto-generate OpenAI-compatible tool schemas from Python functions using decorators.

Project description

toolwrap-lite

toolwrap-lite is a lightweight Python package that automatically converts your Python functions into OpenAI-compatible function calling schemas using a simple decorator.

With Toolwrap-Lite, you can effortlessly expose any Python function — whether it's for CRM APIs, database queries, business logic, or custom tools — to modern AI agents, LLM frameworks, and autonomous systems that rely on structured tool schemas.

No more manually writing JSON schemas. Just decorate your function, and Toolwrap-Lite takes care of the rest.

Features

  • No manual JSON writing
  • Auto-extracts type hints and docstrings
  • Export all tools into tools.json
  • Plug into OpenAI, LangChain, or CrewAI easily

Example Use Cases

  • Autonomous agents calling real APIs (CRM, finance, weather, analytics, etc.)
  • RAG systems with dynamic function augmentation
  • LangChain or CrewAI toolchains
  • Backend SaaS tools exposed to AI copilots
  • AI-powered automation platforms
  • Self-hosted AI assistants with external tool access

Installation

pip install toolwrap-lite

Usage

from toolwrap_lite import tool, get_registered_tools

@tool
def add(x: int, y: int) -> int:
    """Add two numbers."""
    return x + y

print(get_registered_tools())

Export to JSON

from toolwrap_lite import export_tools_to_json
export_tools_to_json("tools.json")

Example Tool

@tool
def summarize_tweets(username: str, count: int = 5, language: str = "en") -> str:
    """Summarize tweets from a username."""
    return "Summary..."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolwrap_lite-0.3.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolwrap_lite-0.3.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file toolwrap_lite-0.3.0.tar.gz.

File metadata

  • Download URL: toolwrap_lite-0.3.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for toolwrap_lite-0.3.0.tar.gz
Algorithm Hash digest
SHA256 62a6263d425d18fb7cbd8dd3d7ade0b74bcb79eb68aeea979d99281a5e277e42
MD5 a701593f9f59546099938356e68c4570
BLAKE2b-256 379a4f84015a817cac68269921197f6e4f9e370b9867c886d593515edc1a798a

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolwrap_lite-0.3.0.tar.gz:

Publisher: publish.yml on gagannaidu/toolwrap-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file toolwrap_lite-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: toolwrap_lite-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for toolwrap_lite-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af2c2694497f452ab1f23c9f832cafdc0ea9a9bc2b2835d3b66cfe54afd4a1b1
MD5 978d5a5ccd578c84dea7b4aba148bfda
BLAKE2b-256 c07a56b07640a63da6120956ab837b2285151a7d8c9745d6e4ccdf94fb78d213

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolwrap_lite-0.3.0-py3-none-any.whl:

Publisher: publish.yml on gagannaidu/toolwrap-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page