tai examples
Complete, runnable, stdlib-only examples in tai-spirit: single file, zero deps, Python 3.6+.
Elke example is direct draaibaar, geen pip, geen build. Kopieer het bestand, run het.
| # | Example | Run | Wat laat het zien |
|---|---|---|---|
| 01 | WebDAV server | python3 webdav-server.py --root ./share --port 8080 |
Complete WebDAV Class 1: PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, Range, ETag, Basic-auth, jail. Werkt met cadaver, Nautilus, rclone, curl. |
| 02 | Todo REST API | python3 todo-rest-api.py --port 8081 |
REST JSON API + SQLite + embedded UI. Filtering, paging, validation, concurrency-safe. |
| 03 | SSE chat | python3 sse-chat.py --port 8082 |
Multi-room chat met Server-Sent Events. Geen JS-deps, history, heartbeat, graceful reconnect. |
| 04 | Reverse proxy | python3 reverse-proxy.py --backends http://127.0.0.1:9001,http://127.0.0.1:9002 |
Round-robin proxy met healthchecks, retries, hop-header hygiene, X-Forwarded-*. |
| 05 | FTS search | python3 fts-search.py index ./docs && python3 fts-search.py serve --port 8083 |
SQLite FTS5 full-text search over een directory. BM25 ranking, snippet highlights, HTTP UI + CLI. |
Conventies (zoals tai.py):
- Alleen stdlib imports.
- Werkt op Python 3.6+.
--helpop elk bestand.- Harde caps: request size, upload size, history lengte.
- Veilige paden: geen traversal buiten root.