Skip to content

seerkong/spl-python

Repository files navigation

SPL Python

Python implementation of SPL (Structured Process Language) - a grid-based data processing language with a spreadsheet-like Web IDE.

Project Structure

spl-python/
├── frontend/          # Vue + Univerjs spreadsheet UI (copied from spl-bun)
├── backend/           # Python FastAPI backend (multi-module)
│   ├── packages/
│   │   ├── spl_core/          # DataSet class and core operations
│   │   ├── spl_expression/    # Expression parser/evaluator
│   │   ├── spl_flow/          # Flow executor
│   │   ├── spl_web_server/    # FastAPI web server
│   │   └── spl_web_shared/    # Shared types and API routes
│   ├── pyproject.toml
│   └── README.md
└── doc/               # Project documentation (AI reference docs)

Quick Start

Prerequisites

  • Python >= 3.10
  • uv (Python dependency manager)
  • Bun (JS runtime + package manager)

Optional (for E2E):

  • Playwright browser binaries

Backend

# Install Python dependencies (workspace)
cd backend
uv sync --all-packages --dev

# Run backend server (FastAPI/Uvicorn)
cd ..
bun run dev:backend

Backend defaults:

  • URL: http://localhost:4176
  • Health: GET /api/health
  • Execute: POST /api/execute

Demo database initialization (on startup):

  • data/demo-init.sql (base schema/data)
  • data/demo-extension.sql (extension tables; idempotent)
  • runtime DB: data/demo.db (usually ignored by .gitignore)

Frontend

# Install JS dependencies
bun install

# Run frontend dev server
bun run dev:frontend

Frontend URL:

  • http://localhost:4174

E2E (Playwright)

Playwright config (playwright.config.ts) will start both backend and frontend automatically.

# Install browsers (once)
bunx playwright install chromium

# Run e2e
bun run test:e2e

Environment Variables

Backend server:

  • PORT (default: 4176)
  • SPL_WORKSPACE_ROOT (default: repo root)

Demo DB init:

  • SPL_DEMO_DB_PATH (default: data/demo.db)
  • SPL_DEMO_INIT_SQL_PATH (default: data/demo-init.sql)
  • SPL_DEMO_EXTENSION_SQL_PATH (default: data/demo-extension.sql)
  • SPL_DEMO_DB_RESET=1/true (force recreate db)

Optional server auto-shutdown:

  • SPL_SERVER_SHUTDOWN_AFTER_SECONDS (if set, server exits after N seconds)

Documentation

See doc/ for AI-generated reference documentation covering:

  • Architecture overview
  • Expression engine (60+ functions)
  • Flow control statements
  • Data sources
  • DataSet API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors