TheDataCity.Utilities
1.0.31
dotnet add package TheDataCity.Utilities --version 1.0.31
NuGet\Install-Package TheDataCity.Utilities -Version 1.0.31
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="TheDataCity.Utilities" Version="1.0.31" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TheDataCity.Utilities" Version="1.0.31" />
<PackageReference Include="TheDataCity.Utilities" />
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 TheDataCity.Utilities --version 1.0.31
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TheDataCity.Utilities, 1.0.31"
#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 TheDataCity.Utilities@1.0.31
#: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=TheDataCity.Utilities&version=1.0.31
#tool nuget:?package=TheDataCity.Utilities&version=1.0.31
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TheDataCity.Utilities
A .NET utilities library providing structured logging, timing helpers, string utilities, company web-text cleaning, and DuckDB table definition generation.
Installation
dotnet add package TheDataCity.Utilities
Or via Package Manager Console:
Install-Package TheDataCity.Utilities
Quick Start
Logging
using TheDataCity.Utilities;
// Initialize logger once at startup
Log.InitialiseWithConsole("MyApp");
// Use Log
Log.Info("Processing started");
Log.Info("Processed {Count} items", itemCount);
Log.Error("Something went wrong");
Log.Warning("This is a warning");
Log.Debug("Debug information");
Timing Operations
using TheDataCity.Utilities;
// Automatic timing with using statement
using (new TimingHelper("Processing data"))
{
// Your code here
// Automatically logs completion time when disposed
}
// Or use the static Timing class
var (result, elapsed) = Timing.TimeOperation("Calculate result", () => {
return PerformCalculation();
});
String Utilities
using TheDataCity.Utilities;
// Get first word from a string
string firstWord = StringUtilities.GetFirstWord("Hello World"); // "Hello"
// Normalise website URLs
string normalised = StringUtilities.NormaliseWebsite("https://www.example.com/"); // "example.com"
// Normalise company names (period / ampersand spacing)
string normalised = StringUtilities.NormaliseCompanyName("A.B.C. & Co."); // "ABC & Co"
// SearchName / name-filter needle (drop punctuation except &, collapse spaces)
string searchName = StringUtilities.NormaliseSearchName("Reno's of Wise, LLC").ToUpperInvariant(); // "RENOS OF WISE LLC"
Company web-text cleaning
using TheDataCity.Utilities;
(string? cleaned, CleaningStats stats) = CompanyTextCleaner.CleanText(rawWebText);
string status = CompanyTextCleaner.QualityStatusName(stats.QualityStatus);
CompanyTextCleaner is the canonical C# cleaner for company website text (boilerplate strip, foreign-char strip, paragraph/sentence dedup, n-gram phrase dedup, quality classification). Prefer this package over local copies.
DuckDB Table Generation
using TheDataCity.Utilities.Attributes.DuckDB;
using TheDataCity.Utilities.DuckDB;
[TableName("custom_table_name")]
public class MyModel
{
[ColumnName("id")]
[NotNull]
public int Id { get; set; }
[DuckDBType("VARCHAR")]
public string Name { get; set; }
[ExcludeFromTable]
public string IgnoredProperty { get; set; }
}
// Generate CREATE TABLE statement
string createTableSql = TableDefinitionGenerator.GenerateCreateTable<MyModel>();
Features
- Structured Logging - Source-generated logging using .NET ILogger with automatic timestamp formatting
- Timing Helpers - Automatic timing and logging of code blocks with intelligent operation name transformation
- String Utilities - String manipulation and normalisation methods for common use cases
- Company Web-Text Cleaning - Shared
CompanyTextCleanerfor pipeline web-text cleaning - DuckDB Integration - Generate DuckDB table definitions from C# models with customisable attributes
Requirements
- .NET 10.0 or later
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Dapper (>= 2.1.79)
- DuckDB.NET.Data.Full (>= 1.4.4)
- K4os.Compression.LZ4 (>= 1.3.8)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Console (>= 10.0.10)
-
net9.0
- Dapper (>= 2.1.79)
- DuckDB.NET.Data.Full (>= 1.4.4)
- K4os.Compression.LZ4 (>= 1.3.8)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Console (>= 10.0.10)
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.31 | 992 | 8/3/2026 |
| 1.0.30 | 411 | 7/31/2026 |
| 1.0.29 | 241 | 7/29/2026 |
| 1.0.28 | 289 | 7/29/2026 |
| 1.0.27 | 212 | 7/24/2026 |
| 1.0.26 | 4,169 | 3/23/2026 |
| 1.0.25 | 991 | 3/2/2026 |
| 1.0.24 | 668 | 2/23/2026 |
| 1.0.23 | 970 | 1/29/2026 |
| 1.0.22 | 476 | 1/28/2026 |
| 1.0.21 | 268 | 1/22/2026 |
| 1.0.20 | 134 | 1/22/2026 |
| 1.0.19 | 129 | 1/22/2026 |
| 1.0.18 | 126 | 1/22/2026 |
| 1.0.17 | 131 | 1/22/2026 |
| 1.0.16 | 155 | 1/21/2026 |
| 1.0.15 | 116 | 1/20/2026 |
| 1.0.14 | 141 | 1/20/2026 |
| 1.0.13 | 118 | 1/20/2026 |
| 1.0.12 | 205 | 1/8/2026 |
Loading failed