{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/20"},{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Constructs SQL queries programmatically using Python syntax instead of string concatenation, generating parameterized SQL and parameter tuples for safe database execution.","skillfed_tags":["query-builder","sql-generation","injection-safe"],"use_cases":["Build SELECT queries with WHERE, JOIN, GROUP BY, and ORDER BY clauses programmatically without string concatenation.","Generate INSERT, UPDATE, and DELETE statements with parameterized values to prevent SQL injection.","Construct complex subqueries and nested conditions using Python operators and method chaining.","Adapt query output to different SQL dialects (PostgreSQL, MySQL, Oracle, SQLite) via Flavor configuration.","Generate parameterized queries for use with database drivers that require separate query strings and parameter tuples."],"what_it_does":"python-sql is a query builder that lets you write SQL statements as Python objects instead of raw strings. You define tables, columns, and conditions using Python syntax\u2014like `user.select(user.name)` or `user.where(user.active == True)`\u2014and the library generates parameterized SQL and a tuple of bind parameters. This approach prevents SQL injection by separating query structure from values, and makes complex queries (joins, subselects, aggregations, updates, deletes) easier to construct and read.\n\nThe library supports SELECT, INSERT, UPDATE, and DELETE operations, with features like joins, GROUP BY, ORDER BY, aggregates, and subqueries. It also provides a Flavor system to adapt output to different SQL dialects (limit/offset styles, parameter markers like `?` or `:0`). With no external dependencies and pure Python implementation, it integrates easily into any project that needs to build queries dynamically without an ORM.","worth_installing":"Yes. python-sql is a lightweight, dependency-free query builder suitable for projects that need programmatic SQL construction without a full ORM. It's actively maintained, production-stable, has no known vulnerabilities, and works with Python 3.9+. Install it if you're building dynamic queries and want type-safe, injection-proof SQL generation; skip it if you prefer raw SQL strings or a heavier ORM like SQLAlchemy."},"id":"python-sql","links":{"html":"https://skillfed.io/packages/python-sql","md":"https://skillfed.io/packages/python-sql.md","pypi":"https://pypi.org/project/python-sql/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-03","license_spdx":"BSD-3-Clause","license_treatment":"permissive","name":"python-sql","python_support":"supports_current","summary":"Library to write SQL queries"},"popularity":{"monthly_downloads":106014,"position":12672,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.8.1"}
