sqladmin


Namesqladmin JSON
Version 0.20.0 PyPI version JSON
download
home_pageNone
SummarySQLAlchemy admin for FastAPI and Starlette
upload_time2024-10-17 09:08:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords admin fastapi sqlalchemy starlette
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<a href="https://github.com/aminalaee/sqladmin">
    <img width="400px" src="https://raw.githubusercontent.com/aminalaee/sqladmin/main/docs/assets/images/banner.png" alt"SQLAdmin">
</a>
</p>

<p align="center">
<a href="https://github.com/aminalaee/sqladmin/actions">
    <img src="https://github.com/aminalaee/sqladmin/workflows/Test%20Suite/badge.svg" alt="Build Status">
</a>
<a href="https://github.com/aminalaee/sqladmin/actions">
    <img src="https://github.com/aminalaee/sqladmin/workflows/Publish/badge.svg" alt="Publish Status">
</a>
<a href="https://codecov.io/gh/aminalaee/sqladmin">
    <img src="https://codecov.io/gh/aminalaee/sqladmin/branch/main/graph/badge.svg" alt="Coverage">
</a>
<a href="https://pypi.org/project/sqladmin/">
    <img src="https://badge.fury.io/py/sqladmin.svg" alt="Package version">
</a>
<a href="https://pypi.org/project/sqladmin" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/sqladmin.svg?color=%2334D058" alt="Supported Python versions">
</a>
</p>

---

# SQLAlchemy Admin for Starlette/FastAPI

SQLAdmin is a flexible Admin interface for SQLAlchemy models.

Main features include:

