oryx-parser
v0.2.1
Published
Optimized Representation for Yielding eXpression (ORYX) parser
Maintainers
Readme
ORYX
Optimized Representation for Yielding eXpression
ORYX is a compact, token-efficient data format designed specifically for Large Language Models (LLMs). It combines the structure of JSON with the density of CSV and the readability of YAML.
🚀 Why ORYX?
- Token Efficiency: Reduces token usage by 20-40% compared to JSON.
- LLM Native: Designed with delimiters and structures that LLMs understand intuitively.
- Tabular Support: Native support for compact tables, perfect for lists of objects.
- Type Inference: Smart type detection without excessive quoting.
📦 Installation
npm install oryx-parser🛠 Usage
Manual (Copy-Paste for LLMs)
Write ORYX directly into your prompts:
products[2]{name,price}:
Laptop, 1500
Mouse, 25Programmatic (TypeScript)
import { parse, encode } from 'oryx-parser';
// Parse ORYX to JSON
const oryxData = `
users[2]{id,name,role}:
1, Alice, admin
2, Bob, user
`;
const json = parse(oryxData);
console.log(json);
// Output: { users: [ {id:1, name:"Alice", role:"admin"}, {id:2, name:"Bob", role:"user"} ] }
// Encode JSON to ORYX
const data = {
user: { name: "Alice", age: 30 }
};
const oryx = encode(data);
console.log(oryx);
// Output: user:\n name: Alice\n age: 30📚 Documentation
🗺 Roadmap
- [x] Phase 1: Initial Spec & Prototype
- [ ] Phase 2: Repository Construction & Core Packages (Current)
- [ ] Phase 3: Ecosystem (CLI, VSCode Extension, Multi-language support)
📄 License
MIT
