A modern, type-safe, and extensible SQL query builder for Python.
Project description
sqlo
A lightweight and simple SQL query builder for Python. Build SQL queries with a clean, intuitive API while staying safe from SQL injection.
Why sqlo?
- 🪶 Lightweight: Zero dependencies, minimal footprint
- ✨ Simple: Intuitive fluent API, easy to learn
- 🛡️ Secure by Default: Built-in SQL injection protection
- 🐍 Pythonic: Fluent API design that feels natural to Python developers
- 🧩 Composable: Build complex queries from reusable parts
- 🚀 Extensible: Support for custom dialects and functions
- 🔍 Type-Safe: Designed with type hints for better IDE support
- ✅ Well-Tested: 99% code coverage with comprehensive security tests
Installation
pip install sqlo
Quick Start
from sqlo import Q
# SELECT query
query = Q.select("id", "name").from_("users").where("active", True)
sql, params = query.build()
# SQL: SELECT `id`, `name` FROM `users` WHERE `active` = %s
# Params: (True,)
# INSERT query
query = Q.insert_into("users").values([
{"name": "Alice", "email": "alice@example.com"}
])
sql, params = query.build()
Documentation
Full documentation is available at https://nan-guo.github.io/sqlo/.
You can also browse the markdown files on GitHub:
- Getting Started
- Security Guide
- SELECT Queries
- INSERT Queries
- UPDATE Queries
- DELETE Queries
- JOIN Operations
- Condition Objects
- Expressions & Functions
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlo-0.1.1.tar.gz.
File metadata
- Download URL: sqlo-0.1.1.tar.gz
- Upload date:
- Size: 8.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c832c62b236c3991f5e221db5d5a205ca3e426efc36829f683e7702ed7416f0f
|
|
| MD5 |
891d4e351231e40de4750ff45b91639d
|
|
| BLAKE2b-256 |
9abe6c03214108b366ea6245d4f0d79a091b7d04515319ffb9aa0651958d094f
|
File details
Details for the file sqlo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sqlo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7b47a7fd4e31073cea7e8214c5275c844f1ff657332bd0aeb5770cf7d6ed8f1
|
|
| MD5 |
5e79e36e5db00635828e90c85eecb5db
|
|
| BLAKE2b-256 |
9c290f823ea55559cb672bceae4daae198287f51ad23c346ccb03b62a74984cb
|