Skip to main content

sqlalchemy-studio

FastAPI studio for inspecting and querying SQLAlchemy databases.

Installation

Install from PyPI:

pip install sqlalchemy-studio

Or install the latest version from GitHub:

pip install --upgrade git+https://github.com/coderxuz/sqlalchemy-studio.git@main#subdirectory=sqlalchemy-studio-backend

Usage

Create a normal SQLAlchemy engine and declarative base, then pass them to Studio.

from sqlalchemy import Integer, String, create_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column

from sqlalchemy_studio import Studio


class Base(DeclarativeBase):
    pass


class User(Base):
    __tablename__ = "users"

    id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
    username: Mapped[str] = mapped_column(String(50), nullable=False)
    email: Mapped[str] = mapped_column(String(120), nullable=False)


engine = create_engine("sqlite:///app.db")


def seed_data() -> None:
    Base.metadata.create_all(engine)

    with Session(engine) as session:
        if session.query(User).count() == 0:
            session.add_all(
                [
                    User(username="john", email="john@example.com"),
                    User(username="alice", email="alice@example.com"),
                ]
            )
            session.commit()


if __name__ == "__main__":
    seed_data()
    Studio(engine=engine, base=Base, path="/studio").run(port=7000)

Run the script:

python app.py

Open http://localhost:7000 in your browser.

Example dashboard

Metadata

Release files for sqlalchemy-studio 0.2.0

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

Source distribution (sdist)

Source distribution for sqlalchemy-studio 0.2.0
File Size Uploaded Provenance Actions
sqlalchemy_studio-0.2.0.tar.gz 123.0 kB Without provenance Details for sqlalchemy_studio-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-studio 0.2.0
File Interpreter ABI Platform Actions
sqlalchemy_studio-0.2.0-py3-none-any.whl Python 3 none any Details for sqlalchemy_studio-0.2.0-py3-none-any.whl

Total release size: 247.1 kB

Release files / sqlalchemy_studio-0.2.0.tar.gz

Download URL sqlalchemy_studio-0.2.0.tar.gz
Size 123.0 kB
Tags Source
SHA-256 checksum
How to use checksums
061e220316a7230477d557d489e7e7d3dff1916ec367330a522600a25c6eb66f
BLAKE2b-256 checksum
How to use checksums
8f4a199c27de5e0acf8a0bc94c96f091fb0a5d2b35b85b8499a9f4c1768acb3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / sqlalchemy_studio-0.2.0-py3-none-any.whl

Download URL sqlalchemy_studio-0.2.0-py3-none-any.whl
Size 124.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8439e399a2c7f13752217ad1df0e16b6c913fd206767412bcabcd85be28455dc
BLAKE2b-256 checksum
How to use checksums
5954f2fb3a5750c2f718fd864c5b23cc1a544b8b33c8b4848d66a4b483d9079d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Security for sqlalchemy-studio 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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