Skip to content

equinor/osdu-csharp-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

OSDU C# Client

SCM Compliance

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.

Prerequisites

For regenerating clients locally:

  • Kiota CLI

    dotnet tool install --global Microsoft.OpenApi.Kiota
  • Python 3.10+

Installation

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

The personal access token needs the read:packages scope. Generate one at github.com/settings/tokens.

Quick Start

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.

Available Services

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

Running Tests

Quick run:

# Run all integration tests
dotnet test OsduCsharpClient.slnx

For .env setup, optional variables, and detailed test commands, see docs/environment-and-tests.md.

Development

Quick flow:

git clone https://github.com/equinor/osdu-csharp-client.git
cd osdu-csharp-client
python3 generate_all.py
dotnet build OsduCsharpClient.slnx

For release flow, OpenAPI update steps, response media type normalization, client regeneration, and project structure details, see docs/development.md.

Documentation

License

Ref. License Information

About

C# client library for OSDU services, generated with Kiota

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors