# hawk ๐ฆ
**Modern data analysis tool for JSON, YAML, CSV, and text files**
[](https://www.rust-lang.org/)
[](LICENSE)
[](https://crates.io/crates/hawk-data)
hawk combines the simplicity of `awk` with the power of `pandas`, bringing unified data processing to your command line. Process any data format with the same intuitive syntax.
## โก Quick Start
### Installation
```bash
# Homebrew (macOS/Linux)
brew install kyotalab/tools/hawk
# Cargo (Rust)
cargo install hawk-data
# Verify installation
hawk --version
```
### 30-Second Demo
```bash
# JSON/CSV analysis - same syntax!
# Text/log processing with slicing (NEW!)
# Advanced string operations with multiple fields
```
## ๐ Why hawk?
| **Multi-format** | โ
JSON, YAML, CSV, Text | โ JSON only | โ Text only | โ Python required |
| **Unified syntax** | โ
Same queries everywhere | โ JSON-specific | โ Line-based | โ Complex setup |
| **String operations** | โ
14 built-in + slicing | โ ๏ธ Limited | โ ๏ธ Basic | โ
Extensive |
| **Statistical analysis** | โ
Built-in median, stddev | โ None | โ None | โ
Full suite |
| **Learning curve** | ๐ข Familiar pandas-like | ๐ก Steep | ๐ข Simple | ๐ด High |
## ๐ฏ Key Features
### **Universal Data Processing**
Process any format with identical syntax:
```bash
hawk '.items[] | select(.price > 100)' data.yaml # YAML
hawk -t '. | select(. | contains("$"))' data.txt # Text
```
### **Advanced Text Processing (NEW in v0.2.3!)**
```bash
# Split with slicing - extract exactly what you need
# OR conditions for flexible filtering
# Powerful slicing for any operation result
```
### **Statistical Analysis Made Simple**
```bash
# Instant insights from your data
hawk '.metrics[] | unique(.user_id) | count' engagement.json
```
## ๐ Documentation
### **Get Started in 5 Minutes**
- ๐ [**Quick Start Guide**](docs/getting-started.md) - Essential basics
- ๐ [**Query Language Reference**](docs/query-language.md) - Complete syntax
- ๐งต [**String Operations**](docs/string-operations.md) - Text processing guide
### **Master Advanced Features**
- ๐ [**Data Analysis**](docs/data-analysis.md) - Statistical workflows
- ๐ [**Text Processing**](docs/text-processing.md) - Log analysis and text manipulation
- ๐ผ [**Real-world Examples**](docs/examples/) - Industry-specific use cases
### **Use Case Guides(In progress)**
- ๐ [**Log Analysis**](docs/examples/log-analysis.md) - Docker, nginx, application logs
- โ๏ธ [**DevOps Workflows**](docs/examples/devops-workflows.md) - Kubernetes, CI/CD, monitoring
- ๐ [**Data Science**](docs/examples/data-science.md) - CSV analysis, statistics, ML prep
## ๐ Popular Workflows
### **Log Analysis**
```bash
# Find error patterns in application logs
# Analyze Docker container performance
### **Data Exploration**
```bash
# Quick dataset overview
# Statistical analysis
### **DevOps Automation**
```bash
# Kubernetes resource analysis
# Performance monitoring
## โญ What's New in v0.2.3
- **๐ฏ Advanced Slicing**: `.[0:10]`, `.[-5:]`, `group_by(.field) | .[0:3]`
- **โ๏ธ Split with Slicing**: `split(" ")[0:3]`, `split(",")[-2:]`
- **๐ OR Conditions**: `contains("GET|POST")`, `starts_with("ERROR|WARN")`
- **๐ Stratified Sampling**: Sample from each group for unbiased analysis
- **โก Performance**: Optimized for large datasets with efficient memory usage
## ๐ค Contributing
We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md).
```bash
git clone https://github.com/kyotalab/hawk.git
cd hawk
cargo build --release
cargo test
```
## ๐ License
MIT License - see [LICENSE](LICENSE) for details.
---
**Ready to transform your data workflows?** Start with our [5-minute tutorial](docs/getting-started.md) ๐