Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/messense/rjmespath-py
jmespath.rs Python binding
https://github.com/messense/rjmespath-py
Last synced: 5 days ago
JSON representation
jmespath.rs Python binding
- Host: GitHub
- URL: https://github.com/messense/rjmespath-py
- Owner: messense
- License: mit
- Created: 2021-06-12T15:32:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T05:56:04.000Z (12 days ago)
- Last Synced: 2024-11-01T08:42:29.054Z (12 days ago)
- Language: Python
- Size: 63.5 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rjmespath-py
![CI](https://github.com/messense/rjmespath-py/workflows/CI/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/rjmespath.svg)](https://pypi.org/project/rjmespath)[jmespath.rs](https://github.com/jmespath/jmespath.rs) Python binding.
## Installation
```bash
pip install rjmespath
```## Usage
```python
import rjmespathprint(rjmespath.search('foo.bar', '{"foo": {"bar": "baz"}}'))
```## Performance
Running on MacBook Pro (13-inch, M1, 2020, 16GB RAM)
```python
In [1]: import jmespathIn [2]: import rjmespath
In [3]: %timeit jmespath.compile('foo')
436 ns ± 0.478 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)In [4]: %timeit rjmespath.compile('foo')
354 ns ± 0.583 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)In [5]: %timeit jmespath.search('foo.bar', {"foo": {"bar": "baz"}})
2.74 µs ± 10.1 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)In [6]: %timeit rjmespath.search('foo.bar', '{"foo": {"bar": "baz"}}')
1.21 µs ± 12.3 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
```## License
This work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file.