SQLAlchemy Example Projects and Code
SQLAlchemyobject-relational mapper (ORM)

Code Examples Sorted by SQLAlchemy Package

Specific examples are shown on the following individual pages, organized by classes and functions provided by SQLAlchemy, that are typically used when building your own applications.

Example Open Source Projects

The following open source projects can serve as example code for you as you build your own applications with SQLAlchemy.

databases

databases (project homepage and PyPI page provides asyncio support with an SQLALchemy Core interface for common relational databases such as MySQL, PostgreSQL and SQLite. This is handy for integrating with asynchronous I/O web frameworks like Sanic. The project is open sourced under the BSD 3-Clause "New" or "Revised" License.

CTFd

CTFd (homepage) is a capture the flag (CTF) hacking web app built with SQLAlchemy and Flask. The application can be used as-is to run CTF events, or the code can be modified for custom rules on hacking scenarios. CTFd is open sourced under the
Apache License 2.0.

indico

indico (project website, documentation and sandbox demo) is a Flask-based web app for event management that is powered by SQLAlchemy on the backend. The code for this project is open sourced under the MIT license.

sandman2

sandman2 (project documentation and PyPI package information) is a code library for automatically generating RESTful APIs from existing database schemas. This approach is handy for solving straightforward situations where you want to put an abstraction layer between one or more applications and your relational database to prevent or reduce direct database access.

The sandman2 project is provided under the Apache License 2.0.