Tagged articles
36 articles
Page 1 of 1
Data Party THU
Data Party THU
May 6, 2026 · Backend Development

How a Python Generic Repository Cuts 80% of Duplicate CRUD Code

The article demonstrates building a type‑safe, reusable generic repository with Python generics and SQLAlchemy, showing how to replace repetitive CRUD implementations across multiple FastAPI entities, reduce code size from hundreds of lines to a few dozen, and avoid common pitfalls such as missing rollbacks.

FastAPIGenericsPython
0 likes · 14 min read
How a Python Generic Repository Cuts 80% of Duplicate CRUD Code
Data STUDIO
Data STUDIO
Apr 21, 2026 · Backend Development

Build Once, Reuse Anywhere: Generic Repository Pattern in Python

The article demonstrates how to eliminate repetitive CRUD code in FastAPI projects by creating a type‑safe, generic repository using Python generics and SQLAlchemy, showing a concrete abstract base class, concrete implementations, custom filters, error handling, and real‑world metrics that cut repository code from hundreds to a few dozen lines.

CRUDDesign PatternsFastAPI
0 likes · 13 min read
Build Once, Reuse Anywhere: Generic Repository Pattern in Python
Shuge Unlimited
Shuge Unlimited
Apr 14, 2026 · Backend Development

Mastering SKU Inventory Deduction with Superpowers: A 7‑Stage Workflow

This article walks through a complete 7‑stage Superpowers workflow—brainstorming, isolated git worktrees, fine‑grained task planning, sub‑agent execution with two‑stage reviews, strict test‑driven development, global code review, and final branch finishing—using Python 3.11, FastAPI, SQLAlchemy and Pytest to implement robust SKU inventory deduction in an e‑commerce system.

AI programmingFastAPIGit worktrees
0 likes · 20 min read
Mastering SKU Inventory Deduction with Superpowers: A 7‑Stage Workflow
Data STUDIO
Data STUDIO
Nov 24, 2025 · Backend Development

Avoid These 10 Common FastAPI Pitfalls for Beginners

This guide lists ten typical mistakes that new FastAPI developers make—such as using synchronous I/O in async endpoints, ignoring Pydantic models, mishandling database sessions, creating per‑request clients, misconfiguring CORS, monolithic code files, returning raw ORM objects, weak authentication, lacking timeouts/retries for external calls, and skipping testing—and provides concrete solutions with code examples to keep applications fast, reliable, and maintainable.

AsyncCORSFastAPI
0 likes · 14 min read
Avoid These 10 Common FastAPI Pitfalls for Beginners
Python Crawling & Data Mining
Python Crawling & Data Mining
Oct 3, 2025 · Backend Development

From Flask to FastAPI: A Complete Guide to Building High‑Performance Python Web APIs

This article walks you through building modern Python web applications, starting with Flask fundamentals, advancing to FastAPI’s async capabilities, covering RESTful API design, database integration with SQLAlchemy and Tortoise ORM, testing, deployment, and performance comparisons to help you choose the right framework.

AsyncFastAPIFlask
0 likes · 22 min read
From Flask to FastAPI: A Complete Guide to Building High‑Performance Python Web APIs
Code Mala Tang
Code Mala Tang
Jul 3, 2025 · Databases

Master Peewee ORM: From Basic CRUD to Advanced Queries Compared with SQLAlchemy

This tutorial walks through Peewee’s lightweight ORM features—from creating, bulk inserting, updating, and deleting records to complex aggregations, window functions, CTEs, and PostgreSQL RETURNING clauses—while comparing its learning curve and performance to SQLAlchemy using real‑world Leapcell examples.

Advanced QueriesCRUDORM
0 likes · 17 min read
Master Peewee ORM: From Basic CRUD to Advanced Queries Compared with SQLAlchemy
Code Mala Tang
Code Mala Tang
Jul 1, 2025 · Backend Development

