jmespath
2.0.1, released 5 years ago by an unverified publisher
Dart implementation of JMESPath, a query language for JSON documents.
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.
- json_schema
Validate JSON data against JSON Schema drafts in Dart.
63Compare - json_path
Dart implementation of RFC 9535 JSONPath for querying and manipulating JSON
65Compare - secp256k1
Pure Dart implementation of secp256k1 ECDSA signing and verification
61Compare - message_pack_dart
Binary MessagePack serializer/deserializer for Dart and Flutter.
48Compare
Works with
Packages commonly used together with jmespath: ones it builds on, ones built on it, and its own family.