- Rust 100%
| serde-raw | Run cargo fmt | |
| sfil-cli | Run cargo fmt | |
| sfil-packager | Migrate to edition 2024 | |
| src | Run cargo fmt | |
| test_data | Add regex visitor | |
| .gitignore | Initial commit for converter | |
| .gitlab-ci.yml | Fix CI (again) | |
| Cargo.lock | Update dependencies | |
| Cargo.toml | Migrate to edition 2024 | |
| CHANGELOG.md | Release v0.1.0 | |
| COPYING.md | Prepare for first release | |
| README.md | Prepare for first release | |
SFIL
SFIL (for serde-filter) is a small command line to inspired by jq with some additions:
Support for many formats:
- JSON
- JSON5
- Bencode
- TOML
- CBOR
- MessagePack
- Yaml
- RON
This also has the very nice advantage of being usable as a conversion/debugging tool.
More intuitive syntax (at least for me, who has designed the syntax)
In these examples, the input is JSON, and so is the output. Similar behaviour will work with all supported data formats.
Selectors
Like in jq, .a.b will select the b item in the a item.
Array indexing
[0]will select the first item of a list.[0..10]will select the first ten items of a list.
It accepts all the variants of Rust range syntax.
Regex
.rg("(some|regex)") will return true if the input is a string that matches (some|regex).
The regex syntax is that of the regex rust crate.
Where filter
.where(.a.b) will selects elements of the map or array that have a a and b item that is true.
WhereKey filter
.where_key(.a) will selects elements of the map or array that have a a and b item that is true.
This is especially usefull with regexes:
.where_key(.rg("(a|b)"))
Higher performance
SFIL uses the serde library to implement its filtering, and most of the filtering is done without buffering, meaning that SFIL is capable of working on very large files with ease, and without loading all the data in memory.
This can be useful when dealing with large files.
Licensing
This project is licensed under the AGPL 3 license.