Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kellyjonbrazil/jellex
TUI to filter JSON and JSON Lines data with Python syntax
https://github.com/kellyjonbrazil/jellex
filter json json-lines process python query tui
Last synced: 27 days ago
JSON representation
TUI to filter JSON and JSON Lines data with Python syntax
- Host: GitHub
- URL: https://github.com/kellyjonbrazil/jellex
- Owner: kellyjonbrazil
- License: mit
- Created: 2021-06-29T16:57:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T00:28:16.000Z (about 1 year ago)
- Last Synced: 2024-11-07T17:02:39.325Z (about 1 month ago)
- Topics: filter, json, json-lines, process, python, query, tui
- Language: Python
- Homepage:
- Size: 5.31 MB
- Stars: 104
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
- my-awesome-github-stars - kellyjonbrazil/jellex - TUI to filter JSON and JSON Lines data with Python syntax (Python)
- awesome-starred - kellyjonbrazil/jellex - TUI to filter JSON and JSON Lines data with Python syntax (python)
README
[![Pypi](https://img.shields.io/pypi/v/jellex.svg)](https://pypi.org/project/jellex/)
![jellex](https://github.com/kellyjonbrazil/jellex/raw/master/_images/jellex.png)
# Jello Explorer
TUI to filter JSON and JSON Lines data with Python syntaxHere is a video of `jellex` in action: https://youtu.be/-oR0yZ7JaO8
Jello Explorer (`jellex`) is a Text User Interface program to interactively process JSON and JSON Lines at the console using Python syntax. `jellex` uses [`jello`](https://github.com/kellyjonbrazil/jello) on the back-end to run the queries.
## Install
Jello Explorer can be installed via `pip`:[![Pypi](https://img.shields.io/pypi/v/jellex.svg)](https://pypi.org/project/jellex/)
```bash
pip install jellex
```## Usage
```
jellex FILE
```Examples:
```
$ jellex file.json
```or with process substitution:
```
$ jellex <(git log | jc --git-log)
```An Editor window displays on the left and a Viewer window displays on the right. A Schema view can be toggled on the right and a Status window displays on the bottom.
The Editor window uses standard EMACS key bindings and allows you to type your Python syntax query. `_` is the loaded JSON from the file presented as a python dict or list of dicts. You can use dot notation or traditional python bracket notation to access key names.
As you modify your query, the Viewer and Schema windows will update with the latest results. If there are any errors in the query (syntax errors, etc.), they will be displayed in the Status window at the bottom.
Tab completions are available for current context list indicies and key names.
Use `CTRL-\` to toggle the focus between the Editor, Viewer, and Schema windows.
Use `CTRL-S` to toggle the Schema window.
Use `CTRL-Q` or `CTRL-C`to exit.
> Note: Reserved key names that cannot be accessed using dot notation can be accessed via standard python dictionary notation. (e.g. `_.foo["get"]` instead of `_.foo.get`)
Here is an example after running `jellex twitterdata.json` and modifying the query:
![jellex](https://github.com/kellyjonbrazil/jellex/raw/master/_images/jellex-twitterdata.png)
When you exit (`CTRL-Q` or `CTRL-C`), you will be presented with your `jello` filter:
```
$ jellex twitterdata.json
Your query:jello '_[0].user'
$
```