Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/socrateslee/sonq
A query tool for son like objects, for example, json and bson.
https://github.com/socrateslee/sonq
bson json mongodb python
Last synced: about 1 month ago
JSON representation
A query tool for son like objects, for example, json and bson.
- Host: GitHub
- URL: https://github.com/socrateslee/sonq
- Owner: socrateslee
- Created: 2018-06-27T11:51:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-28T07:35:17.000Z (8 months ago)
- Last Synced: 2024-04-28T08:52:29.745Z (8 months ago)
- Topics: bson, json, mongodb, python
- Language: Python
- Size: 14.6 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sonq
__sonq__ means son query, is a tool for querying son like objects, for example, JSON and BSON. You may use sonq to query .bson or newline separated .json files(JSON Lines) directly from the command line.
## Install
```
pip install sonq
```## Basic Usage
- List the content of a .bson file
```
sonq source.bson
```
- Query a .bson file
```
sonq -f '{"name": "Stark"}' source.bson
```
- Convert query results to a newline separated .json file
```
sonq -f '{"name": "Stark"}' -o target.json source.bson
```
- Convert json from stdin to .bson
```
echo '{"name": "Stark"}' | python3 -m sonq.cmd -o target.bson -
```