KustoLoco.UserAgent 1.4.8

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

KustoLoco.UserAgent

An optional user-agent parser for KustoLoco's parse_user_agent() function.

KustoLoco's core engine implements parse_user_agent() natively but ships no user-agent dataset — the function reads from an IUserAgentParser that the host registers. This package is one such provider, backed by the canonical ua-parser / uap-core dataset (regexes.yaml, Apache-2.0), which is embedded in the assembly. The parsing cascade is an original, dependency-free implementation of the uap-core specification.

Usage

using KustoLoco.Core;
using KustoLoco.UserAgent;

var context = new KustoQueryContext();
context.AddProvider<IUserAgentParser>(UapUserAgentParser.Default);

var result = await context.RunQuery(
    "print ua = parse_user_agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
    "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36')");

UapUserAgentParser.Default is a shared, immutable instance built from the embedded dataset, safe to reuse across concurrent queries. You can also construct one from a newer regexes.yaml stream via new UapUserAgentParser(stream).

Output shape

parse_user_agent() returns a dynamic object with the uap-core structure:

{
  "Browser":         { "Family": "...", "Major": "...", "Minor": "...", "Patch": "..." },
  "OperatingSystem": { "Family": "...", "Major": "...", "Minor": "...", "Patch": "...", "PatchMinor": "..." },
  "Device":          { "Family": "...", "Brand": "...", "Model": "..." }
}

Unmatched components resolve to Family: "Other", exactly as uap-core specifies.

Attribution

The embedded dataset is © the ua-parser contributors, licensed Apache-2.0. See NOTICE.

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

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.4.8 122 9/6/2026