sqlparams
Convert between various DB API 2.0 parameter styles.
Decision gist · record as of 2026-08-14
Yes. sqlparams solves a real compatibility problem with minimal friction: it's a pure-Python package with no dependencies, supports current Python versions (3.8–3.13), carries no known vulnerabilities, and uses a permissive MIT license. Its dormant maintenance status is not a concern for a stable utility with a narrow, well-defined scope. Install it if you need to bridge parameter style mismatches between your code and your database driver.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is dormant (566 days since last release) but the repository remains active with a recent commit on 2025-01-25, and the package has been stable since its 2012 initial release.
License · maintenance · safety
MIT License (permissive) — MIT License (permissive): you can use, modify, and distribute sqlparams freely in commercial and private projects with minimal restrictions.
last release 2025-01-25 (566 days) · last repo commit 2025-01-25 · 41 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,777,211 downloads/mo, #1,851 on PyPI
Alternatives
Verify before relying
import sqlparams
query = sqlparams.SQLParams('named', 'qmark')
sql, params = query.format('SELECT * FROM users WHERE name = :name;', {'name': 'Thorin'})
print(sql) # SELECT * FROM users WHERE name = ?;
print(params) # ['Thorin']- Whether the package handles all edge cases in parameter expansion (e.g., nested tuples, special characters in identifiers) as robustly as production use requires.
- Performance characteristics when converting large or complex queries with many parameters.
What it is and what it does
sqlparams is a utility for translating SQL parameter styles between formats. Many Python database drivers (like pyodbc) support only one parameter style—typically ordinal qmark (?) or format (%)—but developers often prefer named parameters (:name) for readability and safety. This package bridges that gap by accepting a query and parameters in any style and converting them to the style your driver expects.
You create an SQLParams instance specifying the input and output styles, then call format() or formatmany() to convert queries and their parameter dictionaries. It handles scalar values, tuples (for SQL IN clauses), and batch operations. The package supports seven parameter styles: qmark, numeric, named, format, pyformat, numeric_dollar, and named_dollar, plus Oracle and SQL Server variants.
Use it for
- Use it to write portable database code that works with drivers supporting only qmark or format styles while using named parameters in your application.
- Use it to safely expand tuples into SQL IN clauses without manual string concatenation or SQL injection risk.
- Use it to convert batch operations (executemany) by formatting multiple parameter sets at once with formatmany().
- Use it to migrate code between database systems that prefer different parameter conventions (e.g., Oracle to SQL Server).
- Use it to strip SQL comments before parameter expansion to avoid accidentally matching variable-like strings in comments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
sqlparams solves a real compatibility problem with minimal friction: it's a pure-Python package with no dependencies, supports current Python versions (3.8–3.13), carries no known vulnerabilities, and uses a permissive MIT license. Its dormant maintenance status is not a concern for a stable utility with a narrow, well-defined scope. Install it if you need to bridge parameter style mismatches between your code and your database driver.
Install
sqlparams on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant (566 days since last release) but the repository remains active with a recent commit on 2025-01-25, and the package has been stable since its 2012 initial release.
License in practice
MIT License (permissive): you can use, modify, and distribute sqlparams freely in commercial and private projects with minimal restrictions.
Quickstart
import sqlparams
query = sqlparams.SQLParams('named', 'qmark')
sql, params = query.format('SELECT * FROM users WHERE name = :name;', {'name': 'Thorin'})
print(sql) # SELECT * FROM users WHERE name = ?;
print(params) # ['Thorin']
Verify before relying
- Whether the package handles all edge cases in parameter expansion (e.g., nested tuples, special characters in identifiers) as robustly as production use requires.
- Performance characteristics when converting large or complex queries with many parameters.
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 566 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,777,211 / month, #1,851 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DatabaseTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities |
Evidence: sqlparams-6.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “SQL parameter style conversion”
- sqlparamsConverts SQL queries between different parameter styles (named,…
- sqlfluffSQLFluff is a SQL linter and auto-fixer that checks SQL code for…
- collate-sqlfluffSQLFluff is a SQL linter and auto-fixer that checks SQL code for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also jinjasql · pyodbc · python-sql · jinjasql2 · dbt-sqlserver · buildpg · mssql · sqlalchemy-trino · pypyodbc · sqlmodel