Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brian3647/arrowpipe
Build complex pipelines easily
https://github.com/brian3647/arrowpipe
cargo crate data pipe rust
Last synced: about 13 hours ago
JSON representation
Build complex pipelines easily
- Host: GitHub
- URL: https://github.com/brian3647/arrowpipe
- Owner: Brian3647
- License: mit
- Created: 2023-11-13T19:32:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-13T20:04:38.000Z (12 months ago)
- Last Synced: 2024-04-24T03:38:03.460Z (7 months ago)
- Topics: cargo, crate, data, pipe, rust
- Language: Rust
- Homepage: https://crates.io/crates/arrowpipe
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.YML
- License: LICENSE
Awesome Lists containing this project
README
# ArrowPipe: Build complex pipelines easily
An [`Arrow`] is a function composition system that can be used to create
complex data processing pipelines.## Installation
Add the following to your `Cargo.toml`:
```toml
[dependencies]
arrowpipe = "*"
```## Example
```rust
use arrowpipe::Arrow;fn add_one(x: i32) -> i32 {
x + 1
}fn double(x: i32) -> i32 {
x * 2
}let mut arrow = Arrow::new(add_one);
arrow.symbiotize(Arrow::new(double));
arrow.symbiotize(Arrow::new(|x| x - 1));assert_eq!(arrow.shoot(1), 3);
```## Order of execution example:
```rust
use arrowpipe::Arrow;fn add_one(x: i32) -> i32 {
x + 1
}let mut first = Arrow::new(add_one); // Second: 2 -> 3
first.symbiotize(Arrow::new(|x| x * 2)); // Third: 3 -> 6let mut second = Arrow::new(add_one); // First: 1 -> 2
second.symbiotize(first);assert_eq!(second.shoot(1), 6);
```## Why?
This is specially useful for long pipelines like a build system. With the `Arrow` struct, you can simply add another `Arrow` to an existing one to have a new step.
## License
This project is licensed under the MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT).