Talaan 0.2.0
See the version list below for details.
dotnet add package Talaan --version 0.2.0
NuGet\Install-Package Talaan -Version 0.2.0
<PackageReference Include="Talaan" Version="0.2.0" />
<PackageVersion Include="Talaan" Version="0.2.0" />
<PackageReference Include="Talaan" />
paket add Talaan --version 0.2.0
#r "nuget: Talaan, 0.2.0"
#:package Talaan@0.2.0
#addin nuget:?package=Talaan&version=0.2.0
#tool nuget:?package=Talaan&version=0.2.0
<div align="center"> <img src="https://raw.githubusercontent.com/BaryoDev/Talaan/master/assets/icon.png" width="96" height="96" alt="Talaan logo" /> <h1>Talaan</h1> <p><em>A zero-dependency spreadsheet & CSV reader for .NET.</em></p> </div>
Talaan (Filipino for record / list / table) reads .xlsx and CSV files into a simple, typed
cell grid, with no external dependencies. No Excel Interop, no ClosedXML, no OpenXML SDK. An
.xlsx is just a zip of XML, and Talaan walks those parts directly using only the .NET base class
library (System.IO.Compression + System.Xml).
Why
- Zero dependencies. Nothing to audit, nothing to update, no transitive surprises. One small assembly.
- Typed cells. Numbers come back as numbers, dates as
DateTime, booleans asbool, not stringly-typed guesses. Excel serial dates and shared strings are resolved for you. - Raw grid, no magic. Talaan hands you the sheet exactly as laid out. You decide which row is the header and which rows to skip, which suits real-world files with title rows, sections, and blanks.
Install
dotnet add package Talaan
Quick start
using Talaan;
// From a file…
SheetData sheet = Spreadsheet.ReadFile("members.xlsx");
// …or a stream (an upload, say), dispatched by file name:
SheetData sheet = Spreadsheet.Read(uploadStream, fileName);
for (int r = 0; r < sheet.RowCount; r++)
{
CellValue name = sheet.At(r, 1); // row r, column B
if (name.Kind == CellKind.Text)
Console.WriteLine(name.Text);
}
Every cell is a CellValue:
public readonly record struct CellValue(
CellKind Kind, // Empty | Text | Number | Date | Boolean
string? Text,
double? Number,
DateTime? Date,
bool? Boolean);
cell.IsBlank // empty, or whitespace-only text
cell.AsString() // best-effort display: invariant numbers, ISO-8601 dates
Supported formats
| Format | Extension | Notes |
|---|---|---|
| Excel | .xlsx |
First worksheet. Shared strings, inline strings, booleans, numbers, and style-based date detection. |
| CSV | .csv, .txt |
RFC-4180: quoted fields, escaped "", embedded commas and newlines. |
| TSV | .tsv |
Tab-delimited. |
You can also bypass detection: Spreadsheet.Read(stream, SpreadsheetFormat.Xlsx).
Reading a CSV in a non-UTF-8 encoding
CSV defaults to UTF-8. A file exported by "Excel on Windows > CSV (Comma delimited)" is usually Windows-1252 with no byte-order mark, so it needs an explicit encoding:
using System.Text;
// Code page 1252 needs the CodePages package, which Talaan does not depend on:
// dotnet add package System.Text.Encoding.CodePages
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
SheetData sheet = Spreadsheet.ReadFile("members.csv", Encoding.GetEncoding(1252));
Encoding.Latin1 is built in and works without the package, but it is not the same as 1252:
bytes 0x80 to 0x9F (the euro sign, curly quotes, dashes) come back as control characters.
CsvReader.Read(stream, encoding) takes the same encoding for CSV/TSV without going through
Spreadsheet.
Design notes
- Dates.
.xlsxstores dates as serial numbers; Talaan inspects the workbook stylesheet (cellXfsto number format) to decide whether a numeric cell is a date, then converts via the OLE Automation epoch. Ambiguousm(month vs. minute) is ignored in favour of unambiguousy/d. - Column alignment. Cell references (
A1,AB12) are honoured, so skipped/blank cells becomeCellValue.Emptyand columns stay aligned. - Streaming input. Non-seekable streams are buffered automatically for zip access.
Scope (by design)
Talaan reads; it does not write. It reads the first worksheet. Formulas are returned by their last cached result. If you need multi-sheet, writing, or styling, this isn't that library, and that is the point.
License
MPL-2.0 © BaryoDev
| 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Talaan:
| Package | Downloads |
|---|---|
|
BarakoCMS.Import
Optional bulk-import module for barakoCMS: analyze .xlsx/CSV uploads and bulk-create content. Zero-dependency parsing via Talaan. |
GitHub repositories
This package is not used by any popular GitHub repositories.
0.2.0
Behaviour changes:
- An unterminated quoted field in CSV now throws InvalidDataException instead of reading to the end of the file.
- Any malformed or DTD-bearing XML part in an .xlsx now throws InvalidDataException naming the part, with the XmlException as InnerException. Catch InvalidDataException for any bad file.
- Cell references past column XFD and row numbers past 1048576 throw InvalidDataException.
Fixes:
- DTD processing is prohibited on every workbook XML part (entity expansion and external entities).
- Rows missing from sheetData no longer shift later rows up.
- Workbooks using the 1904 date system no longer read dates 1462 days early.
- Phonetic runs (rPh) are no longer added to string text.
- CsvReader.Read leaves the caller's stream open.
- CellValue.AsString keeps the time for dates that have one.
New:
- Encoding overloads for CSV: CsvReader.Read(Stream, Encoding, char), Spreadsheet.Read(Stream, SpreadsheetFormat, Encoding) and Spreadsheet.ReadFile(string, Encoding).
- The package links the repository and ships the readme, icon and symbols.