IdentityDocument.Processing 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package IdentityDocument.Processing --version 1.0.2
                    
NuGet\Install-Package IdentityDocument.Processing -Version 1.0.2
                    
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="IdentityDocument.Processing" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IdentityDocument.Processing" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="IdentityDocument.Processing" />
                    
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 IdentityDocument.Processing --version 1.0.2
                    
#r "nuget: IdentityDocument.Processing, 1.0.2"
                    
#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 IdentityDocument.Processing@1.0.2
                    
#: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=IdentityDocument.Processing&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=IdentityDocument.Processing&version=1.0.2
                    
Install as a Cake Tool

IdentityDocument.Processing

IdentityDocument.Processing is a .NET library that combines Azure Computer Vision and ML.NET to process images of identity documents (ID cards, passports, licenses, etc.).
It extracts raw text from images and maps it into structured fields such as First Name, Last Name, Document Number, Dates, and more.


?? Features

  • OCR extraction using Azure Computer Vision.
  • Field classification and parsing with ML.NET.
  • Easy integration into ASP.NET Core and .NET 7+ applications.
  • Provides strongly-typed results for identity documents.

?? Installation

dotnet add package IdentityDocument.Processing

? Quick Start

1. Register services in Program.cs

using IdentityDocument.Processing.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Register library services and ML.NET model
builder.Services.AddIdentityDocumentProcessing();

var app = builder.Build();
app.Run();

2. Example service usage

using IdentityDocument.Processing.Abstractions;
using Microsoft.AspNetCore.Http;

namespace MyApp.Services
{
    public class DocumentProcessingService : IDocumentProcessingServices
    {
        private readonly IIdentityDocumentServices _identityDocService;

        public DocumentProcessingService(IIdentityDocumentServices identityDocService)
        {
            _identityDocService = identityDocService;
        }

        public async Task<FileUploadResponse> IdentityDocumentProcessingImgs(ICollection<IFormFile> files)
        {
            if (files == null || files.Count == 0)
                throw new ArgumentException("At least one image must be provided.");

            var result = await _identityDocService.IdentityDocumentProsessingImgs(files);

            if (result == null)
                throw new InvalidOperationException("Document could not be processed.");

            return new FileUploadResponse
            {
                Nombres = result.Nombres,
                Apellidos = result.Apellidos,
                Pais = result.Pais,
                NumeroDocumento = result.NumeroDocumento,
                FechaNacimiento = ParseDate(result.FechaNacimiento),
                FechaEmision = ParseDate(result.FechaEmision),
                FechaVencimiento = ParseDate(result.FechaVencimiento),
                Sexo = result.Sexo,
                Nacionalidad = result.Nacionalidad,
                EstadoCivil = result.EstadoCivil,
                Ocupacion = result.Ocupacion
            };
        }

        private DateTime? ParseDate(string? value, string format = "yyyy-MM-dd")
        {
            if (string.IsNullOrWhiteSpace(value)) return null;
            if (DateTime.TryParseExact(value, format,
                System.Globalization.CultureInfo.InvariantCulture,
                System.Globalization.DateTimeStyles.None,
                out var date))
                return date;
            return null;
        }
    }
}

?? Requirements

  • .NET 7.0
  • Azure Computer Vision subscription (endpoint and key)
  • Built-in dependencies:
    • Microsoft.ML
    • Microsoft.Extensions.ML
    • Microsoft.Azure.CognitiveServices.Vision.ComputerVision

?? More Info


?? Contributing

Contributions are welcome:

  1. Fork the repository.
  2. Create a feature/bugfix branch.
  3. Submit a Pull Request.

?? Issues


?? License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  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.2.0 128 9/8/2025
1.1.3 143 9/3/2025
1.1.1 139 9/3/2025
1.1.0 125 9/3/2025
1.0.2 175 8/28/2025
1.0.1 152 8/25/2025