OpenStandardLibrary 1.0.2
dotnet add package OpenStandardLibrary --version 1.0.2
NuGet\Install-Package OpenStandardLibrary -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenStandardLibrary" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenStandardLibrary" Version="1.0.2" />
<PackageReference Include="OpenStandardLibrary" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenStandardLibrary --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenStandardLibrary, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenStandardLibrary@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenStandardLibrary&version=1.0.2
#tool nuget:?package=OpenStandardLibrary&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Open Standard Library
A .NET library for reading and creating spreadsheet files in ODS, XLSX, and delimited formats (CSV, TSV, pipe-delimited). No external dependencies — just pure .NET.
Supported Formats
| Format | Generate | Import |
|---|---|---|
| ODS (OpenDocument Spreadsheet) | Yes | Yes |
| XLSX (Office Open XML) | Yes | Yes |
| Delimited (comma, tab, pipe, ASCII) | Yes | Yes |
Features
- Multi-sheet workbooks — create and import workbooks with multiple named sheets
- Cell value types — String, Float, Boolean, DateTime, and Int64
- Cell styling — bold, italic, underline, font color/name/size, background color, borders (thin/medium/thick with color per edge), and text wrapping
- Column widths — manual
SetColumnWidth()or automaticAutoFitColumns()with min/max constraints - Freeze panes — freeze rows and/or columns with
FreezeRowsandFreezeColumns - Auto-filters —
SetAutoFilter()for the full range or a custom range - Header row detection —
HasHeaderRow,HeaderNames, andGetColumn(string)for column-name-based access. Auto-detected on XLSX/ODS import when freeze panes or auto-filters are present - Streaming CSV reader —
ReadCsvRowsAsync()reads rows one at a time viaIAsyncEnumerablewith optional header detection and row limit - File encoding options — UTF-8 (default), ASCII, Unicode (UTF-16), and UTF-32 for delimited files
- Epoch conversion —
FromEpochSeconds(),FromEpochMilliseconds(),ToEpochSeconds(),ToEpochMilliseconds()extension methods on cells - Formulas — set formula expressions on cells
- Dependency injection — implements
ISpreadsheetwithIDisposable/IAsyncDisposable
Installation
dotnet add package OpenStandardLibrary
Quick Start
Generate an XLSX file
using OoxSpreadsheet;
using OslSpreadsheet.Models;
using var spreadsheet = new Spreadsheet();
var sheet = spreadsheet.Workbook.AddSheet("Data");
sheet.AddCell(1, 1, "Name");
sheet.AddCell(1, 2, "Score");
sheet.AddCell(2, 1, "Alice");
sheet.AddCell(2, 2, "95.5", CellValueType.Float);
var bytes = await spreadsheet.GenerateXlsxFileAsync();
await File.WriteAllBytesAsync("output.xlsx", bytes);
Import and read by column name
using var spreadsheet = new Spreadsheet();
var workbook = await spreadsheet.ImportXlsxFileAsync(File.ReadAllBytes("input.xlsx"));
var sheet = workbook.Sheets[0];
// HasHeaderRow is auto-detected from freeze panes or auto-filters
if (sheet.HasHeaderRow)
{
var names = sheet.GetColumn("Name");
foreach (var cell in names)
Console.WriteLine(cell.Value);
}
Stream CSV rows
using var spreadsheet = new Spreadsheet();
using var stream = File.OpenRead("large-file.csv");
await foreach (var row in spreadsheet.ReadCsvRowsAsync(stream, hasHeaderRow: true, rowLimit: 100))
{
Console.WriteLine(string.Join(", ", row));
}
// Headers are available after iteration
Console.WriteLine($"Columns: {string.Join(", ", spreadsheet.CsvHeaders!)}");
Cell styling
var cell = sheet.AddCell(1, 1, "Header");
cell.Style = new CellStyle
{
Bold = true,
FontColor = "#FFFFFF",
BackgroundColor = "#2196F3",
BorderBottom = new CellBorder { Style = BorderStyle.Medium, Color = "#1565C0" },
WrapText = true
};
Epoch conversion
var cell = sheet.AddCell(1, 1, "1747650600");
cell.FromEpochSeconds(); // Value becomes "2025-05-19T10:30:00", ValueType becomes DateTime
// Or convert back
cell.ToEpochSeconds(); // Value becomes "1747650600", ValueType becomes Int64
Supported Frameworks
- .NET 8.0
- .NET 9.0
- .NET 10.0
Disclaimer
This software is provided "as is", without warranty of any kind. Use at your own risk. See the LICENSE file for full terms.
License
MIT
| 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.