* [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy) sync/async engines
* [Starlette](https://github.com/encode/starlette) integration
* [FastAPI](https://github.com/tiangolo/fastapi) integration
* [WTForms](https://github.com/wtforms/wtforms) form building
* [SQLModel](https://github.com/tiangolo/sqlmodel) support
* UI using [Tabler](https://github.com/tabler/tabler)

---

**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)

**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)

**Online Demo**: [Demo](https://sqladmin-demo.aminalaee.dev/admin/)

---

## Installation

Install using `pip`:

```shell
$ pip install sqladmin
```

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

```shell
$ pip install "sqladmin[full]"
```

---

## Screenshots

<img width="1492" alt="sqladmin-1" src="https://user-images.githubusercontent.com/19784933/208232730-0114a155-2740-4e89-9d73-64a4e51a5cf5.png">
<img width="1492" alt="sqladmin-2" src="https://user-images.githubusercontent.com/19784933/208232731-6d783dde-b93e-41c0-911b-3d1c3c73f1d5.png">

## Quickstart

Let's define an example SQLAlchemy model:

```python
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`:

```python
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` with `Starlette`:

```python
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` interface.

## Related projects and inspirations

* [Flask-Admin](https://github.com/flask-admin/flask-admin) Admin interface for Flask supporting different database backends and ORMs. This project has inspired SQLAdmin extensively and most of the features and configurations are implemented the same.
* [FastAPI-Admin](https://github.com/fastapi-admin/fastapi-admin) Admin interface for FastAPI which works with `TortoiseORM`.
* [Dashboard](https://github.com/encode/dashboard) Admin interface for ASGI frameworks which works with the `orm` package.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sqladmin",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "admin, fastapi, sqlalchemy, starlette",
    "author": null,
    "author_email": "Amin Alaee <me@aminalaee.dev>",
    "download_url": "https://files.pythonhosted.org/packages/55/63/89820921f4179ea05e19489c6c268017fd0bfc968af8da864f74f09e7f3d/sqladmin-0.20.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n<a href=\"https://github.com/aminalaee/sqladmin\">\n    <img width=\"400px\" src=\"https://raw.githubusercontent.com/aminalaee/sqladmin/main/docs/assets/images/banner.png\" alt\"SQLAdmin\">\n</a>\n</p>\n\n<p align=\"center\">\n<a href=\"https://github.com/aminalaee/sqladmin/actions\">\n    <img src=\"https://github.com/aminalaee/sqladmin/workflows/Test%20Suite/badge.svg\" alt=\"Build Status\">\n</a>\n<a href=\"https://github.com/aminalaee/sqladmin/actions\">\n    <img src=\"https://github.com/aminalaee/sqladmin/workflows/Publish/badge.svg\" alt=\"Publish Status\">\n</a>\n<a href=\"https://codecov.io/gh/aminalaee/sqladmin\">\n    <img src=\"https://codecov.io/gh/aminalaee/sqladmin/branch/main/graph/badge.svg\" alt=\"Coverage\">\n</a>\n<a href=\"https://pypi.org/project/sqladmin/\">\n    <img src=\"https://badge.fury.io/py/sqladmin.svg\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.org/project/sqladmin\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/pyversions/sqladmin.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</a>\n</p>\n\n---\n\n# SQLAlchemy Admin for Starlette/FastAPI\n\nSQLAdmin is a flexible Admin interface for SQLAlchemy models.\n\nMain features include:\n\n* [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy) sync/async engines\n* [Starlette](https://github.com/encode/starlette) integration\n* [FastAPI](https://github.com/tiangolo/fastapi) integration\n* [WTForms](https://github.com/wtforms/wtforms) form building\n* [SQLModel](https://github.com/tiangolo/sqlmodel) support\n* UI using [Tabler](https://github.com/tabler/tabler)\n\n---\n\n**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)\n\n**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)\n\n**Online Demo**: [Demo](https://sqladmin-demo.aminalaee.dev/admin/)\n\n---\n\n## Installation\n\nInstall using `pip`:\n\n```shell\n$ pip install sqladmin\n```\n\nThis will install the full version of sqladmin with optional dependencies:\n\n```shell\n$ pip install \"sqladmin[full]\"\n```\n\n---\n\n## Screenshots\n\n<img width=\"1492\" alt=\"sqladmin-1\" src=\"https://user-images.githubusercontent.com/19784933/208232730-0114a155-2740-4e89-9d73-64a4e51a5cf5.png\">\n<img width=\"1492\" alt=\"sqladmin-2\" src=\"https://user-images.githubusercontent.com/19784933/208232731-6d783dde-b93e-41c0-911b-3d1c3c73f1d5.png\">\n\n## Quickstart\n\nLet's define an example SQLAlchemy model:\n\n```python\nfrom sqlalchemy import Column, Integer, String, create_engine\nfrom sqlalchemy.orm import declarative_base\n\n\nBase = declarative_base()\nengine = create_engine(\n    \"sqlite:///example.db\",\n    connect_args={\"check_same_thread\": False},\n)\n\n\nclass User(Base):\n    __tablename__ = \"users\"\n\n    id = Column(Integer, primary_key=True)\n    name = Column(String)\n\n\nBase.metadata.create_all(engine)  # Create tables\n```\n\nIf you want to use `SQLAdmin` with `FastAPI`:\n\n```python\nfrom fastapi import FastAPI\nfrom sqladmin import Admin, ModelView\n\n\napp = FastAPI()\nadmin = Admin(app, engine)\n\n\nclass UserAdmin(ModelView, model=User):\n    column_list = [User.id, User.name]\n\n\nadmin.add_view(UserAdmin)\n```\n\nOr if you want to use `SQLAdmin` with `Starlette`:\n\n```python\nfrom sqladmin import Admin, ModelView\nfrom starlette.applications import Starlette\n\n\napp = Starlette()\nadmin = Admin(app, engine)\n\n\nclass UserAdmin(ModelView, model=User):\n    column_list = [User.id, User.name]\n\n\nadmin.add_view(UserAdmin)\n```\n\nNow visiting `/admin` on your browser you can see the `SQLAdmin` interface.\n\n## Related projects and inspirations\n\n* [Flask-Admin](https://github.com/flask-admin/flask-admin) Admin interface for Flask supporting different database backends and ORMs. This project has inspired SQLAdmin extensively and most of the features and configurations are implemented the same.\n* [FastAPI-Admin](https://github.com/fastapi-admin/fastapi-admin) Admin interface for FastAPI which works with `TortoiseORM`.\n* [Dashboard](https://github.com/encode/dashboard) Admin interface for ASGI frameworks which works with the `orm` package.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "SQLAlchemy admin for FastAPI and Starlette",
    "version": "0.20.0",
    "project_urls": {
        "Documentation": "https://aminalaee.dev/sqladmin",
        "Issues": "https://github.com/aminalaee/sqladmin/issues",
        "Source": "https://github.com/aminalaee/sqladmin"
    },
    "split_keywords": [
        "admin",
        " fastapi",
        " sqlalchemy",
        " starlette"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "50c9988598af25dd9bd7d6ed6df3edf3c2769efc3a184c6e1ad8bb5d769b32ae",
                "md5": "810fd69993c340532ecd34e29dd0f624",
                "sha256": "08086672e532171afd931987dfbe7075ea001bd9181f091e65ffa4c16dabc91b"
            },
            "downloads": -1,
            "filename": "sqladmin-0.20.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "810fd69993c340532ecd34e29dd0f624",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1441082,
            "upload_time": "2024-10-17T09:08:38",
            "upload_time_iso_8601": "2024-10-17T09:08:38.580005Z",
            "url": "https://files.pythonhosted.org/packages/50/c9/988598af25dd9bd7d6ed6df3edf3c2769efc3a184c6e1ad8bb5d769b32ae/sqladmin-0.20.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "556389820921f4179ea05e19489c6c268017fd0bfc968af8da864f74f09e7f3d",
                "md5": "6ac1424bc262a72b4bf10df3c0311550",
                "sha256": "772fe0a14e9256090ab223111fbeb0a495bc611ba8d46b925e1508a0df15908d"
            },
            "downloads": -1,
            "filename": "sqladmin-0.20.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6ac1424bc262a72b4bf10df3c0311550",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1426229,
            "upload_time": "2024-10-17T09:08:40",
            "upload_time_iso_8601": "2024-10-17T09:08:40.780437Z",
            "url": "https://files.pythonhosted.org/packages/55/63/89820921f4179ea05e19489c6c268017fd0bfc968af8da864f74f09e7f3d/sqladmin-0.20.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 09:08:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aminalaee",
    "github_project": "sqladmin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sqladmin"
}
        
Elapsed time: 0.70691s