fastapi-sqlalchemy-asyncpg  by grillazz

Example integration for FastAPI with SQLAlchemy ORM and PostgreSQL

created 4 years ago
478 stars

Top 64.9% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a comprehensive example of integrating FastAPI with SQLAlchemy, asyncpg, and Pydantic v2 for building high-performance asynchronous web APIs. It targets Python developers seeking a robust, modern stack for PostgreSQL applications, offering features like user authentication, background job scheduling, and LLM integration.

How It Works

The project leverages FastAPI's asynchronous capabilities for efficient request handling, SQLAlchemy 2.0 for ORM operations, and asyncpg for high-performance PostgreSQL connectivity. It utilizes Pydantic v2 for data validation and serialization. Key features include JWT-based user authentication with Redis, APScheduler for background tasks, and integration with local LLMs via Ollama, demonstrating a full-stack approach to modern Python web development.

Quick Start & Requirements

  • Install and run using make docker-build, make docker-up, make docker-apply-db-migrations, and make docker-feed-database.
  • Requires Docker.
  • Official documentation: https://docs.astral.sh/uv/

Highlighted Details

  • Demonstrates integration with local LLMs using Ollama.
  • Features an async scheduler (APScheduler) with Redis and SQLAlchemy.
  • Includes XLSX file import using Polars and the Calamine engine.
  • Implements user authentication with JWT and Redis.

Maintenance & Community

  • Actively updated, with recent additions including LLM integration and a switch to uv for package management.
  • Mentions uv and ruff as key tooling inspirations.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is therefore undetermined.

Limitations & Caveats

The project's license is not specified, which may impact commercial adoption or integration into closed-source projects.

Health Check
Last commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
1
Star History
25 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.