kotlin-dsv

Project Url: sargunv/kotlin-dsv
Introduction: Kotlin Multiplatform library for working with delimiter-separated values.
More: Author   ReportBugs   
Tags:

Maven Central Version License Kotlin Version Documentation API Reference

Introduction

Kotlin DSV is a library for working with delimiter-separated values (CSV, TSV, and custom formats) in Kotlin Multiplatform projects.

Features:

  • Type-safe serialization using kotlinx.serialization
  • Streaming support for large files via kotlinx.io
  • Customizable delimiters, quoting, and naming strategies
  • Multiplatform support for JVM, JS, Native, and WASM targets

Getting Started

Add Kotlin DSV to your project:

dependencies {
    implementation("dev.sargunv.kotlin-dsv:kotlin-dsv:VERSION")
}

Quick Start

@Serializable
data class Person(val name: String, val age: Int, val email: String?)

// Encode to CSV string
val people = listOf(
    Person("A", 30, "a@example.com"),
    Person("B", 25, null)
)
val csv = Csv.encodeToString(people)

// Decode from CSV string
val decoded = Csv.decodeFromString<Person>(csv)

See the project site for more info and examples.

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools