Streamlined toolkit for interacting with DreamFactory API Management Platform through Arcade AI.
This toolkit provides 14 optimized tools for managing DreamFactory services, databases, and file storage. The toolkit has been carefully consolidated to minimize context overhead while maintaining full functionality.
pip install arcade-dreamfactory
Or install from source:
git clone https://github.com/your-org/arcade-toolkit.git
cd arcade-toolkit
pip install -e .
Configure these secrets in your Arcade platform:
DREAM_FACTORY_BASE_URL
- Your DreamFactory instance URL (e.g.,https://demo.dreamfactory.com
)DREAM_FACTORY_API_KEY
- Your DreamFactory API key with appropriate permissions
List all configured services in DreamFactory (databases, file storage, etc.)
list_services()
list_services(service_type="mysql") # Filter by type
Get detailed information about a specific service.
get_service_details(service_id="mysql_prod")
List all tables in a database service.
list_database_tables("mysql_prod")
list_database_tables("postgres_db", include_schema=True)
Get detailed schema information for a table.
get_table_schema("mysql_prod", "users")
Query data with filtering, sorting, pagination, and ID-based retrieval.
# Basic query
query_database_table("mysql_prod", "users", limit=10)
# With filter
query_database_table("mysql_prod", "users", filter="age > 25")
# By IDs
query_database_table("mysql_prod", "users", ids="1,2,3")
# Custom ID field
query_database_table("mysql_prod", "products", ids="ABC,DEF", id_field="sku")
Insert one or more records into a table.
insert_records("mysql_prod", "users", '[{"name": "John", "email": "[email protected]"}]')
Update records in a table.
# Update by filter
update_records("mysql_prod", "users", '{"active": false}', filter="last_login < '2023-01-01'")
# Update by IDs
update_records("mysql_prod", "users", '{"status": "verified"}', ids="1,2,3")
Delete records from a table.
# Delete by filter
delete_records("mysql_prod", "logs", filter="created_at < '2023-01-01'")
# Delete by IDs
delete_records("mysql_prod", "users", ids="123,456")
List all configured file storage services (local, S3, Azure, etc.)
list_storage_services()
List and search files in a storage service.
# List files
list_files("local", "/")
# Search files
list_files("local", "/", search_term="report", recursive=True)
# With pattern
list_files("local", "/logs", pattern="*.log")
Read file contents or metadata.
# Read text file
read_file("local", "config/settings.json")
# Read binary file
read_file("s3_bucket", "images/logo.png", as_base64=True)
# Get metadata only
read_file("local", "large_file.zip", metadata_only=True)
Write files or create folders.
# Write text file
write_file("local", "config/new.json", '{"key": "value"}')
# Write binary file
write_file("s3_bucket", "image.png", base64_content, is_base64=True)
# Create folder
write_file("local", "new_folder/", is_folder=True)
Delete files or folders.
# Delete file
delete_file("local", "temp/old_file.txt")
# Delete folder
delete_file("local", "old_data/", force=True)
Copy or move files and folders.
# Copy file
manage_file("local", "report.pdf", "backups/report.pdf")
# Move file
manage_file("local", "temp.txt", "permanent.txt", operation="move")
# Copy with overwrite
manage_file("local", "current.json", "previous.json", overwrite=True)
from arcade_dreamfactory.tools import (
list_services,
list_database_tables,
query_database_table
)
# Discover available services
services = list_services()
# List tables in a database
tables = list_database_tables("mysql_production")
# Query data
users = query_database_table(
"mysql_production",
"users",
filter="created_at >= '2024-01-01'",
limit=100
)
The toolkit is organized into three modules:
system_tools.py
- Service discovery and managementdatabase_tools.py
- Database operations and queriesfile_tools.py
- File storage operations
All tools include:
- Comprehensive error handling
- Automatic retry logic for transient failures
- Type hints and validation
- Detailed logging
- Python 3.10+
- DreamFactory instance with API access
- Valid API key with appropriate permissions
For issues or questions, please contact your DreamFactory administrator or create an issue in the repository.
[Your License]