This repository was archived by the owner on Feb 8, 2024. It is now read-only.
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
kotools.csv
#14Closed
Description
Description
Create a package kotools.csv
containing all declarations of the package io.github.kotools.csv
.
Then, deprecate all declarations of the old package.
Declarations in
kotools.csv
should use explicit types from Kotools Types for having a typeful design.
Also, the file
property should be required in this new API for avoiding runtime checks in favor of compile-time checks.
Here is an exemple using the old API:
data class Person(val name: NotBlankString, val age: StrictlyPositiveInt, val isAdmin: Boolean = false)
suspend fun main() {
csvWriter<Person>(file = "people".toNotBlankString()) {
records { +Person("Nobody".toNotBlankString(), 25.toStrictlyPositiveInt()) }
}
val people: List<Person> = csvReader(file = "people".toNotBlankString())
println(people)
}
Checklist
- Implement a basic CSV reader.
- Implement a reader that returns a custom type.
- Deprecate the old reader.
- Implement a basic CSV writer.
- Implement a writer that takes a custom type.
- Deprecate the old writer.
- Update
Work in progress
section in changelog.