This project is a C# client library for OSDU services, automatically generated from OpenAPI specifications using Microsoft Kiota.
It provides typed, async clients for various OSDU core services, allowing for easy integration with OSDU APIs in .NET applications.
For regenerating clients locally:
-
dotnet tool install --global Microsoft.OpenApi.Kiota
-
Python 3.10+
The package is published to GitHub Packages.
Add the Equinor NuGet feed (once per machine), then install the package:
dotnet nuget add source "https://nuget.pkg.github.com/equinor/index.json" \
--name equinor-github \
--username <your-github-username> \
--password <your-github-personal-access-token>
dotnet add package Equinor.OsduCsharpClientThe personal access token needs the
read:packagesscope. Generate one at github.com/settings/tokens.
The OsduClient facade handles auth, token caching, and data-partition-id injection automatically:
using Equinor.OsduCsharpClient.Facade;
using Equinor.OsduCsharpClient.Search.Models;
using var osdu = new OsduClient(OsduConfig.FromEnvironment());
var result = await osdu.Search.Query.PostAsync(
new QueryRequest
{
Kind = new QueryRequest.QueryRequest_kind
{
QueryRequestKindString = "osdu:wks:work-product-component--WellLog:*"
},
Query = "*",
Limit = 10,
ReturnedFields = ["id", "kind", "createTime"],
});
if (result?.Results is not null)
{
foreach (var record in result.Results)
Console.WriteLine(record.AdditionalData["id"]);
}OsduConfig.FromEnvironment() reads SERVER, DATA_PARTITION_ID, AUTHORITY, CLIENT_ID, and SCOPES from environment variables or a .env file. See docs/environment-and-tests.md for setup.
For low-level usage (constructing service clients directly with a raw adapter), see docs/usage.md.
| Namespace | Service |
|---|---|
OsduCsharpClient.CrsCatalog |
CRS Catalog |
OsduCsharpClient.CrsConversion |
CRS Conversion |
OsduCsharpClient.Dataset |
Dataset |
OsduCsharpClient.Entitlements |
Entitlements |
OsduCsharpClient.File |
File |
OsduCsharpClient.Geospatial |
Geospatial |
OsduCsharpClient.Indexer |
Indexer |
OsduCsharpClient.Legal |
Legal |
OsduCsharpClient.Notification |
Notification |
OsduCsharpClient.Partition |
Partition |
OsduCsharpClient.Policy |
Policy |
OsduCsharpClient.Register |
Register |
OsduCsharpClient.Schema |
Schema |
OsduCsharpClient.Search |
Search |
OsduCsharpClient.SeismicDdms |
Seismic DDMS |
OsduCsharpClient.Storage |
Storage |
OsduCsharpClient.Unit |
Unit |
OsduCsharpClient.WellboreDdms |
Wellbore DDMS |
OsduCsharpClient.Workflow |
Workflow |
Quick run:
# Run all integration tests
dotnet test OsduCsharpClient.slnxFor .env setup, optional variables, and detailed test commands, see docs/environment-and-tests.md.
Quick flow:
git clone https://github.com/equinor/osdu-csharp-client.git
cd osdu-csharp-client
python3 generate_all.py
dotnet build OsduCsharpClient.slnxFor release flow, OpenAPI update steps, response media type normalization, client regeneration, and project structure details, see docs/development.md.
- Environment and tests: docs/environment-and-tests.md
- Usage examples (including raw JSON access): docs/usage.md
- Development and release workflow: docs/development.md
Ref. License Information