Datra 0.3.0

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

Datra

한국어 | English

License: MIT .NET Unity

Datra is a game data management system that uses C# Source Generators to automatically generate serialization code for CSV, JSON, and YAML data. Works seamlessly in both Unity and .NET environments.

Features

  • Multiple Formats: CSV, JSON, YAML with auto-detection
  • Zero Boilerplate: Source Generators eliminate manual serialization code
  • Type Safety: Compile-time validation with strong typing
  • Data References: Type-safe DataRef<T> for cross-table references
  • Unity Integration: Built-in Editor window with Table/Form views
  • Localization: Multi-language support with LocaleRef
  • Advanced Types: Nested structs, polymorphic JSON, arrays, enums

Quick Start

1. Define Your Data Model

using Datra.Attributes;
using Datra.Interfaces;

[TableData("Characters.csv")]
public partial class CharacterData : ITableData<string>
{
    public string Id { get; set; }
    public string Name { get; set; }
    public int Level { get; set; }
    public int Health { get; set; }
}

[SingleData("GameConfig.json")]
public partial class GameConfigData
{
    public string GameName { get; set; }
    public int MaxLevel { get; set; }
}

2. Configure the Data Context

[assembly: DatraConfiguration("GameData",
    Namespace = "MyGame.Generated"  // Required
)]

3. Load and Use Data

var provider = new FileRawDataProvider("path/to/data");
var context = new GameDataContext(provider, new DataLoaderFactory());

await context.LoadAllAsync();

var hero = context.Character.GetById("hero_001");
var config = context.GameConfig.Get();

Installation

Unity

Add to Packages/manifest.json:

{
  "dependencies": {
    "com.penspanic.datra": "https://github.com/penspanic/Datra.git?path=Datra",
    "com.penspanic.datra.editor": "https://github.com/penspanic/Datra.git?path=Datra.Editor",
    "com.penspanic.datra.unity": "https://github.com/penspanic/Datra.git?path=Datra.Unity"
  }
}

.NET

Add project references:

<ProjectReference Include="path/to/Datra/Datra.csproj" />
<ProjectReference Include="path/to/Datra.Generators/Datra.Generators.csproj"
                  OutputItemType="Analyzer"
                  ReferenceOutputAssembly="false" />

Unity Editor

<p align="center"> <img src="docs/images/unity-editor-demo.gif" alt="Unity Editor Demo" width="100%"> </p>

The Unity Editor window provides:

  • Table View / Form View for data editing
  • Real-time change tracking with save/revert
  • Collection editors for List, Dictionary, arrays
  • DataRef selectors with dropdown pickers
  • Localization panel for multi-language editing

Open via: Window > Datra > Data Editor

Project Structure

Datra/
├── Datra/                  # Core runtime library
├── Datra.Generators/       # Source Generator (compile-time)
├── Datra.Analyzers/        # Roslyn Analyzers
├── Datra.Editor/           # Shared editor utilities
├── Datra.Unity/            # Unity packages (Runtime, Editor, Addressables)
├── Datra.Tests/            # Unit tests
└── Datra.SampleData/       # Sample data models

Documentation

License

MIT License - see LICENSE

Product 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 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Datra:

Package Downloads
Datra.WebEditor.Server

ASP.NET Core helpers for hosting the Datra.WebEditor RCL: MapDatraEditor() endpoints (status, save, reload) backed by the editor's DatraEditorHostService.

Datra.Editor

Editor schema and editable data-source primitives for Datra-managed game data.

Datra.WebEditor

Blazor RCL providing a schema-driven web editor for Datra-managed game data. Auto-enumerates ITableRepository<,> properties on a DataContext; no per-game boilerplate.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 182 5/27/2026