skillfed

jq

jq is a lightweight and flexible JSON processor.

jq v1.12.0 7.0M downloads/30d#1,798 on PyPI452
Permissive license BSD-2-Clause Active released

What it is and what it does

jq is a Python wrapper around the jq JSON query language (version 1.8.2), letting you write jq programs in Python and apply them to JSON data. It compiles a jq program string into an executable object, then chains input methods (input_value, input_values, input_text) to supply data and output methods (first, all, text, iter) to retrieve results. The package handles both parsed JSON values and raw JSON text, supports multiple outputs per query, and allows passing variables into programs via the args parameter.

The main use case is querying and transforming JSON structures using jq's expressive filter syntax without shelling out to the jq command-line tool. It has no runtime dependencies beyond the compiled jq library itself, and prebuilt wheels cover most common platforms and Python versions, though building from source on unsupported platforms requires a C toolchain.

Use it for:

  • Extract and transform JSON data in data pipelines using jq's filter syntax instead of manual dict manipulation.
  • Parse streaming JSON text (newline-delimited or slurped) and apply complex queries in a single call.
  • Integrate jq programs written for command-line use into Python applications without subprocess overhead.
  • Filter and reshape nested JSON structures with jq's array/object operators and built-in functions.
  • Build JSON query tools that accept jq program strings as user input and execute them safely.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python bindings for jq 1.8.2 that let you compile and execute jq programs against JSON data, with multiple input and output methods.

Yes. jq is actively maintained, has no known vulnerabilities, runs on current Python versions, and offers prebuilt wheels for common platforms. Install friction is moderate but manageable. Use it if you need jq's query language in Python; if you only need basic JSON manipulation, the standard library json module may suffice.

Install

jq on PyPI

pip

pip install jq

uv

uv add jq

poetry

poetry add jq

Installing jq

Before you install

Medium install friction: prebuilt wheels exist for Python 3.8–3.14 on Linux, macOS, and Windows, but fallback source builds require autoconf, libtool, a C compiler, and Python headers. Set JQPY_USE_SYSTEM_LIBS=1 to use system libjq instead of building it.

License in practice

BSD-2-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install jq

import jq

result = jq.compile(".+5").input_value(42).first()
assert result == 47

If no prebuilt wheel is available, building from source requires autoconf, libtool, a C compiler, and Python development headers.

Verify before relying

  • Whether jq 1.8.2 is the latest upstream version or if newer versions are available
  • Performance characteristics compared to other JSON query libraries in Python
  • Whether PyPy support is actively tested or only declared

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 35 days since the last release
Last repo commit
First released
Downloads 7,021,577/month — #1,798 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jq-1.12.0-cp310-cp310-macosx_10_9_x86_64.whl; jq-1.12.0-cp310-cp310-macosx_11_0_arm64.whl; jq-1.12.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; jq-1.12.0-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; jq-1.12.0-cp310-cp310-musllinux_1_2_aarch64.whl; jq-1.12.0-cp310-cp310-musllinux_1_2_x86_64.whl; jq-1.12.0-cp310-cp310-win_amd64.whl; jq-1.12.0-cp311-cp311-macosx_10_9_x86_64.whl; jq-1.12.0-cp311-cp311-macosx_11_0_arm64.whl; jq-1.12.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; jq-1.12.0-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; jq-1.12.0-cp311-cp311-musllinux_1_2_aarch64.whl; jq-1.12.0-cp311-cp311-musllinux_1_2_x86_64.whl; jq-1.12.0-cp311-cp311-win_amd64.whl; jq-1.12.0-cp312-cp312-macosx_10_13_x86_64.whl; jq-1.12.0-cp312-cp312-macosx_11_0_arm64.whl; jq-1.12.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; jq-1.12.0-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; jq-1.12.0-cp312-cp312-musllinux_1_2_aarch64.whl; jq-1.12.0-cp312-cp312-musllinux_1_2_x86_64.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

jq json processor pythonjson query language pythonjq bindingsjson filtering pythonjq program execution
json-querydata-transformation

More Text Processing packages