Coder Social home page Coder Social logo

romnn / serde_json_merge Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 834 KB

Merge, index, iterate, and sort a serde_json::Value (recursively).

Home Page: https://romnn.github.io/serde_json_merge/

License: MIT License

Rust 100.00%
extension indexing iterators json merge recursively rust serde-json sort

serde_json_merge's Introduction

serde_json_merge

build status test status benchmarks crates.io docs.rs

Merge, index, iterate, and sort a serde_json::Value (recursively).

This library supports in-place merging and sorting using DFS and BFS traversal unline most implementations out there that use recursion and can stack overflow.

[dependencies]
serde_json_merge = "0"

Usage

For usage examples, check the examples and documentation.

Examples

cargo run --example async_fs --features async -- --path ./
cargo run --example sync_fs --features sync,rayon -- --path ./

Documentation

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features

Linting

cargo feature-combinations clippy --fail-fast --pedantic --tests --benches --examples -- -Dclippy::all -Dclippy::pedantic
cargo clippy --tests --benches --examples -- -Dclippy::all -Dclippy::pedantic

Benchmarking

cargo install cargo-criterion
# full benchmark suite
cargo criterion --features full

Benchmark reports from CI are published are available here.

Acknowledgements

After i wrote this crate for another project and decided to publish it, I found json_value_merge.

Looking through it, I added merge_index inspired by their merge_in API.

TODO

  • write benchmarks

  • add globbing iter

  • add iters for keys and values

  • implement sorting values with indices

  • implement bfs

  • add rayon support using par-dfs

  • write documentation

  • add examples in the documentation

DONE:

  • inline everything
  • do we really need the any type? so useless right now :(
    • maybe use them for the very precise type?
  • add custom comparator for merging
  • split the sorting into extra module
  • implement unstable sorting
  • add feature gates for sort and merge
  • add few more tests for kind and so on
  • partial eq can be written top level
  • add limit to dfs
  • do not expose wrapper for Value but use extension
  • add depth parameter to recursive merge

serde_json_merge's People

Contributors

romnn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.