How a Simple Depends() Fix Halved My FastAPI Response Times

After noticing API endpoints taking up to a second, the author discovered that misusing FastAPI's Depends() with a get_db() function that recreated the database engine on each request caused severe latency, and by refactoring get_db() into a proper generator that reuses a single engine, response times were roughly halved.

DependsFastAPIPerformance Optimization
0 likes · 6 min read
How a Simple Depends() Fix Halved My FastAPI Response Times
Code Mala Tang
Code Mala Tang
May 27, 2025 · Backend Development

Mastering Database Connections in FastAPI: Best Practices and Code Samples

Learn how to efficiently configure and manage database connections in FastAPI, covering synchronous and asynchronous setups, dependency injection, session handling, and testing strategies, to prevent leaks, boost performance, and ensure scalable, reliable applications.

AsyncConnection ManagementFastAPI
0 likes · 8 min read
Mastering Database Connections in FastAPI: Best Practices and Code Samples
Python Crawling & Data Mining
Python Crawling & Data Mining
Apr 6, 2023 · Backend Development

Why Does SQLAlchemy 2.0 Throw an Encoding Error? Solution Explained

In this article, the author explains a common SQLAlchemy error caused by upgrading from version 1.4.42 to 2.0.7, demonstrates how the missing 'encoding' parameter leads to failures, and provides a clear solution along with practical tips for asking technical questions in Python communities.

Backend DevelopmentSQLAlchemyVersion Compatibility
0 likes · 3 min read
Why Does SQLAlchemy 2.0 Throw an Encoding Error? Solution Explained
Python Programming Learning Circle
Python Programming Learning Circle
May 16, 2022 · Backend Development

Using SQLAlchemy ORM in Python: Design, Initialization, Model Mapping, and Session Management

This article explains how to replace raw PyMySQL usage with SQLAlchemy ORM in Python, covering environment setup, database connection initialization, MVC‑style project structure, model class definitions, field attributes, session handling with context managers, and practical code examples for saving and querying data.

BackendORMSQLAlchemy
0 likes · 9 min read
Using SQLAlchemy ORM in Python: Design, Initialization, Model Mapping, and Session Management
Architects Research Society
Architects Research Society
Aug 31, 2021 · Fundamentals

Apache Superset – Overview and Supported Databases

Apache Superset is a modern, enterprise‑ready open‑source business intelligence web application that offers rich data visualizations, an easy‑to‑use interface, dashboard sharing, robust security, a semantic layer, and integration with a wide range of relational and analytical databases.

Apache SupersetBusiness IntelligenceData visualization
0 likes · 5 min read
Apache Superset – Overview and Supported Databases
Python Programming Learning Circle
Python Programming Learning Circle
Mar 29, 2021 · Fundamentals

Understanding Python Context Managers: Basics, Custom Implementations, and Advanced Applications

This article explains Python's context manager mechanism, covering the basic with statement, custom __enter__/__exit__ classes, the contextlib.contextmanager decorator, nesting, combining multiple managers with ExitStack, and practical applications such as SQLAlchemy session handling, exception management, and persistent HTTP requests.

DecoratorPythonResource Management
0 likes · 6 min read
Understanding Python Context Managers: Basics, Custom Implementations, and Advanced Applications
360 Quality & Efficiency
360 Quality & Efficiency
Mar 5, 2021 · Databases

Asynchronous MySQL Operations with aiomysql and SQLAlchemy in Python

This tutorial explains how to perform asynchronous MySQL operations in Python using aiomysql, covering basic connections, CRUD actions, safe parameter handling to prevent SQL injection, connection pooling, transaction management, integration with SQLAlchemy for ORM queries, and a custom reconnection wrapper for resilient database access.

Connection PoolingPythonSQLAlchemy
0 likes · 38 min read
Asynchronous MySQL Operations with aiomysql and SQLAlchemy in Python
MaGe Linux Operations
MaGe Linux Operations
Sep 29, 2020 · Databases

