Edifact.Untdid
1.0.0-preview.6
dotnet add package Edifact.Untdid --version 1.0.0-preview.6
NuGet\Install-Package Edifact.Untdid -Version 1.0.0-preview.6
<PackageReference Include="Edifact.Untdid" Version="1.0.0-preview.6" />
<PackageVersion Include="Edifact.Untdid" Version="1.0.0-preview.6" />
<PackageReference Include="Edifact.Untdid" />
paket add Edifact.Untdid --version 1.0.0-preview.6
#r "nuget: Edifact.Untdid, 1.0.0-preview.6"
#:package Edifact.Untdid@1.0.0-preview.6
#addin nuget:?package=Edifact.Untdid&version=1.0.0-preview.6&prerelease
#tool nuget:?package=Edifact.Untdid&version=1.0.0-preview.6&prerelease
Edifact.Untdid
Reads a UN/EDIFACT directory distribution as published by UNECE — the fixed-column CP437 archives — detects which release dialect it is, and compiles it into a pack.
No directory content is included in this package; you supply the distribution. This is the
ingestion half of the library: it opens D96A.ZIP, works out which generation of the UNTDID layout
it is looking at, parses the element, composite, segment, code list and message files, links them
into a SchemaPack, and accounts for every line it
read. Use it when you want ingestion inside your own process — a service that accepts a directory
upload, a build step that produces packs. If you only want a pack on disk, the
edifact CLI does exactly this and is one command.
Install
dotnet add package Edifact.Untdid --prerelease
net8.0 and net10.0, no external dependencies.
Get a distribution and the syntax definitions
Download a release directory from UNECE (https://unece.org/trade/uncefact/unedifact/download) and
expand its top-level archives once — the shape the distribution's own README.TXT describes.
Nothing needs renaming; the dialect detector works out what it is.
You also need the ISO 9735 syntax definitions, which no ingestion can produce: the UNTDID
deliberately omits the service definitions, so they are transcribed once per syntax version rather
than derived once per release. They ship inside the Edifact.Cli package, and the simplest way to
put them on a machine is to let the tool do it — edifact ingest <distribution> --out <packs>/compiled
leaves them in <packs>/syntax beside the pack it writes, and you then point SyntaxPackSet there:
dotnet tool install --global Edifact.Cli --prerelease
edifact ingest ~/Downloads/D01B --out ~/edifact/packs/compiled
Use it
using Edifact.Schema.Serialization;
using Edifact.Untdid;
using Edifact.Untdid.Dialects;
using Edifact.Untdid.Sources;
var source = new UntdidSource("/home/me/Downloads/D01B");
var syntax = new SyntaxPackSet("/home/me/edifact/packs/syntax");
try
{
var result = DirectoryIngester.Ingest(source, syntax, new IngestionOptions(Strict: true));
// What it decided the distribution is, and how sure it was.
Console.WriteLine($"{result.Dialect.DirectoryLabel} as {result.Dialect.DialectId} "
+ $"({result.Dialect.Confidence:P0}), ISO 9735 version {(int)result.Dialect.Syntax}");
// What was accounted for. Counts are exact — 641 elements, 295 composites, 233 segments,
// 268 code lists and 208 messages for D.01B — and a short directory is the failure this
// package exists to make impossible.
Console.WriteLine(result.Report.Summarise());
PackWriter.Write(result.Pack, $"/home/me/edifact/packs/compiled/{result.Pack.Id}");
}
catch (DialectDetectionException exception)
{
// Nothing matched the layout well enough to ingest against.
Console.Error.WriteLine(exception.Message);
}
catch (IngestionException exception)
{
// Strict mode: something in the distribution went unaccounted for.
Console.Error.WriteLine(exception.Report.DescribeGaps());
}
IngestionOptions carries the four decisions worth making: Strict (refuse a pack when a line went
unaccounted for — the default, and what committed packs are built with), IncludeProse (keep the
directory's descriptive text; see the licence note below), BuiltAt (supplied rather than read from
the clock, so re-ingesting a distribution can be compared byte for byte against a previous pack) and
PackId.
The parsers are public too — ElementDirectoryParser, CompositeDirectoryParser,
SegmentDirectoryParser, CodeListParser, SegmentTableParser — for reading one file of a
distribution without ingesting the whole thing.
Prose and redistribution
A pack built with IncludeProse: true holds the directory's own descriptive text. The UN licence
permits copying the Directory and passing it on unmodified; it does not permit modifying and
distributing it, so a pack carrying that prose is for your own use and not for redistribution.
Structure — tags, cardinalities, representations, code values — is not prose and is not covered by
that restriction.
Where this sits
Edifact.Untdid → Edifact.Schema →
Edifact.Core. Nothing depends on it in turn: once a
pack exists, Edifact.Validation and the rest
read it with PackReader and never look at a distribution again.
Full documentation: https://github.com/101-semaphore/EDIFACT.
Licence
Apache-2.0. See the NOTICE in this package for what the wider project is derived from and under
what terms.
| 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 is compatible. 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. |
-
net10.0
- Edifact.Schema (>= 1.0.0-preview.6)
-
net8.0
- Edifact.Schema (>= 1.0.0-preview.6)
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-preview.6 | 59 | 10/11/2026 |
| 1.0.0-preview.5 | 75 | 9/19/2026 |
| 1.0.0-preview.4 | 64 | 9/17/2026 |
| 1.0.0-preview.3 | 93 | 9/7/2026 |
| 1.0.0-preview.2 | 88 | 9/6/2026 |
| 1.0.0-preview.1 | 80 | 9/6/2026 |