Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Rafa

Build engineering web apps in plain Python. Declare the inputs, write the calculation, get a web app with forms, live views, revisions and a database. A library you run on your own infrastructure.

The entity screen: loads of a foundation pad on the left, its soil pressure chart on the canvas, metrics in the results panel on the right
  • Python SDK (rafa): parametrizations, controllers, views, actions, entities, revisions, migrations. Stored in SQLite or PostgreSQL through SQLModel.
  • Server: a FastAPI app that serves the HTTP API and the web UI from one process.
  • Web app: a Vue 3 app rendered from layout JSON the server generates from your Python classes: entity browser, autosave with undo and revision history, RUN for slow calculations, keyboard shortcuts and a command palette, dark and light theme.

Quickstart

Requires Python 3.12+. The package contains the web app, so no Node.js is needed. Rafa is in beta:

pip install rafa-engineering                  # or: uv add rafa-engineering
rafa serve --demo                             # http://127.0.0.1:7232
rafa new bridge-checks && cd bridge-checks    # a new app of your own
rafa dev                                      # it, restarted and checked on every change

The Quickstart walks from the install to your own app in the browser, and shows how to run the example apps from a checkout.

Features

  • Declarative inputs: 25 field types (numbers, options, dates, tables, dynamic arrays, files, entity references) in tabs and sections, with Lookup constraints and conditional visibility.
  • Views: @view returns HTML, data, a table, an image, a PDF, a Plotly chart or 3D geometry; @metric shows a number in the results panel. Fast views refresh on every change, slow views run on RUN.
  • Actions: @action methods become buttons that return a message, a file download, new input values or candidate designs to choose from.
  • Entities: typed, hierarchical records with navigation, cascade rules, soft delete and recovery.
  • Revisions: every save is a revision; list, read and restore.
  • Schema migrations: evolve a parametrization without losing stored data.
  • Server: one rafa serve command, sign-in (API key, proxy, OpenID Connect or your own hook), SQLite or PostgreSQL, backups, retention, calculation limits, a Docker image.
  • Design system: one token file drives the web app's dark and light theme.

Overview: docs/features.md.

Documentation

You want to Read
Try it in 5 minutes Quickstart
Learn the SDK step by step Tutorial
Look up a term Concepts
Learn from working apps Example apps
Solve a specific task How-to guides
Use the web app User guide
Run or deploy the server Run the server, Deploy, Settings
Call the HTTP API HTTP API
Look up a class Reference
Know why it works this way Decisions, Architecture

Build the documentation site locally:

uv sync --group docs
uv run properdocs serve -f properdocs.yml   # http://127.0.0.1:8000

Project layout

src/rafa/          Python SDK (package `rafa`)
  core/            Application, Controller, Parametrization, Entity, Params, services
  fields/          input fields and layout (Tab, Section, ...)
  views/ actions/  @view, @metric, @action and their result types
  layout/          layout tree sent to the web app as JSON
  persistence/     SQLModel models and repositories
  server/          FastAPI app, settings, middleware
frontend/          Vue 3 + Vite + Tailwind web app
design_system/     design tokens (colors_and_type.css) and UI kit
examples/          example apps: engineering_app (Beam, Project, Showcase), foundation_app,
                   beam_formulas_app
docs/              documentation site (properdocs)
tests/             pytest suite

Development

uv sync --all-groups                 # Python dependencies (dev + docs)
uv run pytest                        # tests
uv run ruff check . && uv run ruff format --check .
uv run ty check .                    # type check

# Frontend development: the API with reload (answering the dev server's origin), and Vite
RAFA_CORS_ORIGINS=http://localhost:5173 \
  uv run uvicorn rafa.server.main:app --reload --port 8000 --no-proxy-headers
cd frontend
npm ci
npm run dev                          # http://localhost:5173, uses the API on :8000
npm run build                        # type check + production build to dist/
npm test                             # Storybook story tests (needs Playwright Chromium)

CI runs all of the above plus a strict docs build, and builds the wheel, installs it outside the checkout and serves an app from it. See Contributing.

License

Rafa is licensed under the Business Source License 1.1. Production use is free for:

  • individuals;
  • small enterprises: fewer than 50 staff and at most EUR 10 million turnover or balance sheet total (the EU definition, Recommendation 2003/361/EC, group companies included);
  • teaching, study and research at educational institutions and non-profit research organizations.

Development, testing and evaluation are free for everyone. Production use on behalf of, for, or by people of a larger organization needs a commercial license: contact Enrique García at enriquegarcia@live.nl. Four years after its release, each version becomes available under the Apache License 2.0.

© 2026 Enrique García

Metadata

Release files for rafa-engineering 0.0.1b5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rafa-engineering 0.0.1b5
File Size Uploaded
rafa_engineering-0.0.1b5.tar.gz 4.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for rafa-engineering 0.0.1b5
File Interpreter ABI Platform
rafa_engineering-0.0.1b5-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 MB

Release files / rafa_engineering-0.0.1b5.tar.gz

Download URL rafa_engineering-0.0.1b5.tar.gz
Size 4.6 MB
Tags Source
SHA-256 checksum
How to use checksums
4967739595270d60f85572ef14835db15ce58ab2f1aa554291d30a6785ce00c0
BLAKE2b-256 checksum
How to use checksums
0275b056f24ad324fa2d656ffe42cfef9fe31879f38bcadf1a40b8fac8953724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / rafa_engineering-0.0.1b5-py3-none-any.whl

Download URL rafa_engineering-0.0.1b5-py3-none-any.whl
Size 4.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1da73e3bd93d9cbd91f9c9b93d76209df4b26ea987d4fa671ffef89239a7bd22
BLAKE2b-256 checksum
How to use checksums
62e580b1dc7869fc0c940b3b7f9417b14596bc501369ce70186dac6965f9fb15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page