AnkiIO 1.0.1

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

AnkiIO

Generated with help from GPT-5.6-Sol Ultra. Tested and working for my use cases. This project does not reflect my abilities as a developer—for better or worse.

CI Documentation Security Coverage gate .NET 10 License: MIT

Browse the API documentation →

Sample projects · Formats and safety · MIT license

AnkiIO is a stable, open-source .NET 10 library for creating, validating, importing, editing, and exporting Anki deck data. Its 1.0 API covers a format-independent deck model, practical helpers for common note types, deterministic JSON, a CrowdAnki-inspired interchange format, media, scheduling state, diagnostics, and guarded legacy APKG I/O.

AnkiIO is maintained by Julius Jacobsohn.

AnkiIO is not affiliated with, endorsed by, or sponsored by Ankitects, Anki, AnkiDroid, or CrowdAnki. “Anki” is a trademark of Ankitects Pty Ltd.

Compatibility and scope

The 1.0 compatibility target is deliberately narrow: Anki 26.05 (build e64c6b1a), collection schema 18, and the v3 scheduler. The library targets net10.0, so consumers require the .NET 10 runtime or a compatible later runtime. Repository builds use the .NET 10 SDK pinned by global.json.

APKG export writes the legacy collection.anki2 representation, which is accepted by the isolated Anki 26.05 compatibility test. Native JSON and CrowdAnki-inspired JSON support documented subsets rather than every field used by every Anki add-on. Unknown native-JSON properties are retained where the API documents preservation.

AnkiIO does not write a live Anki profile. Modern collection.anki21b generation, filtered decks, arbitrary schema-18 database mutation, and complete review-log or deck-configuration preservation are outside the 1.0 support boundary. Read formats, compatibility, and safety before processing untrusted packages or important data.

Install

The package version is defined once in Version.props. After the package is published:

dotnet add package AnkiIO

To consume a local package from this checkout:

dotnet pack src/AnkiIO/AnkiIO.csproj --configuration Release --output artifacts/packages
dotnet add package AnkiIO --source artifacts/packages

Quick start

using AnkiIO;

var deck = new AnkiDeck("German Vocabulary");
deck.AddBasicNote("Haus", "house", tags: ["german", "vocabulary"]);

await AnkiPackageWriter.WriteAsync(deck, "GermanVocabulary.apkg");

A note stores information; a card is a study prompt generated from a note template. Scheduling belongs to cards. New cards receive a safe default schedule, while explicit scheduling is validated and rejected when its queue/type combination is inconsistent.

Highlights

  • Decks and nested Parent::Child hierarchies
  • Notes, ordered fields, custom note types, card templates, CSS, tags, GUIDs, and cards
  • Helpers for Basic, Basic-and-reversed, and Cloze notes, including safe cloze-markup construction
  • Safe new-card initialization and explicit, validated scheduling state
  • Streaming media ingestion with SHA-256 integrity metadata
  • Deterministic, versioned native JSON and CrowdAnki-inspired JSON
  • Guarded APKG import/export with configurable archive limits and path-traversal defenses
  • Structured validation diagnostics and documented unknown-data preservation
  • Read-only installed-Anki detection and opt-in, isolated local compatibility testing

See the samples for focused programs and the German–English showcase for a complete custom deck with note types, media, tags, and verification.

Build and verify

Install the SDK selected by global.json, then run the complete local gate:

./build/build.ps1

That script performs locked restore, formatting verification, a Release build, sample and benchmark builds, portable tests, coverage enforcement, package creation and validation, a clean package-consumer round trip, and a strict Doxygen build. The same checks run in CI on Linux, Windows, and macOS.

The local-Anki compatibility suite is intentionally opt-in because it requires an installed Anki instance:

dotnet test tests/AnkiIO.CompatibilityTests --configuration Release --filter Category=LocalAnkiCompatibility

Local-Anki tests use unique temporary workspaces and never modify the normal profile. API documentation is generated by Doxygen from source comments and source-resident guides; do not edit generated HTML.

Releasing

Versioning follows Semantic Versioning. To release, update the changelog and change <Version> in Version.props. Merging or pushing that version change to main runs the complete release gate, waits for the same commit's Linux, Windows, and macOS CI jobs, creates the matching vX.Y.Z tag and GitHub release, and publishes the package through NuGet Trusted Publishing. The workflow can still be dispatched manually with its release switch disabled to produce and validate artifacts without publishing them.

Contributions use focused pull requests and must preserve the documented 1.x compatibility contract; see CONTRIBUTING.md. Security reports follow SECURITY.md. Licensed under MIT.

Product Compatible and additional computed target framework versions.
.NET 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. 
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.0.2 139 7/23/2026
1.0.1 114 7/22/2026

See the changelog and API documentation for release details, compatibility, and safety guidance.