NPipeline.StorageProviders 0.16.0

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

NPipeline.StorageProviders

Core storage provider abstractions for NPipeline connectors, enabling unified access to filesystems, cloud storage, and custom backends through a common interface.

Overview

NPipeline.StorageProviders provides the foundational abstractions that all NPipeline connectors depend on for storage operations. This separation allows connectors to work with any storage backend without code changes.

Key Features

  • Unified Storage Interface: Single IStorageProvider interface for read, write, list, and metadata operations
  • URI-Based Resolution: StorageUri class normalizes storage locations across different backends
  • Provider Discovery: IStorageResolver discovers appropriate providers for given URIs
  • Thread-Safe Factory: StorageProviderFactory creates resolvers with error collection
  • Extensible Design: Implement custom providers for specialized storage systems

Installation

<PackageReference Include="NPipeline.StorageProviders" Version="*" />

Or via .NET CLI:

dotnet add package NPipeline.StorageProviders

Core Components

IStorageProvider

Primary interface defining storage operations:

  • OpenReadAsync: Open stream for reading
  • OpenWriteAsync: Open stream for writing
  • ListAsync: Enumerate items in a location
  • GetMetadataAsync: Retrieve file metadata
  • ExistsAsync: Check if an item exists
  • DeleteAsync: Remove an item (optional)

StorageUri

Represents storage locations with scheme-based routing:

// Local file
var fileUri = StorageUri.Parse("file:///path/to/data.csv");

// Cloud storage (requires provider implementation)
var s3Uri = StorageUri.Parse("s3://bucket/key.csv");

// Custom scheme
var customUri = StorageUri.Parse("custom://location/data.csv");

StorageResolver

Resolves providers based on URI scheme:

var resolver = StorageProviderFactory.CreateResolver(
    new StorageResolverOptions
    {
        IncludeFileSystem = true
    }
);

var provider = resolver.ResolveProvider(uri);

Usage Patterns

Basic File Operations

using NPipeline.StorageProviders;

var resolver = StorageProviderFactory.CreateResolver();
var uri = StorageUri.FromFilePath("./data.csv");
var provider = resolver.ResolveProvider(uri)
    ?? throw new InvalidOperationException("No provider registered for the URI scheme.");

// Check existence
bool exists = await provider.ExistsAsync(uri);

// Read stream
await using var stream = await provider.OpenReadAsync(uri);

// Write stream
await using var writeStream = await provider.OpenWriteAsync(uri);

Custom Provider Registration

using NPipeline.StorageProviders;

var resolver = new StorageResolver();
resolver.RegisterProvider(new CustomStorageProvider());

var provider = resolver.ResolveProvider(customUri);

Error Collection

var (resolver, errors) = StorageProviderFactory.CreateResolverWithErrors(
    new StorageResolverOptions { CollectErrors = true }
);

if (errors.Count > 0)
{
    foreach (var (name, details) in errors)
    {
        Console.WriteLine($"{name}: {string.Join(", ", details)}");
    }
}

Configuration

StorageResolverOptions

Controls resolver behavior:

  • IncludeFileSystem: Include built-in filesystem provider
  • Configuration: Provider configuration from app settings
  • AdditionalProviders: Custom provider instances
  • CollectErrors: Capture provider creation errors

ConnectorConfiguration

Defines provider settings for application configuration:

var config = new ConnectorConfiguration
{
    Providers = new Dictionary<string, StorageProviderConfig>
    {
        ["S3"] = new StorageProviderConfig
        {
            ProviderType = "S3StorageProvider",
            Enabled = true,
            Settings = new Dictionary<string, string>
            {
                ["Region"] = "us-east-1"
            }
        }
    }
};

Architecture

The storage provider system follows dependency inversion principles:

  1. Abstractions Layer: Interfaces and models in NPipeline.StorageProviders
  2. Implementation Layer: Concrete providers (FileSystem, S3, etc.)
  3. Connector Layer: Connectors depend only on abstractions

This design enables:

  • Swapping storage backends without connector changes
  • Testing connectors with mock providers
  • Adding new storage systems without modifying existing code

Thread Safety

  • StorageResolver: Thread-safe registration and resolution
  • StorageProviderRegistry: Thread-safe alias registration
  • StorageProviderFactory: Static methods, stateless

Supported Providers

Documentation

License

Part of the NPipeline project. See main project LICENSE file for details.

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 (11)

Showing the top 5 NuGet packages that depend on NPipeline.StorageProviders:

Package Downloads
NPipeline.Connectors

Extensible storage abstraction layer for NPipeline - supports pluggable storage providers (file system, cloud storage, etc.)

NPipeline.Connectors.Csv

CSV source and sink nodes for NPipeline using CsvHelper - read and write CSV files with configurable options

NPipeline.Connectors.Excel

Excel source and sink nodes for NPipeline using ExcelDataReader - read and write Excel files (XLS, XLSX) with configurable options

NPipeline.Connectors.PostgreSQL

PostgreSQL source and sink nodes for NPipeline using Npgsql - read from and write to PostgreSQL databases with configurable options

NPipeline.Connectors.SqlServer

SQL Server source and sink nodes for NPipeline using Microsoft.Data.SqlClient - read from and write to SQL Server databases with configurable options

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.16.0 0 2/24/2026
0.15.0 74 2/19/2026
0.14.0 197 2/17/2026
0.13.1 211 2/13/2026
0.13.0 218 2/13/2026
0.12.0 209 2/9/2026
0.11.0 207 2/8/2026
0.10.0 194 2/6/2026
0.9.1 177 2/5/2026
0.9.0 183 2/5/2026