Skip to main content

React SPA admin for SQLAlchemy with FastAPI and Starlette

Project description

Build Status


spa-sqladmin: React SPA Admin for Starlette/FastAPI

spa-sqladmin is a modern React SPA rewrite of sqladmin providing a better UI/UX.

Main features include:


Installation

$ pip install spa-sqladmin

Or with uv:

$ uv add spa-sqladmin

Screenshots

spa-sqladmin-screenshot-1 spa-sqladmin-screenshot-2 spa-sqladmin-screenshot-3

Quickstart

Let's define an example SQLAlchemy model:

from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import declarative_base


Base = declarative_base()
engine = create_engine(
    "sqlite:///example.db",
    connect_args={"check_same_thread": False},
)


class User(Base):
    __tablename__ = "users"

    id = Column(Integer, primary_key=True)
    name = Column(String)


Base.metadata.create_all(engine)  # Create tables

If you want to use SQLAdmin with FastAPI:

from fastapi import FastAPI
from spa_sqladmin import Admin, ModelView


app = FastAPI()
admin = Admin(app, engine)


class UserAdmin(ModelView, model=User):
    column_list = [User.id, User.name]


admin.add_view(UserAdmin)

Or if you want to use SQLAdmin with Starlette:

from spa_sqladmin import Admin, ModelView
from starlette.applications import Starlette


app = Starlette()
admin = Admin(app, engine)


class UserAdmin(ModelView, model=User):
    column_list = [User.id, User.name]


admin.add_view(UserAdmin)

Now visiting /admin on your browser you can see the SQLAdmin interface.

Find an extensive example in the example folder.

For a full overview of Admin(...) parameters, icon formats, palette syntax, and custom admin patterns, see docs/USAGE.md.

Acknowledgements

This project would not have been possible without sqladmin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spa_sqladmin-0.2.0.tar.gz (246.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spa_sqladmin-0.2.0-py3-none-any.whl (255.0 kB view details)

Uploaded Python 3

File details

Details for the file spa_sqladmin-0.2.0.tar.gz.

File metadata

  • Download URL: spa_sqladmin-0.2.0.tar.gz
  • Upload date:
  • Size: 246.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spa_sqladmin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d647799dea368729f19d5ddbfd4f049a9b95ab2a0101e4a0f4a8a8393a68a7e2
MD5 110128950e8914441492bafc4124cdd8
BLAKE2b-256 c1d4560f05fcfdcc9b42af7fd6cc3fb7e514b4f48338575bb5b92b6ad1ec5753

See more details on using hashes here.

File details

Details for the file spa_sqladmin-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spa_sqladmin-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 255.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spa_sqladmin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db1104a1e50e35f43565448bda333464af9864dc00a6d3223d4935a18af7da19
MD5 a2618900e68e7adf4be5d04be973feca
BLAKE2b-256 91d908a5bbbe56dad679551983e45443f1c37749c56cea3f1da144fbee3f23fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page