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.25.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.25.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqladmin_ng-0.25.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.25.0.tar.gz
Algorithm Hash digest
SHA256 e38a2de592ab1f39c9d6f0f20c5bb05f26163112d36e46d3823cec63184f44ef
MD5 376ee78def97d61c1b453ffa0961ff1c
BLAKE2b-256 1011cd700fe5381fbe34b23dab9522ec41ecb438cd077d8d5021650a6eeb64bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqladmin_ng-0.25.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.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f446c8d574ea4b6593a0e2764fd5bc081e7d3af8b70fcb0af038706f56eb598d
MD5 72541b3635d497eb72e6399607964289
BLAKE2b-256 4c3696401bf723d85ef5998bd5c866e46eab3e3518e0fbe2f63c4e214141a479

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