$npx skillfedfor your agent

jinjasql

Generate SQL Queries and Corresponding Bind Parameters using a Jinja2 Template

With conditionsPyPI DatabaseReleased May 2020628.0K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — jinjasql-0.1.8-py3-none-any.whl
v0.1.8 · released 2020-05-27 · 1 runtime deps: Jinja2

Yes, if you need dynamic SQL templating with injection protection and your project can tolerate a dormant package. The core functionality is stable and the single Jinja2 dependency is mature. Not recommended if you require active maintenance, ongoing security updates, or support for cutting-edge Python versions—use an ORM or a maintained query builder instead for those cases.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction installation with a single runtime dependency on Jinja2.
  • However, the package is dormant—last release was 2020-05-27, over four years ago, with no recent commits despite the repository remaining active.
  • Suitable for stable use cases but not for projects requiring ongoing maintenance or updates.

License · maintenance · safety

MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution. Safe for commercial and private projects.

last release 2020-05-27 (2270 days) · last repo commit 2024-04-10 · 845 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 628,046 downloads/mo, #5,678 on PyPI

Verify before relying

from jinjasql import JinjaSql

j = JinjaSql()
template = "SELECT * FROM users WHERE id = {{ user_id }}"
query, bind_params = j.prepare_query(template, {"user_id": 123})
# query: "SELECT * FROM users WHERE id = %s"
# bind_params: [123]
  • Whether the package works reliably with modern Jinja2 versions beyond those listed in the description
  • Current compatibility with Python versions released after 3.5, given the classifiers list only mentions up to 3.5
  • Whether dormancy affects real-world usage or if the stable API is sufficient for typical reporting/BI workflows
Same gist for agents: .md · .json

What it is and what it does

JinjaSQL bridges Jinja2 templating and SQL generation, letting you write dynamic SQL queries using Jinja's full feature set—conditionals, loops, macros—while automatically extracting and binding parameters to prevent SQL injection. Instead of executing queries directly, it returns a parameterized query string (with %s, ?, :1, or other placeholders depending on your database driver) and a corresponding list or dictionary of bind values, which you then execute using your own database connection.

The package is designed for reporting, business intelligence, and complex queries where an ORM falls short—aggregations, multi-table joins, and bulk operations with dynamic structure. It does not execute queries itself; you retain full control over the database driver and execution. It automatically applies the bind filter to all template variables to catch injection risks at template-compile time, and provides optional filters like `|inclause` for IN clauses and `|sqlsafe` for table/column names when you explicitly need dynamic SQL identifiers.

Use it for

  • Build dynamic reporting queries with conditional WHERE clauses based on user filters
  • Generate aggregation and GROUP BY queries that vary in structure depending on parameters
  • Create migration or bulk-update scripts using Jinja macros to reduce repetition
  • Support multi-table joins with optional conditions that an ORM cannot express as cleanly
  • Generate parameterized queries for multiple database drivers (PostgreSQL, MySQL, SQLite) using different placeholder styles

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need dynamic SQL templating with injection protection and your project can tolerate a dormant package.

The core functionality is stable and the single Jinja2 dependency is mature. Not recommended if you require active maintenance, ongoing security updates, or support for cutting-edge Python versions—use an ORM or a maintained query builder instead for those cases.

Install

jinjasql on PyPI

Before you install

Low friction installation with a single runtime dependency on Jinja2. However, the package is dormant—last release was 2020-05-27, over four years ago, with no recent commits despite the repository remaining active. Suitable for stable use cases but not for projects requiring ongoing maintenance or updates.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution. Safe for commercial and private projects.

Quickstart

from jinjasql import JinjaSql

j = JinjaSql()
template = "SELECT * FROM users WHERE id = {{ user_id }}"
query, bind_params = j.prepare_query(template, {"user_id": 123})
# query: "SELECT * FROM users WHERE id = %s"
# bind_params: [123]

Verify before relying

  • Whether the package works reliably with modern Jinja2 versions beyond those listed in the description
  • Current compatibility with Python versions released after 3.5, given the classifiers list only mentions up to 3.5
  • Whether dormancy affects real-world usage or if the stable API is sufficient for typical reporting/BI workflows

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
Jinja2
MaintenanceDormant 2,270 days since the last release
Last repo commit
First released
Downloads628,046 / month, #5,678 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5

Evidence: jinjasql-0.1.8-py3-none-any.whl

Tags

Capabilities
sql query templatingjinja2 sql generationsql injection preventionparameterized query builderdynamic sql templatesbind parameter generationtemplate-based sql
Topics
sql-templatinginjection-safereporting
PyPI keywords
Jinja2SQLPythonTemplate

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 query templating”

  • jinjasqlGenerates parameterized SQL queries from Jinja2 templates,…
  • jupysqlAdds SQL execution to Jupyter and IPython notebooks via `%sql` and…
  • myclimycli is a command-line client for MySQL and compatible databases…

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also jinjasql2 · sqlparams · Jinja2 · sqlfluff · jinja_partials · buildpg · j2lint · jinja2_pluralize · jinja-cli · django-query-builder