Skip to main content

SQLAlchemy admin for FastAPI and Starlette. New generation & maintained version of SQLAdmin.

Project description

Build Status Publish Status Coverage Package version Supported Python versions [![Netlify Status](https://api.netlify.com/api/v1/badges/db255e51-81e5-4ae4-9123-701c8fd3e846/deploy-status)](https://app.netlify.com/projects/sqladmin-ng/deploys)


SQLAlchemy Admin for Starlette/FastAPI

SQLAdmin-NG is a flexible, maintained admin interface for SQLAlchemy models, built for FastAPI and Starlette. This project is a maintained fork of SQLAdmin from version v0.23.0, originally created by Amin Alaee. Development continues here due to inactivity in the original repository.

⚠️ This package is a drop-in replacement for sqladmin. Just replace the installation package — no code changes required.

Why this fork?

The original project has been inactive for a while. This fork aims to:

  • Continue maintenance and bug fixes
  • Support newer versions of dependencies
  • Add new features over time

Main features


Documentation: https://mmzeynalli.github.io/sqladmin-ng

Source Code: https://github.com/mmzeynalli/sqladmin-ng

Online Demo: Demo


Installation

Install using pip:

$ pip install sqladmin-ng

This will install the full version of sqladmin-ng with optional dependencies:

$ pip install "sqladmin-ng[full]"

Migration from sqladmin

pip uninstall sqladmin
pip install sqladmin-ng

That's it. No need to change existing code.


Screenshots

sqladmin-ng-1 sqladmin-ng-2

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-NG with FastAPI:

from fastapi import FastAPI
from 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-NG with Starlette:

from 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-NG interface.

Related projects and inspirations

  • SQLAdmin The original project that this fork is based on.
  • Flask-Admin Admin interface for Flask supporting different database backends and ORMs. This project has inspired SQLAdmin-NG extensively and most of the features and configurations are implemented the same.
  • FastAPI-Admin Admin interface for FastAPI which works with TortoiseORM.
  • Dashboard Admin interface for ASGI frameworks which works with the orm package.

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

sqladmin_ng-0.24.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

sqladmin_ng-0.24.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file sqladmin_ng-0.24.0.tar.gz.

File metadata

  • Download URL: sqladmin_ng-0.24.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • 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 sqladmin_ng-0.24.0.tar.gz
Algorithm Hash digest
SHA256 ba0ea8c3791fc59d5cce06f044b4d0973dcb8020c72af1d3630eeaa28f5f8ad5
MD5 c4c6c9a511fb50c1e4af95a8801b9fc3
BLAKE2b-256 30d3191b692bc234429b2879719bdfe047034dac74ea7a0852c47eabf42f9be4

See more details on using hashes here.

File details

Details for the file sqladmin_ng-0.24.0-py3-none-any.whl.

File metadata

  • Download URL: sqladmin_ng-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • 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 sqladmin_ng-0.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2980eb9677d70cfc9dab88750bc07e2a38d91dede804a5bb3dd16d7860da6bd
MD5 71b041241f31e76c290a48196296e922
BLAKE2b-256 b7e155fde1b71f887dd0b62d5e48259e5a5705ea060c3e71ecc658712b718dd4

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