π String Pipeline
A powerful string transformation CLI tool and Rust library that makes complex text processing simple. Transform data using intuitive template syntax β chain operations like split, join, replace, filter, and 20+ others in a single readable expression.
π Table of Contents
- π Why String Pipeline?
- β‘ Quick Examples
- π Installation
- π Quick Start
- π Complete Documentation
- π§ͺ Testing
- π€ Contributing
- π License
π Why String Pipeline?
Transform complex text processing into simple, readable templates:
# Traditional approach (multiple commands)
| \
| \
| \
| \
| \
# String Pipeline (single template)
# Output: "company.org,email.com"
β¨ Key Features
- π Chainable Operations: Pipe operations together naturally
- π― Precise Control: Python-like ranges with Rust syntax (
-2..
,1..=3
) - πΊοΈ Powerful Mapping: Apply sub-pipelines to each list item
- π Regex Support: sed-like patterns for complex transformations
- π Debug Mode: Step-by-step operation visualization
- π₯ Flexible I/O: CLI tool + embeddable Rust library
β‘ Quick Examples
π₯ Basic Transformations
# Extract middle items from list
# Output: "b,c"
# Clean and format names
# Output: "JOHN!,JANE!,BOB!"
# Extract numbers and pad with zeros
# Output: "001,022,333"
π§ Advanced Processing
# Filter files, format as list
# Output: "β’ app.py\nβ’ test.py"
# Extract domains from URLs
# Output: "GITHUB.COM,GOOGLE.COM"
# Debug complex processing
# Shows step-by-step processing + final output: "Date,Banana"
# DEBUG: Initial value: Str("apple Banana cherry Date")
# DEBUG: Applying operation 1: Split { sep: " ", range: Range(None, None, false) }
# DEBUG: Result: List with 4 items:
# DEBUG: [0]: "apple"
# DEBUG: [1]: "Banana"
# DEBUG: [2]: "cherry"
# DEBUG: [3]: "Date"
# DEBUG: ---
# DEBUG: Applying operation 2: Filter { pattern: "^[A-Z]" }
# DEBUG: Result: List with 2 items:
# DEBUG: [0]: "Banana"
# DEBUG: [1]: "Date"
# DEBUG: ---
# DEBUG: Applying operation 3: Sort { direction: Desc }
# DEBUG: Result: List with 2 items:
# DEBUG: [0]: "Date"
# DEBUG: [1]: "Banana"
# DEBUG: ---
# Date Banana
π‘ Want to see more? Check out the π Complete Documentation with 20+ operations and real-world examples!
π Installation
π¦ CLI Tool
# Install from crates.io
# Or build from source
π Rust Library
Add to your Cargo.toml
:
[]
= "0.9.0"
π Quick Start
π» CLI Usage
# With argument
# With stdin
|
# Debug mode (shows each step)
# DEBUG: Initial value: Str("a,b,c")
# DEBUG: Applying operation 1: Split { sep: ",", range: Range(None, None, false) }
# DEBUG: Result: List with 3 items:
# DEBUG: [0]: "a"
# DEBUG: [1]: "b"
# DEBUG: [2]: "c"
# DEBUG: ---
# DEBUG: Applying operation 2: Map { operations: [Upper] }
# DEBUG: Map operation starting with 3 items
# DEBUG: Map operations to apply: 1 steps
# DEBUG: Step 1: Upper
# DEBUG: Processing item 1 of 3: "a"
# DEBUG: Item 1/3 initial value: Str("a")
# DEBUG: Item 1/3 applying step 1: Upper
# DEBUG: Item 1/3 step 1 result: String("A")
# DEBUG: Processing item 2 of 3: "b"
# DEBUG: Item 2/3 initial value: Str("b")
# DEBUG: Item 2/3 applying step 1: Upper
# DEBUG: Item 2/3 step 1 result: String("B")
# DEBUG: Processing item 3 of 3: "c"
# DEBUG: Item 3/3 initial value: Str("c")
# DEBUG: Item 3/3 applying step 1: Upper
# DEBUG: Item 3/3 step 1 result: String("C")
# DEBUG: Map operation completed. Results:
# DEBUG: Item 1: "A"
# DEBUG: Item 2: "B"
# DEBUG: Item 3: "C"
# DEBUG: Result: List with 3 items:
# DEBUG: [0]: "A"
# DEBUG: [1]: "B"
# DEBUG: [2]: "C"
# DEBUG: ---
# A,B,C
π¦ Library Usage
use Template;
π Complete Documentation
π― π Read the Full Template System Documentation
Everything you need to master String Pipeline:
- ποΈ Template Syntax - Structure, chaining, escaping rules
- π Operations Reference - 20+ operations with examples
- πͺ Split & Join - Parse and reassemble text
- βοΈ Slice & Range - Extract with Python-like indices
- π¨ Transform - Case, trim, pad, append/prepend
- π Regex - Pattern matching and replacement
- ποΈ List Ops - Filter, sort, unique, reverse
- πΊοΈ Map - Apply operations to each item
- π― Range Specifications - Negative indexing, edge cases
- π‘οΈ Escaping Rules - When and how to escape characters
- π Debug Mode - Visual operation debugging
- π‘ Real-world Examples - Data processing, log analysis, formatting
- β οΈ Troubleshooting - Common errors and best practices
π§ͺ Testing
# Run all tests
# Run with output
# Run benchmarks
π€ Contributing
We welcome contributions! π
- π Report bugs via GitHub Issues
- π‘ Suggest features or improvements
- π§ Submit pull requests
π Please see our comprehensive documentation for syntax details and examples.
π License
This project is licensed under the MIT License. See LICENSE for details.
β‘ Fast, composable string transformations made simple!