Overview
WaveAssist supports storing and retrieving JSON-compatible Python objects (dictionaries and lists).
Working with JSON Data
import waveassist
# Store a dictionary
config = {
"app_name": "MyApp",
"version": "1.0.0",
"settings": {
"debug": True,
"max_retries": 3
}
}
waveassist.store_data("app_config", config)
# Store a list
items = [
{"id": 1, "name": "Item 1"},
{"id": 2, "name": "Item 2"}
]
waveassist.store_data("item_list", items)
Supported Data Types
- Dictionaries
- Lists
- Strings
- Numbers (int, float)
- Boolean
- Null
- Nested structures
JSON Limitations
- Maximum size: 5MB
- Must be JSON-serializable
- Keys must be strings
- No support for custom objects
Best Practices
- Validate JSON structure before storing
- Use consistent key naming
- Handle nested data carefully
- Consider data organization
Example Use Cases
# Configuration settings
settings = {
"database": {
"host": "localhost",
"port": 5432,
"credentials": {
"username": "user",
"password": "pass"
}
},
"api": {
"endpoint": "https://api.example.com",
"timeout": 30
}
}
waveassist.store_data("settings", settings)
# Nested data structures
project = {
"name": "Project X",
"team": ["Alice", "Bob", "Charlie"],
"milestones": [
{
"name": "Phase 1",
"due_date": "2025-06-30",
"completed": False
}
]
}
waveassist.store_data("project_info", project)