
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Stateless API Mapping Context for LLM Tooling - Python SDK
ApiToolBox provides a unified interface for loading and managing API service definitions, making it easy to integrate various APIs into LLM applications. This Python SDK is designed for server-side usage and provides async support for efficient API operations.
pip install pleom-apitoolbox
import asyncio
from pleom_apitoolbox import ApiToolBox, User, ServiceConfig
async def main():
# Initialize ApiToolBox
api_toolbox = ApiToolBox()
# Load services
await api_toolbox.load_services(['vercel', 'github'])
# List available services
services = api_toolbox.get_services()
print(f"Loaded services: {services}")
# List available tools
tools = await api_toolbox.list_tools(model='openai')
print(f"Available tools: {len(tools)}")
if __name__ == "__main__":
asyncio.run(main())
import asyncio
from pleom_apitoolbox import ApiToolBox, User, ServiceConfig
async def main():
# Initialize ApiToolBox and load services
api_toolbox = ApiToolBox()
await api_toolbox.load_services(['vercel'])
# Configure service authentication
service_configs = [
ServiceConfig('vercel', {
'Authorization': 'Bearer your-vercel-token'
})
]
# Create user instance
user = User(api_toolbox, service_configs)
# Find a specific tool
tool = api_toolbox.find_tool_by_id('vercelRetrieveAListOfProjects')
if tool:
print(f"Found tool: {tool['name']}")
# Call the tool
try:
result = await user.call_tool('vercelRetrieveAListOfProjects')
print(f"API Response: {result}")
except Exception as e:
print(f"Error calling tool: {e}")
if __name__ == "__main__":
asyncio.run(main())
# Get tools in different formats
tools_openai = await api_toolbox.list_tools(model='openai')
tools_claude = await api_toolbox.list_tools(model='claude')
tools_gemini = await api_toolbox.list_tools(model='gemini')
# Raw tools (unformatted)
raw_tools = await api_toolbox.list_tools(filter_tools=False)
Main class for managing API services and tools.
get_services() -> List[str]
: Get list of loaded serviceslist_tools(model='gemini', filter_tools=True) -> List[Dict]
: Get formatted toolsfind_tool_by_id(tool_id: str) -> Optional[Dict]
: Find tool by IDload_services(services: List[str], force_download=False)
: Load servicesunload_service(service_name: str)
: Unload a serviceClass for making authenticated API calls.
call_tool(tool_id: str, parameters=None) -> Dict
: Call an API toolvalidate_tool_call(tool_id: str, response) -> bool
: Validate API responseget_config() -> Dict
: Get current configurationupdate_config(config: Dict)
: Update configurationConfiguration for API services.
config = ServiceConfig('service_name', {
'Authorization': 'Bearer token',
'apiKey': 'your-api-key',
# ... other headers/config
})
git clone https://github.com/pleom/apitoolbox.git
cd apitoolbox
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=pleom_apitoolbox --cov-report=html
# Run specific test
pytest tests/test_api_toolbox.py
# Format code
black pleom_apitoolbox/
isort pleom_apitoolbox/
# Type checking
mypy pleom_apitoolbox/
# Linting
flake8 pleom_apitoolbox/
Create a test script:
# test_installation.py
import asyncio
from pleom_apitoolbox import ApiToolBox
async def test_basic_functionality():
print("Testing ApiToolBox...")
# Test basic initialization
api_toolbox = ApiToolBox()
print("✓ ApiToolBox initialized successfully")
# Test getting services (should be empty initially)
services = api_toolbox.get_services()
print(f"✓ Services: {services}")
# Test listing tools (should be empty initially)
tools = await api_toolbox.list_tools()
print(f"✓ Tools: {len(tools)} tools found")
print("✓ All tests passed!")
if __name__ == "__main__":
asyncio.run(test_basic_functionality())
Run the test:
python test_installation.py
pip install build twine
# Clean previous builds
rm -rf dist/ build/ *.egg-info/
# Build the package
python -m build
# Upload to Test PyPI first
twine upload --repository testpypi dist/*
# Test installation from Test PyPI
pip install --index-url https://test.pypi.org/simple/ pleom-apitoolbox
# Upload to production PyPI
twine upload dist/*
MIT License - see LICENSE file for details.
FAQs
Stateless API Mapping Context for LLM Tooling - Python SDK
We found that pleom-apitoolbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.