ii-slide
AI-powered PowerPoint synchronization backend that enables bidirectional editing between AI and user interfaces.
Project Structure
ii-slide/
├── src/ii_slide/ # Main package source code
│ ├── __init__.py # Package exports
│ ├── models.py # Data models for PowerPoint elements
│ ├── sync_manager.py # File watcher and sync logic
│ └── backend.py # FastAPI server with WebSocket support
├── examples/ # Example files and demos
│ ├── test_parser.py # Test script for parsing PowerPoint JSON
│ ├── frontend_example.html # WebSocket client demo
│ └── updated_presentation.json # Sample output
├── pyproject.toml # Modern Python packaging configuration
├── requirements.txt # Dependencies
└── README.md # This file
Installation
Development Installation
cd ii-slide
pip install -e .
Production Installation
pip install .
Quick Start
1. Start the Backend Server
cd ii-slide
python -m ii_slide.backend
The server runs on http://localhost:8000
2. Test with Example
Open examples/frontend_example.html in your browser to test the WebSocket connection.
3. Parse PowerPoint JSON
cd examples
python test_parser.py
How It Works
Two-Layer Architecture
- Full PowerPoint JSON - Complete presentation with styling and positioning
- AI Skeleton - Simplified content structure for AI editing
Data Flow
- Frontend → Backend: User edits trigger updates to both presentation and skeleton
- AI → Backend: AI modifies skeleton file, changes sync to presentation
- Real-time Sync: All clients receive updates via WebSocket
Example Skeleton Format
{
"presentationType": "traditional",
"slideCount": 1,
"slides": [
{
"id": "slide_id",
"type": "end",
"texts": [
{
"type": "text",
"id": "element_id",
"content": "Hello World",
"role": "title"
}
],
"images": [
{
"type": "image",
"id": "img_id",
"src": "https://example.com/image.png"
}
]
}
]
}
API Usage
REST Endpoints
GET /api/status- Get sync statusGET /api/presentation- Get full presentation JSONGET /api/skeleton- Get AI-friendly skeletonPOST /api/frontend-change- Submit frontend changesPOST /api/sync-from-skeleton- Force sync from skeletonPOST /api/reset-skeleton- Reset skeleton from presentation
WebSocket
Connect to ws://localhost:8000/ws for real-time updates.
Send Message (Frontend → Backend)
ws.send(JSON.stringify({
type: 'frontend_change',
element_id: 'text_element_id',
change_type: 'content_edit',
changes: { content: 'New text content' }
}));
Receive Message (Backend → Frontend)
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'skeleton_update') {
// AI has updated the skeleton
console.log('AI updated content');
}
};
File Watching
The system automatically watches skeleton.json for changes:
- AI writes to
skeleton.json - File watcher detects change
- Backend applies changes to presentation
- All clients receive updates
Supported Elements
Currently supports:
- Text: Title, body text with HTML formatting
- Image: Images with URLs and positioning
- Shape: Basic shapes with optional text content
Adding New Element Types
When you encounter unsupported elements:
- Check error logs for full element structure
- Add new element class in
src/ii_slide/models.py - Update
Slide.from_dict()to handle the new type - Implement
to_skeleton()andupdate_from_skeleton()methods
Configuration
Change Sync Behavior
Edit sync_manager.py to modify:
- Debounce timing
- Conflict resolution strategy
- File paths
Customize Skeleton Format
Modify the to_skeleton() methods in models.py to change how content is represented for AI.
Development
Running Examples
# Test JSON parsing
cd examples && python test_parser.py
# Start server and open frontend example
python -m ii_slide.backend &
open examples/frontend_example.html
Package Structure
src/ii_slide/models.py- Data models and JSON parsingsrc/ii_slide/sync_manager.py- File watching and sync logicsrc/ii_slide/backend.py- FastAPI server with WebSocketsrc/ii_slide/__init__.py- Package exports
The package follows modern Python packaging standards with pyproject.toml and the src/ layout.
Metadata
Release files for ii-slide 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ii_slide-0.1.4.tar.gz | 47.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ii_slide-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 94.3 MB
Release files / ii_slide-0.1.4.tar.gz
| Download URL | ii_slide-0.1.4.tar.gz |
|---|---|
| Size | 47.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e2a32f47a21890b86f0ab2b2d30cc444a5bab61926cc17308ef153bd984b107
|
|
BLAKE2b-256 checksum How to use checksums |
4f61df09ea65e6c4dc9ad87ecc53ded584c5d5553f9ec2ba94aba6782b06745b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.27
|
Release files / ii_slide-0.1.4-py2.py3-none-any.whl
| Download URL | ii_slide-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 47.1 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bbc50b729c3cc2edd8d22f89001597cc557dc24d409394e29df32df8da587863
|
|
BLAKE2b-256 checksum How to use checksums |
7def5838a4fd7a85e9850c0254f999dc3707792c35425a8f4924526d4e2e14f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.27
|