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 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
sqlo-0.1.0.tar.gz
(8.7 MB
view details)
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
sqlo-0.1.0-py3-none-any.whl
(20.6 kB
view details)
File details
Details for the file sqlo-0.1.0.tar.gz.
File metadata
- Download URL: sqlo-0.1.0.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 |
539b638de3afe7d7cafe95b10f6e20e2bf068c15c1adab91261b7150b0249234
|
|
| MD5 |
62a2c83281760e439c20947e6d135e06
|
|
| BLAKE2b-256 |
3aa7d91060a618a6385ad5712aa75eb938702b6b0e2d31fde43ed1e61da7b6f1
|
File details
Details for the file sqlo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sqlo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.6 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 |
45435d80da7205a859c932d14e8f11e457ea98213e2f2e26e107dbf0b40e4111
|
|
| MD5 |
766836dfb2ee8b4b53091fed40970586
|
|
| BLAKE2b-256 |
44052eeab325d2087d491dd86a82a8307fea55b7506b25bc40dcc619231e8da2
|