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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62a6263d425d18fb7cbd8dd3d7ade0b74bcb79eb68aeea979d99281a5e277e42
|
|
| MD5 |
a701593f9f59546099938356e68c4570
|
|
| BLAKE2b-256 |
379a4f84015a817cac68269921197f6e4f9e370b9867c886d593515edc1a798a
|
Provenance
The following attestation bundles were made for toolwrap_lite-0.3.0.tar.gz:
Publisher:
publish.yml on gagannaidu/toolwrap-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolwrap_lite-0.3.0.tar.gz -
Subject digest:
62a6263d425d18fb7cbd8dd3d7ade0b74bcb79eb68aeea979d99281a5e277e42 - Sigstore transparency entry: 241957024
- Sigstore integration time:
-
Permalink:
gagannaidu/toolwrap-lite@db72cf62f93ca31281eee099fd7975144a39ba0d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/gagannaidu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db72cf62f93ca31281eee099fd7975144a39ba0d -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af2c2694497f452ab1f23c9f832cafdc0ea9a9bc2b2835d3b66cfe54afd4a1b1
|
|
| MD5 |
978d5a5ccd578c84dea7b4aba148bfda
|
|
| BLAKE2b-256 |
c07a56b07640a63da6120956ab837b2285151a7d8c9745d6e4ccdf94fb78d213
|
Provenance
The following attestation bundles were made for toolwrap_lite-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on gagannaidu/toolwrap-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolwrap_lite-0.3.0-py3-none-any.whl -
Subject digest:
af2c2694497f452ab1f23c9f832cafdc0ea9a9bc2b2835d3b66cfe54afd4a1b1 - Sigstore transparency entry: 241957037
- Sigstore integration time:
-
Permalink:
gagannaidu/toolwrap-lite@db72cf62f93ca31281eee099fd7975144a39ba0d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/gagannaidu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db72cf62f93ca31281eee099fd7975144a39ba0d -
Trigger Event:
release
-
Statement type: