skillfed

bc-jsonpath-ng

A final implementation of JSONPath for Python that aims to be standard compliant, including arithmetic and binary comparison operators and providing clear AST for metaprogramming.

bc-jsonpath-ng v1.6.1 4.4M downloads/30d#2,305 on PyPI9
Permissive license Apache License 2.0 DORMANT released

What it is and what it does

bc-jsonpath-ng is a JSONPath implementation for Python that provides a full language implementation rather than regex-based matching. It parses JSONPath expressions into first-class AST objects, making them easy to analyze, transform, and extend. The library supports standard JSONPath syntax plus extensions like arithmetic operators, binary comparisons, named operators, and the ability to update or remove nodes in the matched tree.

You use it by parsing a JSONPath string or building expressions programmatically, then calling find() on a JSON-like Python dict to extract matching values. The library returns match objects that preserve full path information, enabling automatic ID generation and parent traversal. It depends on ply and decorator for parsing and function decoration.

Use it for:

  • Extract specific fields from nested JSON APIs or configuration files using a single expression.
  • Validate or filter JSON documents by matching against multiple conditions with operators.
  • Build tools that transform JSON structures by updating or removing matched nodes via the AST API.
  • Generate automatic unique identifiers for JSON data elements that lack them, using path information.
  • Parse and analyze JSONPath expressions themselves for query optimization or documentation.

Worth the install?

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

Parses and queries JSON structures using JSONPath expressions, supporting arithmetic operators, binary comparisons, and AST manipulation for extracting, updating, or removing nodes.

Yes, if you need standards-compliant JSONPath with arithmetic and comparison operators. The low install friction, permissive license, and zero security issues make it safe to add. However, note that maintenance is dormant (last commit Feb 2024, no releases for 992 days)—suitable for stable production use but not for projects requiring active bug fixes or feature development.

Install

bc-jsonpath-ng on PyPI

pip

pip install bc-jsonpath-ng

uv

uv add bc-jsonpath-ng

poetry

poetry add bc-jsonpath-ng

Installing bc-jsonpath-ng

Before you install

Low install friction with only two runtime dependencies (ply and decorator). Maintenance is dormant—last commit was 2024-02-05 and no releases for 992 days—but the package is marked Production/Stable and has seen no security issues.

License in practice

Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install bc-jsonpath-ng

from bc_jsonpath_ng import parse

jsonpath_expr = parse('foo[*].baz')
matches = jsonpath_expr.find({'foo': [{'baz': 1}, {'baz': 2}]})
values = [match.value for match in matches]

Requires Python 3.8 or later.

Verify before relying

  • Whether the dormant maintenance status (last commit Feb 2024) affects real-world reliability or if the stable API is sufficient for production use.
  • Performance characteristics when querying very large JSON documents or deeply nested structures.
  • Real-world usage patterns and whether the AST manipulation features (update/remove nodes) are actively used.

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — ply, decorator
Maintenance dormant — 992 days since the last release
Last repo commit
First released
Downloads 4,425,449/month — #2,305 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bc_jsonpath_ng-1.6.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

json query languagejsonpath parserextract json datajson tree traversaljson filtering and selectionjson path expressionsquery json documents
json-queryast-manipulation

More Python Modules packages