robbiblubber.org
EN
Projects
Collection.NETMIT

Util.NET.

Robbiblubber.Util.NET

Tools for practical .NET tasks: console progress indicators, a common file API for local and remote storage, and PDF text extraction with OCR. rush and PdfText CLI bring these libraries to the command line.

.NET 8.NET 10

Tools

2
Tool

rush

Robbiblubber.Util.FileStorageAdapters.Shell

One shell for multiple filesystems: attach local directories, FTP/FTPS, SSH/SFTP, and SharePoint Online as named storage locations, then use the same commands interactively or in scripts.

Deploy the required adapter libraries with the shellTarget frameworks: net8.0 / net10.0
Tool

PdfText CLI

Robbiblubber.Util.PdfText.Cli

PdfText on the command line: xpdf reads a PDF and writes its extracted text to a text file, with an OCR fallback for scanned pages.

Native runtime libraries and the required Tesseract language dataTarget frameworks: net8.0

Libraries & extensions

7

The libraries are available as separate NuGet packages. Install the building blocks your project needs.

Library

Robbiblubber.Util.ConsoleToolkit

Progress bars and animated spinners for console applications, with status messages, colours, and customisable appearance.

Interactive terminalTarget frameworks: net8.0 / net10.0

What’s inside

  • ConsoleProgressBar displays progress between a minimum and maximum.
  • ConsoleSpinner accompanies tasks with an unknown total duration.
  • Customisable messages, colours, bar width, and spinner frames; no additional package dependencies.
A small starting point C#
using Robbiblubber.Util.ConsoleToolkit;

ConsoleProgressBar bar = new() { BarSize = 30, Text = "Processing..." };
bar.Show();
for (int i = 1; i <= 100; i++)
{
    await Task.Delay(25);
    bar.Value = i;
}
bar.Text = "Done.";
bar.Finish();

The example reaches 100% before Finish() completes the display.

Installation
dotnet add package Robbiblubber.Util.ConsoleToolkit
Library

Robbiblubber.Util.FileStorageAdapters

A common API for files and directories: local storage, FTP/FTPS and SSH/SFTP servers, or SharePoint Online. Copy and move operations also work across adapters.

For .NET applicationsTarget frameworks: net8.0 / net10.0

What’s inside

  • IAdapter, IDirectory, and IFile form the common model; storage providers are added separately.
  • List, read, write, create, delete, and filter using asynchronous APIs and CancellationToken.
  • Cross-adapter file transfers and recursive directory copies. Moving between adapters copies first, then deletes the source.
  • Interfaces and base classes support custom adapters; rush uses the same model.
A small starting point C#
using Robbiblubber.Util.FileStorageAdapters;

static async Task CopyReportAsync(IAdapter sourceAdapter, IAdapter targetAdapter)
{
    IDirectory source = sourceAdapter.OpenDirectory("/documents");
    IDirectory target = targetAdapter.OpenDirectory("/incoming");
    IFile file = await source.GetFileAsync("report.pdf");
    await file.CopyToAsync(target, "report.pdf", overwrite: true);
}

With initialised adapters and existing directories: the same transfer code for different storage systems.

Installation
dotnet add package Robbiblubber.Util.FileStorageAdapters
Adapter

Robbiblubber.Util.FileStorageAdapters.Ftp

Use FTP and FTPS as file storage, including encrypted connections with explicit or implicit TLS.

FTP/FTPS server and credentialsTarget frameworks: net8.0 / net10.0

What’s inside

  • FtpAdapter integrates FTP with IAdapter, IDirectory, and IFile.
  • Configure TLS, active or passive data connections, timeouts, and certificate validation.
  • Transfer files to local and other remote storage. SFTP is provided by the separate SSH/SFTP adapter.
A small starting point C#
using Robbiblubber.Util.FileStorageAdapters;
using Robbiblubber.Util.FileStorageAdapters.Ftp;

FtpAdapterOptions options = new() { Security = FtpSecurity.EXPLICIT_TLS };
using FtpAdapter adapter = new(
    "ftp.example.org", 21, "username", "password", options);
IDirectory directory = adapter.OpenDirectory("/incoming");

Example using explicit TLS. Replace the server, credentials, and existing directory.

Installation
dotnet add package Robbiblubber.Util.FileStorageAdapters.Ftp
Adapter

Robbiblubber.Util.FileStorageAdapters.LocalFileSystem

