1
0
Fork
You've already forked sfil
0
No description
  • Rust 100%
2025年11月07日 22:32:25 +01:00
serde-raw Run cargo fmt 2025年09月03日 22:23:16 +02:00
sfil-cli Run cargo fmt 2025年09月03日 22:23:16 +02:00
sfil-packager Migrate to edition 2024 2025年03月07日 22:10:02 +01:00
src Run cargo fmt 2025年09月03日 22:23:16 +02:00
test_data Add regex visitor 2024年11月17日 16:36:41 +01:00
.gitignore Initial commit for converter 2023年03月04日 19:26:41 +01:00
.gitlab-ci.yml Fix CI (again) 2024年07月27日 19:55:56 +02:00
Cargo.lock Update dependencies 2025年11月07日 22:32:25 +01:00
Cargo.toml Migrate to edition 2024 2025年03月07日 22:10:02 +01:00
CHANGELOG.md Release v0.1.0 2024年11月17日 17:15:02 +01:00
COPYING.md Prepare for first release 2024年11月17日 17:11:25 +01:00
README.md Prepare for first release 2024年11月17日 17:11:25 +01:00

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.