HyperDev.Text.Json.Tabular
1.0.0
dotnet add package HyperDev.Text.Json.Tabular --version 1.0.0
NuGet\Install-Package HyperDev.Text.Json.Tabular -Version 1.0.0
<PackageReference Include="HyperDev.Text.Json.Tabular" Version="1.0.0" />
<PackageVersion Include="HyperDev.Text.Json.Tabular" Version="1.0.0" />
<PackageReference Include="HyperDev.Text.Json.Tabular" />
paket add HyperDev.Text.Json.Tabular --version 1.0.0
#r "nuget: HyperDev.Text.Json.Tabular, 1.0.0"
#:package HyperDev.Text.Json.Tabular@1.0.0
#addin nuget:?package=HyperDev.Text.Json.Tabular&version=1.0.0
#tool nuget:?package=HyperDev.Text.Json.Tabular&version=1.0.0
HyperDev.Text.Json.Tabular
JSON described by a JSON Schema to and from tabular files (CSV, Excel) and JSON Lines, part of the HyperDev Fatum framework. The schema drives everything: the columns, their names, types and formats, how the lists of an item are written on more rows, and the checks of what is read.
- Default model from the schema: one sheet, one row per record, the shortest unique column names, Excel with colours per level, typed cells, lists of values and input messages.
- Reading in streaming: the header first (unknown, ambiguous or repeated columns), then one item at a time with its rows and its problems (row, column, stable code, message in English or Italian).
- Mappings for files of other systems: a JSON document (
TabularMapping) that says how a flat file becomes the JSON and back: the type column and its codes, repeated rows with a key per level, the column of each field, formats, decimal separators, codes → values, constants. The same mapping reads and writes. - Recognition: which shape of the default model a file was written with.
- Examples: items made up from the schema (
examples,enum, formats), to show how the data will look.
Targets .NET 8 and .NET 10. Excel is read and written with the Open XML SDK, in streaming (no whole workbook in memory).
The format
One sheet, one row per record. The first column # is the type of the record: empty for the root (a new item), the
path of a list otherwise. A record of a list belongs to the last record of the level above. All the columns of all the
levels are in the header, with the shortest name that identifies them; on each row only the columns of its type are
read.
#;id;submitted;taxCode;relation;year;amount
;D-0001;2026-11-05;;;;
members;;;RSSMRA80A01H501U;applicant;;
members.incomes;;;;;2024;21300.5
members.incomes;;;;;2025;22100
;D-0002;2026-11-06;;;;
Without lists there is no # column: a plain table, one item per row. An empty cell is absent, null is JSON null,
"" an empty string. Dates are written yyyy-mm-dd, numbers with the decimal point.
Writing
using HyperDev.Text.Json.Schema;
using HyperDev.Text.Json.Tabular;
var layout = TabularLayout.From(JsonSchema.Parse(schemaText));
using var file = File.Create("data.xlsx");
using var writer = new TabularWriter(new ExcelTabularSink(file, new ExcelOptions { SheetName = "Data" }), layout);
writer.Begin(); // the header (also for a file without items)
foreach (var item in items) // JObject, one per item
writer.Write(item);
writer.Complete();
CsvTabularSink (separator ; by default) writes the same rows as CSV; ExcelOptions sets the sheet, the palette or
a colour per column (ColorOf), a sheet of instructions and the input messages of the columns.
Reading
using var reader = new TabularReader(new ExcelTabularSource(File.OpenRead("filled.xlsx")), layout);
var headerProblems = reader.ReadHeader(); // before reading the data
foreach (var item in reader.ReadItems()) // one item per root record, in streaming
{
// item.Value: the JSON (validate it with the schema); item.FirstRow, item.LastRow; item.Problems
}
CsvTabularSource detects the separator; JsonLinesReader / JsonLinesWriter read and write one JSON object per
line.
Mappings
var mapping = TabularMapping.Parse(File.ReadAllText("mapping.json")); // schema: TabularMapping.DocumentSchema
var issues = mapping.Validate(layout); // errors, warnings, infos
using var reader = new TabularReader(new CsvTabularSource(input), layout, mapping);
using var writer = new TabularWriter(new CsvTabularSink(output), layout, mapping);
The default model is a mapping too, with choices:
var options = new TabularModelOptions
{
Mode = TabularRecordMode.TypeColumn, // or Single (no lists), Repeated (a key per level)
Exclude = ["input"], // fields, objects or lists left out (Include: only these)
PathNames = false // true: the whole paths as headers
};
var model = TabularMapping.FromLayout(layout, options);
var shapes = TabularMapping.Modes(layout, options); // the shapes that fit, and why the others do not
Recognition and examples
// the shapes of the default model tried on a file, the best first (Recommended when it adheres)
var candidates = TabularRecognizer.Recognize(layout, () => new CsvTabularSource(File.OpenRead("file.csv")));
// items made up from the schema
var examples = TabularExample.Generate(layout);
Related packages
HyperDev.Text.Json.Tabular.Editor: the server side of the tabular mapping editor (@wemake4u/json-tabular-editor).HyperDev.Text.Json.Tabular.Editor.AspNetCore: its web endpoints.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- DocumentFormat.OpenXml (>= 3.3.0)
- HyperDev.Text.Json.Schema (>= 1.2.0)
- Newtonsoft.Json (>= 13.0.4)
-
net8.0
- DocumentFormat.OpenXml (>= 3.3.0)
- HyperDev.Text.Json.Schema (>= 1.2.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on HyperDev.Text.Json.Tabular:
| Package | Downloads |
|---|---|
|
HyperDev.Text.Json.Tabular.Editor
HyperDev Fatum Framework: the server side of the tabular mapping editor (@wemake4u/json-tabular-editor): sample files, proposals, checks and previews. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 66 | 11/27/2026 |