Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Neumenon/cowrie/llms.txt
Use this file to discover all available pages before exploring further.
Cowrie Binary Codec
High-performance binary JSON serialization with native support for ML types, graph data structures, and multi-language SDKs
Quick start
Get up and running with Cowrie in minutes
Install the library
Choose your language and install Cowrie using your package manager:go get github.com/Neumenon/cowrie
Import and encode data
Import the codec and encode your first message: Go
Python
Rust
TypeScript
import "github.com/Neumenon/cowrie/gen1"
data, err := gen1.Encode(map[string]any{
"name": "Alice",
"age": 30,
})
from cowrie import gen1
data = gen1.encode({"name": "Alice", "age": 30})
use cowrie::gen1;
let val = gen1::Value::Object(vec![
("name".to_string(), gen1::Value::String("Alice".to_string())),
]);
let data = gen1::encode(&val)?;
import { gen1 } from 'cowrie';
const data = gen1.encode({ name: 'Alice', age: 30 });
Decode and use
Decode the binary data back to your native data structures:result, err := gen1.Decode(data)
fmt.Printf("%v\n", result)
Cowrie maintains wire format compatibility across all languages, so data encoded in Go can be decoded in Python, Rust, TypeScript, or C
Explore by topic
Jump into the documentation by area of interest
Core concepts
Learn about Gen1 vs Gen2, wire formats, and type systems
Language SDKs
Explore Go, Rust, Python, TypeScript, and C implementations
Graph types
Work with nodes, edges, and graph shards for GNN workloads
ML types
Native support for tensors, images, and audio data
CLI tool
Command-line utility for encoding, decoding, and inspection
Performance
Benchmarks, optimization tips, and format comparisons
Key features
What makes Cowrie unique
Two codec variants
Gen1 for lightweight binary JSON with proto-tensors. Gen2 for full ML extensions with dictionary coding and compression
Multi-language support
Identical wire format across Go, Rust, Python, TypeScript, and C. Encode in one language, decode in another
Graph data structures
Native Node, Edge, and GraphShard types for graph neural networks and distributed graph processing
Size optimization
Gen2 dictionary coding provides ~50% size reduction for repeated schemas. Optional gzip/zstd compression
Ready to get started?
Follow our quickstart guide to encode your first message in under 5 minutes
Start building