jq
jq is a lightweight and flexible JSON processor.
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 jquv
uv add jqpoetry
poetry add jqInstalling 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
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
yqyq is a command-line processor that applies jq…
permissive · top 5,000 on PyPI
jsonpath-rfc9535Queries JSON data using RFC 9535 JSONPath…
permissive · top 15,000 on PyPI
mongo-query-matchProvides a MongoDB-like query language for…
unclear · top 15,000 on PyPI
json-streamStreams JSON data from files, URLs, or…
permissive · top 5,000 on PyPI
jsonschema-rsjsonschema-rs validates JSON data against JSON…
permissive · top 5,000 on PyPI
injective-pyInjective Python SDK provides client libraries…
permissive · top 15,000 on PyPI
bc-jsonpath-ngParses and queries JSON structures using…
permissive · top 5,000 on PyPI
postalPython bindings to libpostal, a C library for…
permissive · top 15,000 on PyPI
pycupsProvides Python bindings to the CUPS printing…
copyleft · top 15,000 on PyPI
jsonquerylangExecutes queries against JSON data using a…
permissive · top 15,000 on PyPI