Dtlaz.Parser 1.2.0

dotnet add package Dtlaz.Parser --version 1.2.0
                    
NuGet\Install-Package Dtlaz.Parser -Version 1.2.0
                    
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="Dtlaz.Parser" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dtlaz.Parser" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Dtlaz.Parser" />
                    
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 Dtlaz.Parser --version 1.2.0
                    
#r "nuget: Dtlaz.Parser, 1.2.0"
                    
#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 Dtlaz.Parser@1.2.0
                    
#: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=Dtlaz.Parser&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Dtlaz.Parser&version=1.2.0
                    
Install as a Cake Tool

🧬 DTL Parser for .NET

DTL Banner

Domain Transport Language Parser - Parse • Convert • Secure • Transform

NuGet Downloads License DTL Spec


Parser for DTL (Domain Transport Language) - Ultra-compact, schema-driven, cryptographic data transport format for .NET.

📖 Specification: dtlaz.org | 🌐 AlifZetta: axz.si

🇦🇪 Product of Dubai

Installation

dotnet add package Dtlaz.Parser

Or via NuGet Package Manager:

Install-Package Dtlaz.Parser

Quick Start

using DTL;
using DTL.Converters;

// Parse DTL content
var doc = DTLParser.Parse(@"
@dtlv1.0^dtHC^pMedical^c1^s0^w0^h0
@sec^hash^0x0^none^0

PATIENTS|id:s,name:s,age:i|2|S0|W0|C1
P001|John Doe|45
P002|Jane Smith|32
");

// Access tables
var patients = doc.GetTable("PATIENTS");
foreach (var row in patients.Rows)
{
    Console.WriteLine($"{row["name"]} is {row["age"]} years old");
}

// Create new document
var newDoc = DTLParser.CreateDocument("dtWEB", "pAPI");
DTLParser.AddTable(newDoc, "USERS", 
    new Dictionary<string, string> 
    { 
        { "id", "s" }, 
        { "name", "s" }, 
        { "active", "b" } 
    },
    new List<Dictionary<string, object?>>
    {
        new() { ["id"] = "U001", ["name"] = "Alice", ["active"] = true },
        new() { ["id"] = "U002", ["name"] = "Bob", ["active"] = false },
    }
);

// Write to DTL string
var dtlString = DTLParser.Write(newDoc);

Format Converters

JSON ↔ DTL

using DTL.Converters;

// JSON → DTL
var doc = JsonConverter.FromJson(@"{
    ""users"": [
        { ""id"": 1, ""name"": ""Alice"" },
        { ""id"": 2, ""name"": ""Bob"" }
    ]
}");

// DTL → JSON
var jsonStr = JsonConverter.ToJson(doc);

CSV ↔ DTL

// CSV → DTL
var doc = CsvConverter.FromCsv(@"id,name,score
1,Alice,95
2,Bob,87", tableName: "STUDENTS");

// DTL → CSV
var csvStr = CsvConverter.ToCsv(doc, "STUDENTS");

XML ↔ DTL

// XML → DTL
var doc = XmlConverter.FromXml(@"<users><user id=""1"">Alice</user></users>");

// DTL → XML
var xmlStr = XmlConverter.ToXml(doc);

Auto-detect Format

using DTL.Converters;

// Auto-detect and convert
var doc1 = AutoConverter.ConvertToDtl("{\"data\": [1,2,3]}");    // Detects JSON
var doc2 = AutoConverter.ConvertToDtl("id,name\n1,Alice");       // Detects CSV
var doc3 = AutoConverter.ConvertToDtl("<data>...</data>");       // Detects XML
var doc4 = AutoConverter.ConvertToDtl("@dtlv1.0^dtWEB^...");     // Detects DTL

// Convert DTL to any format
var json = AutoConverter.ConvertFromDtl(doc, "json");
var csv = AutoConverter.ConvertFromDtl(doc, "csv");
var xml = AutoConverter.ConvertFromDtl(doc, "xml");

Working with Tables

var doc = DTLParser.Parse(content);

// Get table
var users = doc.GetTable("USERS");

// Get rows
var rows = doc.GetRows("USERS");

// Query rows
var activeUsers = users.Where(r => (bool)r["active"]);
var admin = users.FirstOrDefault(r => r["id"]?.ToString() == "admin");

// Get column values
var names = users.GetColumn<string>("name");

// Get config value
var apiKey = doc.GetConfig("api_key");

// Check if table exists
if (doc.HasTable("SETTINGS"))
{
    // ...
}

// List all table names
foreach (var name in doc.TableNames)
{
    Console.WriteLine(name);
}

File Operations

// Parse from file
var doc = DTLParser.ParseFile("data.dtl");

// Write to file
DTLParser.WriteFile(doc, "output.dtl");

DTL Types

Type .NET Type Description
s string String
i int Integer
f double Float
b bool Boolean (0/1)
D DateTime Date
T DateTime Timestamp
u Guid UUID
j string JSON

Target Frameworks

  • .NET 6.0, 7.0, 8.0
  • .NET Standard 2.0
Package Platform Install
dtl-parser Python pip install dtl-parser
dtl-parser JavaScript npm install dtl-parser
Dtlaz.Parser .NET dotnet add package Dtlaz.Parser

License

MIT © Padam Sundar Kafle


🇦🇪 Product of Dubai | dtlaz.orgaxz.si

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 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 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

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 87 1/3/2026
1.1.1 86 1/3/2026
1.1.0 85 1/3/2026
1.0.0 89 1/3/2026