Skip to main content

A modern, type-safe, and extensible SQL query builder for Python.

Project description

sqlo

CI PyPI Documentation License

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:

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.1.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlo-0.1.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

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

Hashes for sqlo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c832c62b236c3991f5e221db5d5a205ca3e426efc36829f683e7702ed7416f0f
MD5 891d4e351231e40de4750ff45b91639d
BLAKE2b-256 9abe6c03214108b366ea6245d4f0d79a091b7d04515319ffb9aa0651958d094f

See more details on using hashes here.

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

Hashes for sqlo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b47a7fd4e31073cea7e8214c5275c844f1ff657332bd0aeb5770cf7d6ed8f1
MD5 5e79e36e5db00635828e90c85eecb5db
BLAKE2b-256 9c290f823ea55559cb672bceae4daae198287f51ad23c346ccb03b62a74984cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page