SpanFlow.Connectors.Files 1.0.0

dotnet add package SpanFlow.Connectors.Files --version 1.0.0
                    
NuGet\Install-Package SpanFlow.Connectors.Files -Version 1.0.0
                    
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="SpanFlow.Connectors.Files" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpanFlow.Connectors.Files" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SpanFlow.Connectors.Files" />
                    
Project file
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 SpanFlow.Connectors.Files --version 1.0.0
                    
#r "nuget: SpanFlow.Connectors.Files, 1.0.0"
                    
#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 SpanFlow.Connectors.Files@1.0.0
                    
#: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=SpanFlow.Connectors.Files&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SpanFlow.Connectors.Files&version=1.0.0
                    
Install as a Cake Tool

SpanFlow.Connectors.Files

Reads and writes rows in common file formats, and stores files on local disk or in the cloud behind one interface. It comes from SpanFlow, where it powers the file connector.

Formats (IFileFormat): csv, tsv and other delimited text, json, ndjson, xlsx and binary. Tabular formats read into a JSON array of row objects and write one back. csv, tsv and ndjson can also stream rows one at a time without loading the whole file.

Stores (IFileStore):

  • a local folder: LocalFileStore refuses any path that leaves its root, and LocalFileRoots limits which folders may be used at all
  • Amazon S3 or any S3-compatible service
  • Azure Blob Storage
  • FTP/FTPS
using System.Text.Json.Nodes;
using SpanFlow.Connectors.Files;

var rows = new JsonArray
{
    new JsonObject { ["id"] = 1, ["name"] = "Ada" },
    new JsonObject { ["id"] = 2, ["name"] = "Grace" },
};

var store = new LocalFileStore("/srv/exports");
await using (var output = await store.OpenWriteAsync("people.csv", FileWriteMode.Overwrite, CancellationToken.None))
{
    await new CsvFormat().WriteAsync(output, rows, new JsonObject(), suppressHeader: false, CancellationToken.None);
}

// Stream the rows back one at a time.
IFileFormat csv = new CsvFormat();
await using var input = await store.OpenReadAsync("people.csv", CancellationToken.None);
await foreach (var row in csv.ReadRowsAsync(input, new JsonObject(), CancellationToken.None))
{
    Console.WriteLine(row["name"]);
}

Each cloud store's provider creates it from a JSON config, for example new S3FileStoreProvider().Create(config), so connection settings can live in your own configuration.

Targets .NET 8, 9 and 10. MIT licensed.

Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 85 11/9/2026