Skip to content
pubscout

jmespath

2.0.1, released 5 years ago by an unverified publisher

Dart implementation of JMESPath, a query language for JSON documents.

WASM-ready
$ flutter pub add jmespath
Source repository

What it does

It takes a JSON document and transforms it into another JSON document through a JMESPath expression. It supports runtime searches as well as pre-compiled queries and custom exception handling.

AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to query or extract specific data from complex JSON documents using JMESPath expressions.
  • You want to run multiple searches with a pre-compiled query for better efficiency.

Skip it when

  • You only need basic key lookups that can be easily handled natively in Dart without a query language.
  • You are looking for code-generation-based JSON serialization helpers.

Strengths

  • Implements the standard JMESPath query language for JSON.
  • Supports pre-compiling queries for repeated searches.
  • Provides custom exception handling with JmesException.

Weaknesses

  • License is unknown.
  • Derived package with limited scope beyond JMESPath execution.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:jmespath/jmespath.dart';
import 'dart:convert';

void main() {
  var jsondata = r'{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}';
  var data = json.decode(jsondata);
  var search_string = 'foo.bar.baz[2]';
  var result = search(search_string, data);
  print(result); // 2
}

Alternatives

Packages that do the same job and could replace jmespath.

Works with

Packages commonly used together with jmespath: ones it builds on, ones built on it, and its own family.