Skip to content

Kotlin DSV

Kotlin Multiplatform library for working with delimiter-separated values (CSV, TSV, and custom formats).

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

Installation

Add the dependency to your build.gradle.kts:

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

Quick Start

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

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

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

Next Steps

  • Browse the API Reference for detailed documentation
  • See the examples section for more advanced use cases