BookshelfReader.Core
1.0.2
dotnet add package BookshelfReader.Core --version 1.0.2
NuGet\Install-Package BookshelfReader.Core -Version 1.0.2
<PackageReference Include="BookshelfReader.Core" Version="1.0.2" />
<PackageVersion Include="BookshelfReader.Core" Version="1.0.2" />
<PackageReference Include="BookshelfReader.Core" />
paket add BookshelfReader.Core --version 1.0.2
#r "nuget: BookshelfReader.Core, 1.0.2"
#:package BookshelfReader.Core@1.0.2
#addin nuget:?package=BookshelfReader.Core&version=1.0.2
#tool nuget:?package=BookshelfReader.Core&version=1.0.2
BookshelfReader
BookshelfReader provides dependency injection helpers for wiring the bookshelf parsing pipeline (segmentation, OCR, parsing, genre classification, and Open Library lookup) into an existing ASP.NET Core application. Use the NuGet package; you do not need to run the included API host by itself. A runnable reference host lives in BookshelfReader.Host for local testing only and is not packaged. Only the BookshelfReader.Extensions and BookshelfReader.Api projects are marked packable so dotnet pack emits just the NuGet payloads.
Consuming the NuGet package
- Reference the
BookshelfReader.Extensionspackage (andBookshelfReader.Apiif you want the prebuilt endpoint mappings) from your ASP.NET Core project. - In
Program.csadd:using BookshelfReader.Api.Extensions; using BookshelfReader.Extensions; using BookshelfReader.Extensions.Authentication; builder.Services.AddBookshelfReader(builder.Configuration); builder.Services .AddAuthentication(options => { options.DefaultScheme = ApiKeyAuthenticationDefaults.AuthenticationScheme; options.DefaultAuthenticateScheme = ApiKeyAuthenticationDefaults.AuthenticationScheme; options.DefaultChallengeScheme = ApiKeyAuthenticationDefaults.AuthenticationScheme; }) .AddBookshelfReaderApiKey(); builder.Services.AddAuthorization(); builder.Services.AddBookshelfReaderRateLimiting(builder.Configuration); app.UseRateLimiter(); app.MapBookshelfReaderApi(); - Provide configuration values (environment variables or
appsettings.json):Authentication:ApiKey:HeaderName(defaultX-API-Key),RequireApiKey, andValidKeys.RateLimiting:Parse:Enabled(defaultfalse),PermitLimit(default10), andWindowSeconds(default60). Enabling this policy also requiresbuilder.Services.AddBookshelfReaderRateLimiting(builder.Configuration);during service registration andapp.UseRateLimiter();before mapping the API endpoints.Uploads:MaxBytes(1–20 MB) andAllowedContentTypes(JPEG/PNG).Enrichment:Enabled(defaulttrue),MaxConcurrentLookups(1–16, default 4), andMinMatchScore(0–100, default 55). When enabled,/api/bookshelf/parselooks up each parsed title against Open Library and attaches the best match (title, author, year, ISBN, cover URL, subjects) to the candidate'smetadatafield, so callers get display-ready results from a single request.- Optional:
OpenLibrary:BaseUrl(must be HTTPS),OpenLibrary:UserAgent(sent to Open Library; defaults to a BookshelfReader identifier),Ocr:Tesseract,Segmentation, andParsingsettings.
Embedders must provide OCR language data by placing eng.traineddata (or the languages they configure) in a tessdata directory and pointing Ocr:Tesseract:DataPath at it. BookshelfReader.Host downloads eng.traineddata from the tessdata_fast repository automatically on first build, but package consumers need to provision that folder themselves.
Packing for nuget.org (testing)
dotnet restore
dotnet pack BookshelfReader.Extensions/BookshelfReader.Extensions.csproj \
-c Release \
-p:PackageVersion=1.0.0-beta1 \
-p:IncludeSymbols=true \
-p:SymbolPackageFormat=snupkg
dotnet pack BookshelfReader.Api/BookshelfReader.Api.csproj \
-c Release \
-p:PackageVersion=1.0.0-beta1 \
-p:IncludeSymbols=true \
-p:SymbolPackageFormat=snupkg
# Equivalent solution-wide pack (only the packable projects emit packages)
# dotnet pack BookshelfReader.sln -c Release
Publish the resulting .nupkg (and optional .snupkg) artifacts from BookshelfReader.Extensions (and optionally BookshelfReader.Api for the endpoint mappings) to nuget.org with your API key. Mark prerelease versions with a suffix such as -beta1.
Tests
dotnet test
Tests cover the DI wiring, option validation, and pipeline components to ensure the NuGet surface behaves as expected.
| Product | Versions 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. |
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on BookshelfReader.Core:
| Package | Downloads |
|---|---|
|
BookshelfReader.Infrastructure
Concrete BookshelfReader pipeline implementations: OpenCV segmentation, Tesseract OCR, spine parsing, genre classification, and Open Library lookup with metadata enrichment. Pulls in Windows-only native dependencies (OpenCvSharp4.Windows, Tesseract). |
|
|
BookshelfReader.Extensions
Dependency-injection helpers for the BookshelfReader pipeline. Call AddBookshelfReader() to wire upload validation, segmentation, OCR, parsing, genre classification, and Open Library enrichment into an ASP.NET Core app, plus optional API-key auth and parse rate limiting. |
|
|
BookshelfReader.Api
Endpoint-mapping helpers for the BookshelfReader pipeline. Call MapBookshelfReaderApi() to expose the /api/bookshelf/parse and /api/books/lookup endpoints from an ASP.NET Core app. |
GitHub repositories
This package is not used by any popular GitHub repositories.