NugLabs 1.3.1

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

NugLabs .NET SDK

Local-first SDK for https://strains.nuglabs.co.

Current NuGet package version: 1.3.1.

Design

  • Ships with a bundled NugLabs/dataset.json
  • Loads bundled data on startup
  • Uses persisted local data if a newer synced copy exists
  • Performs all reads and searches against local data only
  • Auto-syncs from the API every 12 hours
  • Supports manual ForceResyncAsync() (dataset + rules)
  • Supports targeted ForceResyncDatasetAsync() and ForceResyncRulesAsync()
  • Uses ETag conditional requests (If-None-Match) for sync efficiency
  • Falls back to memory-only behavior if local writes fail

Install

dotnet add package NugLabs

Usage

using NugLabs;

var client = new NugLabsClient();

var blueDream = await client.GetStrainAsync("Blue Dream");
var allStrains = await client.GetAllStrainsAsync();
var matches = client.SearchStrains("dream");

var sync = await client.ForceResyncAsync();
var datasetOnly = await client.ForceResyncDatasetAsync();
var rulesOnly = await client.ForceResyncRulesAsync();
await client.DisposeAsync();
using NugLabs;
using NugLabs.Options;

var client = new NugLabsClient(new NugLabsClientOptions
{
    StorageDirectory = Path.Combine(
        Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
        "NugLabs"),
    SyncInterval = TimeSpan.FromHours(12),
    HttpClient = new HttpClient()
});

Sync uses canonical URLs from NugLabsApi.StrainsDatasetUrl and NugLabsApi.RulesUrl (aligned with Rust nuglabs_core::strains_dataset_url() / nuglabs_core::rules_url()).

Constructor Options

  • StorageDirectory: local persistence directory
  • SyncInterval: background sync interval
  • HttpClient: custom HTTP client for sync
  • WasmPath: optional explicit path to nuglabs_core.wasm

Return Shapes

  • GetStrainAsync(name): returns Strain?
  • GetAllStrainsAsync(): returns IReadOnlyList<Strain>
  • SearchStrains(query): returns IReadOnlyList<Strain>
  • ForceResyncAsync(): returns NugLabsSyncResult
  • ForceResyncDatasetAsync(): returns NugLabsArtifactSyncResult
  • ForceResyncRulesAsync(): returns NugLabsArtifactSyncResult

Typical Strain fields include:

  • Id
  • Name
  • Akas
  • Type
  • Thc
  • Description
  • plus any additional dataset fields bundled with NugLabs

Behavior

  • GetStrainAsync(name) does case-insensitive exact matching against Name and Akas
  • SearchStrains(query) does case-insensitive partial matching against Name and Akas
  • GetAllStrainsAsync() returns the full locally loaded dataset
  • Reads never call the API directly
  • Sync failures keep the last good local artifacts
  • Rules endpoint 404 is treated as not-modified for backward-compatible deployments
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 was computed.  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 was computed.  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.3.1 152 3/30/2026
1.3.0 121 3/30/2026
1.2.0 139 3/27/2026
1.0.0 163 3/17/2026