jmespath / jmespath/jmespath.py

Ability to set and delete based on a jmespath

Open
#121 6 comments 34 reactions 0 assignees View on GitHub
feature-request
Dominant language
Python
Stars
2.4k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

For example if I had following dict;

```
data = {
"foo": {
"bar": [
{"name": "one"},
{"name": "two"}
]
}
}
```

I'd like to be able to change the value of "one" to "three" be using something like;

```
new_data = jmespath.replace('foo.bar[1].name', 'three', data)
```

And then remove the first item of the "bar" list;

```
new_data = jmespath.remove('foo.bar[1]', data)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.