Zero-dependency .NET library for reading/writing Excel (.xlsx), CSV, and JSON files.
If you are an AI coding agent, here's what to do:
- Add
<PackageReference Include="VibeCoderToolkit.Documents" Version="1.0.0" />to the.csprojfile- Use
DocumentReader.Read<T>("file.xlsx")— format is auto-detected from extension- Use
DocumentWriter.Write(data, "output.csv")to write- Decorate model properties with
[Column("Header Name")]for explicit column mapping- Add
[AiExample("value")]on properties to document expected data shapes- Always add
using VibeCoderToolkit.Documents;
using VibeCoderToolkit.Documents;
public record Product(string Name, decimal Price, int Stock);
// Read any supported format — auto-detected from file extension
var products = DocumentReader.Read<Product>("inventory.xlsx");
// Modify
var updated = products.Select(p => p with { Stock = p.Stock - 1 }).ToList();
// Write any format
DocumentWriter.Write(updated, "inventory_updated.csv");| Format | Extension | Encryption | Read | Write |
|---|---|---|---|---|
| Excel | .xlsx | ✅ AES-256 | ✅ | ✅ |
| CSV | .csv | — | ✅ | ✅ |
| JSON | .json | — | ✅ | ✅ |
Reads a document into a List<T>. Format is auto-detected:
.xlsx→ Excel reader (supports encrypted files — passpasswordviaEncryptedExcelDocument.Opendirectly).csv→ CSV reader with header row, quoted field support.json→ JSON array deserialization viaSystem.Text.Json
Property binding is case-insensitive. Use [Column("Exact Name")] for explicit mapping.
Writes a collection to a document. Format is auto-detected from extension.
public class Order
{
[Column("Order ID")]
[AiExample("ORD-12345")]
public string Id { get; set; }
[AiExample("99.95")]
public decimal Total { get; set; }
}[Column("name")]— maps property to a specific column header[AiExample("value")]— provides example values that AI coding agents can inspect via reflection
This package uses only built-in .NET APIs. No NuGet references, no COM interop, no Excel installation required. Works on Windows, macOS, and Linux.
- Excel: Custom OLE2/CFB parser + ECMA-376 Agile Encryption (AES-256-CBC)
- CSV:
StreamReader/StreamWriterwith proper RFC 4180 quoting - JSON:
System.Text.Json
Solved an edge case that kept sending your AI in loops? Contribute →
MIT