Access the local filesystem through the same interfaces as remote storage, using LfsAdapter for files and directories on the computer.

Local filesystem and appropriate access permissionsTarget frameworks: net8.0 / net10.0

What’s inside

  • LfsAdapter connects native local paths to the common file model.
  • Read, write, and list files and directories, and transfer them to other adapters.
  • Uses the running process’s permissions and the operating system’s path conventions.
A small starting point C#
using Robbiblubber.Util.FileStorageAdapters;
using Robbiblubber.Util.FileStorageAdapters.LocalFileSystem;

IDirectory directory = LfsAdapter.Open("C:/Data");
IFile file = await directory.GetFileAsync("report.pdf");
using Stream stream = await file.ReadAsync();

C:/Data and report.pdf must exist. On Linux, use a path such as /var/data.

Installation
dotnet add package Robbiblubber.Util.FileStorageAdapters.LocalFileSystem
Adapter

Robbiblubber.Util.FileStorageAdapters.SharePoint

Access SharePoint Online document libraries as file storage through Microsoft Graph, working with files and folders rather than SharePoint lists.

SharePoint Online and an appropriately authorised Entra applicationTarget frameworks: net8.0 / net10.0

What’s inside

  • A document library becomes the logical root, selected through a site URL, site ID, or drive ID.
  • Interactive sign-in, device code, and application authentication with a secret, certificate, or managed identity.
  • List and transfer files and folders; upload sessions support large uploads.
A small starting point C#
using Robbiblubber.Util.FileStorageAdapters;
using Robbiblubber.Util.FileStorageAdapters.SharePoint;

SharePointTarget target = SharePointTarget.FromSiteUrl(
    "https://tenant.sharepoint.com/sites/project", libraryName: "Documents");
using SharePointAdapter adapter = SharePointAdapter.CreateInteractive(
    target, tenantId: "TENANT-ID", clientId: "APPLICATION-ID");
IDirectory directory = adapter.OpenDirectory("/reports");

Requires a configured Entra app with suitable permissions. Replace the IDs, library name, and directory.

Installation
dotnet add package Robbiblubber.Util.FileStorageAdapters.SharePoint
Adapter

Robbiblubber.Util.FileStorageAdapters.Ssh

Two access methods in one package: SshAdapter uses remote POSIX shell commands, while SftpAdapter uses the SFTP protocol.

SSH: POSIX/GNU tools; SFTP: SFTP subsystemTarget frameworks: net8.0 / net10.0

What’s inside

  • Both adapters use the common file and directory model.
  • Authenticate with a password or private key; verify server host keys using a fingerprint.
  • SFTP does not require a remote shell. The SSH adapter requires appropriate shell and GNU tools on the server.
A small starting point C#
using Robbiblubber.Util.FileStorageAdapters;
using Robbiblubber.Util.FileStorageAdapters.Ssh;

SftpAdapterOptions options = new()
{
    HostKeyFingerprint = "SHA256:replace-with-verified-fingerprint"
};
using SftpAdapter adapter = new(
    "server.example.org", 22, "username", "password", options);
IDirectory directory = adapter.OpenDirectory("/srv/data");

Replace the credentials and path; verify the server fingerprint beforehand and supply it here.

Installation
dotnet add package Robbiblubber.Util.FileStorageAdapters.Ssh
Library

Robbiblubber.Util.PdfText

Extract text from digital and scanned PDFs: direct text extraction with PdfPig, a Tesseract OCR fallback, and structured table output.

Native runtime libraries and Tesseract language data for OCRTarget frameworks: net8.0 / net10.0

What’s inside

  • Use embedded PDF text and fall back to OCR for scanned pages.
  • Layout-oriented text or structured tables, with Markdown or TSV output.
  • Configurable OCR languages, image preprocessing, page orientation, and parallel page processing.
  • For OCR, also reference the Tesseract NuGet package directly and provide the required traineddata files.
A small starting point C#
using Robbiblubber.Util.PdfText;

PdfTextExtractor.Options options = new() { Languages = "eng+deu" };
using PdfTextExtractor extractor = new(options);
PdfTextExtractor.Result result = await extractor.GetResultAsync("input.pdf");
await File.WriteAllTextAsync("output.txt", result.Text);

This example needs English and German Tesseract language data; the data directory is configurable through TessDataPath.

Installation
dotnet add package Robbiblubber.Util.PdfText

The .NET libraries are distributed through NuGet. Tools and libraries remain grouped in their suites and collections.

View all projects