Bash.UnstructuredIO.Client
1.0.0
dotnet add package Bash.UnstructuredIO.Client --version 1.0.0
NuGet\Install-Package Bash.UnstructuredIO.Client -Version 1.0.0
<PackageReference Include="Bash.UnstructuredIO.Client" Version="1.0.0" />
paket add Bash.UnstructuredIO.Client --version 1.0.0
#r "nuget: Bash.UnstructuredIO.Client, 1.0.0"
// Install Bash.UnstructuredIO.Client as a Cake Addin #addin nuget:?package=Bash.UnstructuredIO.Client&version=1.0.0 // Install Bash.UnstructuredIO.Client as a Cake Tool #tool nuget:?package=Bash.UnstructuredIO.Client&version=1.0.0
Bash.UnstructuredIO.Client
Unofficial .NET SDK for the Unstructured API
This is an unofficial .NET client for the Unstructured API. Refer to Official Unstructured API Docs to understand about the project and steps to use the hosted service or deploy your own instance using Docker.
Getting started
Install from NuGet
Install package Bash.UnstructuredIO.Client
from Nuget. Here's how via command line:
Install-Package Bash.UnstructuredIO.Client
SDK Example Usage
The UnstructuredClient
class can be used both by dependency injection or directly instantiating it wherever required. The first parameter is the server URL of the Unstructured instance. It can either be set to the official hosted API or your own instance. The seond one is the api-key which is optional and can be omitted.
Using Dependency Injection
builder.Services.AddSingleton<IUnstructuredClient>(
new UnstructuredClient("http://localhost:8000", "my-key-123")
);
Directly Instantiating the client
var unstructuredClient = new UnstructuredClient("http://localhost:8000", "my-key-123");
Usage
The PartitionAsync
method returns a ApiResponse
object that has the parameters of Data
, Message
and StatusCode
.
- The
Data
property is a list ofElements
that have been extracted from the document. - The
Message
andStatusCode
properties return a message if the extraction was successful or not.
Simple Example
var filePath = "SampleFiles\\lorem_ipsum.docx";
var result = await _unstructuredClient.PartitionAsync(filePath, CancellationToken.None);
var elements = result.Data;
foreach (var element in elements)
{
Console.WriteLine(element.Text);
}
Additional Extraction Options
See the api parameters page for all available Extraction Options
.
var options = new ExtractionOptions()
{
Strategy = UnstructuredConstants.Strategy.HighResolution,
Coordinates = true
};
var result = await unstructuredClient.PartitionAsync(filePath, options, CancellationToken.None);
Unstructured Constants
The UnstructuredConstants
contains a set of constants that can be used in the SDK.
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
This was a project aimed at learning how NuGet packages can be created along with the itch of doing some .NET stuff besides work. Contributions are very welcome and needed. It is not probably following the best practices so willing to learn whoever contributes to do a code review!
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.2)
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.0 | 101 | 5/24/2024 |
1.0.0-beta.2 | 67 | 3/6/2024 |
1.0.0-beta.1 | 50 | 3/6/2024 |
First production release