https://github.com/natiiix/uniquery
Unified query language for various commonly used data representation formats (JSON, XML, YAML, etc.)
https://github.com/natiiix/uniquery
golang json query-language unified-query-language yaml
Last synced: 8 months ago
JSON representation
Unified query language for various commonly used data representation formats (JSON, XML, YAML, etc.)
- Host: GitHub
- URL: https://github.com/natiiix/uniquery
- Owner: natiiix
- License: mit
- Created: 2019-10-31T14:16:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-04T21:20:52.000Z (over 6 years ago)
- Last Synced: 2025-10-13T05:46:21.671Z (8 months ago)
- Topics: golang, json, query-language, unified-query-language, yaml
- Language: Go
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UniQuery
Unified query language for various commonly used data representation formats (JSON, XML, YAML, etc.)
## Usage
Install [Go](https://golang.org/) and run `go run cmd/uniquery/main.go -h` to get information about available flags and their meaning.
## Query Syntax
Please see [query examples](examples.md) for rough query syntax explanation.
## Data Format Support
| Format | Support | Notes |
| :----: | :--------------------- | :----------------------------------- |
| JSON | :heavy_check_mark: Yes | Works according to tests. |
| YAML | :question: Partial | Not very well tested yet. |
| XML | :x: No | More complicated than JSON and YAML. |
| CSV | :x: No | Support is not currently planned. |
## Example (JSON)
Consider the following JSON file `users.json`, which maps real names to nicknames.
```json
{
"alice80": "Alice Yang",
"bob12": "Bob Jacobs",
"tank": "Charlie Peterson"
}
```
| Query | Result |
| ----------: | :------------------------------------------------- |
| empty query | root element / whole data structure |
| `alice80` | `"Alice Yang"` |
| `tank` | `"Charlie Peterson"` |
| `*` | `["Alice Yang", "Bob Jacobs", "Charlie Peterson"]` |
| `alice80.` | root element (parent of `alice80`) |