Master Python Database Access: From DB‑API to Connection Pools

This article introduces Python's DB‑API for interacting with various databases, explains how to use PyMySQL and SQLAlchemy for MySQL, demonstrates basic CRUD operations, safeguards against SQL injection, and shows how to implement thread‑safe connection pools with DBUtils for scalable backend applications.

Connection PoolDBAPIDBUtils
0 likes · 17 min read
Master Python Database Access: From DB‑API to Connection Pools
NetEase Game Operations Platform
NetEase Game Operations Platform
Aug 8, 2020 · Backend Development

Debugging “Instance XXX is not bound to a Session” Errors in Gevent‑Enabled Flask APIs with SQLAlchemy

This article analyzes the intermittent “Instance XXX is not bound to a Session” error that occurs after converting a Flask‑SQLAlchemy endpoint from serial to multithreaded/gevent concurrency, reproduces the issue with test code, explains the root cause in session handling, and provides a concrete fix by patching gevent before session initialization.

BackendFlaskPython
0 likes · 6 min read
Debugging “Instance XXX is not bound to a Session” Errors in Gevent‑Enabled Flask APIs with SQLAlchemy
HomeTech
HomeTech
Dec 4, 2019 · Databases

Automating Test Data Generation with SQLAlchemy ORM, Faker, and Requests in Python

This article demonstrates how to automate e‑commerce test data creation by retrieving schema information with SQLAlchemy ORM, defining mapping classes, generating realistic data using Faker, and submitting it via HTTP requests with the Requests library, covering database interactions, data assembly, and API communication.

FakerHTTPORM
0 likes · 13 min read
Automating Test Data Generation with SQLAlchemy ORM, Faker, and Requests in Python
MaGe Linux Operations
MaGe Linux Operations
Nov 24, 2018 · Backend Development

Build a Simple Student Management System with Python RESTful API

This tutorial walks through designing a RESTful API, creating a school‑teacher‑student CRUD system, modeling the database schema, structuring the Flask project, and using tools like Postman and curl to test the Python backend, with code snippets and diagrams illustrating each step.

CRUDFlaskPostman
0 likes · 3 min read
Build a Simple Student Management System with Python RESTful API
MaGe Linux Operations
MaGe Linux Operations
Aug 21, 2017 · Backend Development

Building a Simple Student Management System with Python RESTful APIs

This tutorial walks through creating a lightweight student management system in Python, covering RESTful API design, CRUD operations for school, teacher, and student data, database schema creation with SQLAlchemy, Flask endpoint implementation, and tools for testing and result visualization.

CRUDDatabase designFlask
0 likes · 5 min read
Building a Simple Student Management System with Python RESTful APIs
MaGe Linux Operations
MaGe Linux Operations
Apr 30, 2017 · Databases

Master PyMySQL: Install, Connect, and Perform CRUD with Real-World Code

This guide compares three Python MySQL libraries—Python‑MySQL, PyMySQL, and SQLAlchemy—explains their strengths and limitations, and provides step‑by‑step instructions with code screenshots for installing, importing, connecting, querying, and performing insert and update operations using PyMySQL.

PythonSQLAlchemyTutorial
0 likes · 3 min read
Master PyMySQL: Install, Connect, and Perform CRUD with Real-World Code
MaGe Linux Operations
MaGe Linux Operations
Feb 17, 2017 · Backend Development

Mastering ORM with SQLAlchemy: A Hands‑On Python Database Guide

Learn the fundamentals of Object‑Relational Mapping (ORM) and how to use Python’s SQLAlchemy library to define models, initialize sessions, create tables, and perform CRUD operations, with clear examples and code snippets that illustrate switching databases and advanced query techniques.

Backend DevelopmentORMPython
0 likes · 5 min read
Mastering ORM with SQLAlchemy: A Hands‑On Python Database Guide