Python tools for analyzing Airtable bases with both CLI and web interfaces.
- Dependency Mapping: Visualize field relationships and dependencies
- Formula Analysis: Compress, evaluate, and graph formulas
- Complexity Scoring: Identify complex fields and technical debt
- Schema Generation: Export to PostgreSQL and TypeScript types
- Unused Fields Detection: Find fields with no dependents
This repository supports three usage scenarios:
If you only need the command-line tools:
# Install Python dependencies (requires Python ≥3.12)
uv sync
# Run CLI commands
uv run python main.py --helpIf you only need to build/deploy the web interface:
# Install Node dependencies (requires Node.js ≥20)
npm install
# Build CSS and TypeScript
npm run build
# Generate PyScript config
uv sync
uv run python scripts/generate_pyscript_config.pyFor development on both CLI and web:
### Python Development
```bash
# Run tests with coverage
uv run pytest --cov=web --cov-report=html
# Install dev dependencies
uv sync --group dev
# Generate PyScript config (auto-discovers .py files)
uv run python scripts/generate_pyscript_config.py# Watch CSS and TypeScript for changes (runs both in parallel)
npm run watch
# Or separately:
npm run watch:css # Tailwind CSS
npm run watch:ts # TypeScript compilation
# Full dev mode (CSS + TS + web server)
npm run devThe web application requires building both CSS and TypeScript:
# Build everything (required before deploying)
npm run build
# Or separately:
npm run build:css # Compile Tailwind CSS to web/output.css
npm run build:ts # Compile TypeScript to web/modules/*.js
# Or use watch mode for active development
npm run dev # Runs watch:css, watch:ts, and web serverRequirements: Python ≥3.12 (CLI/web), Node.js ≥20 (web only)
# Full setup
uv sync && npm install && npm run build
# Run web application
uv run python main.py run-web
# Or use CLI commands
uv run python main.py --help# Generate dependency diagram
uv run python main.py dependency-map <base-id> <field-id>
# Compress formulas
uv run python main.py compress-formula <base-id> <field-id>
# Generate PostgreSQL schema
uv run python main.py generate-schema <base-id>
# Evaluate formula with test data
uv run python main.py evaluate-formula <base-id> <field-id># Run tests with coverage
uv run pytest --cov=web --cov-report=html
# Run performance benchmarks
uv run pytest tests/test_performance_benchmarks.py -v -s
# Run benchmarks with external schema
BENCHMARK_SCHEMA=/path/to/schema.json uv run pytest tests/test_performance_benchmarks.py -v
# Watch CSS and TypeScript for changes
npm run watch
# Generate PyScript config
uv run python scripts/generate_pyscript_config.pyThe project includes performance benchmarks to track code generation speed:
# Run all benchmarks (uses default demo schema)
uv run pytest tests/test_performance_benchmarks.py -v -s
# Use a custom schema for benchmarking
BENCHMARK_SCHEMA=/path/to/large-schema.json uv run pytest tests/test_performance_benchmarks.py -v
# Or place schemas in tests/schemas/ directory (gitignored)
# Files like tests/schemas/benchmark.json are automatically detectedExternal Schemas: To test with large, real-world schemas without committing them:
- Place schema JSON files in
tests/schemas/(directory is gitignored) - Or set environment variable:
SCHEMA_PATH=/path/to/schema.json - See tests/schemas/README.md for details
See web/TYPESCRIPT.md for TypeScript development details.
MIT License - See LICENSE file for details.