dkit-0.3.0 is not a library.
Visit the last successful build:
dkit-0.9.0
dkit
Swiss army knife for data format conversion and querying.
Convert between JSON, CSV, YAML, TOML, XML, TSV, and MessagePack with a single CLI. Query nested data, compare files, preview as tables, and pipe everything together.
Quick Start
# Install
# Convert JSON to YAML
# Query nested data
# Preview CSV as a table
Installation
From crates.io
From source
Supported Formats
| Format | Extensions | Read | Write |
|---|---|---|---|
| JSON | .json |
O | O |
| CSV | .csv |
O | O |
| TSV | .tsv |
O | O |
| YAML | .yaml, .yml |
O | O |
| TOML | .toml |
O | O |
| XML | .xml |
O | O |
| MessagePack | .msgpack |
O | O |
All conversion paths between supported formats are available.
Commands
convert — Format conversion
# Basic conversion
# Output to file
# Batch conversion
# Pipe from stdin
|
# Options
query — Data querying
# Field access
# Nested path
# Array iteration
# Negative indexing
Query syntax:
| Syntax | Description |
|---|---|
.field |
Object field access |
.field.sub |
Nested field access |
.[0] |
Array index (0-based) |
.[-1] |
Negative index (from end) |
.[] |
Iterate all elements |
where .field == value |
Filter with comparison (==, !=, >, <, >=, <=) |
where .field contains "str" |
Filter with string operators (contains, starts_with, ends_with) |
select .field1, .field2 |
Select specific fields |
sort .field / sort .field desc |
Sort by field (ascending/descending) |
limit N |
Limit number of results |
| |
Pipeline chaining (pass results between operations) |
# Advanced query examples
# Output query results in different formats
view — Table preview
# View as table
# Limit rows
# Navigate nested data
# Select columns
stats — Data statistics
# Show overall statistics
# Navigate to nested data
# Statistics for a specific column
schema — Data structure inspection
# Show schema as a tree
# From stdin
|
diff — Compare data files
# Compare same-format files
# Cross-format comparison
# Compare nested path only
# Quiet mode (exit code: 0=same, 1=different)
&& ||
merge — Combine multiple files
# Merge JSON files
# Merge CSV files and convert to JSON
# Merge YAML configs
Comparison with Existing Tools
| Feature | dkit | jq | miller | yq |
|---|---|---|---|---|
| JSON | O | O | O | O |
| CSV/TSV | O | X | O | X |
| YAML | O | X | X | O |
| TOML | O | X | X | X |
| XML | O | X | X | O |
| MessagePack | O | X | X | X |
| Cross-format convert | O | X | Partial | Partial |
| Table output | O | X | O | X |
| Query (where/select/sort) | O | O | O | O |
| Pipeline chaining | O | O | O | X |
| Statistics | O | X | O | X |
| Schema inspection | O | X | X | X |
| File merging | O | X | O | X |
| File diff | O | X | X | X |
| Single binary | O | O | O | O |
dkit focuses on seamless conversion between all supported formats with a unified query syntax, eliminating the need for separate tools per format.
Building from Source
Contributing
Contributions are welcome! Please see the GitHub Issues for planned features and known issues.
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Commit your changes
- Push to the branch and open a Pull Request
Please ensure cargo test and cargo clippy -- -D warnings pass before submitting.