![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
io.github.blackmo18:kotlin-grass-jvm
Advanced tools
Csv File to Kotlin Data Class Parser
Currently, it requires to have@ExperimentalStdlibApi
on the class/method using this Library.
Requires kotlin-csv by doyaaaaaken for reading csv file.
//doyaaaaaken's kotlin-csv
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:0.15.2")
//kotlin-grass
implementation("io.github.blackmo18:kotlin-grass-jvm:0.7.1")
<dependency>
<groupId>com.github.doyaaaaaken</groupId>
<artifactId>kotlin-csv-jvm</artifactId>
<version>0.15.2</version>
</dependency>
<dependency>
<groupId>io.github.blackmo18</groupId>
<artifactId>kotlin-grass-jvm</artifactId>
<version>0.7.1</version>
</dependency>
short | int | long | float | double | boolean | string |
---|---|---|---|---|---|---|
0 | 1 | 2 | 3.0 | 4.0 | true | hello |
data class PrimitiveTypes(
val short: Short,
val int: Int,
val long: Long,
val float: Float,
val double: Double,
val boolean: Boolean,
val string: String
)
If a variable in your data class is a nullable, all you have to do is mark it with ?
data class NullableData(
val nullableString: String?,
val nullableInt: Int? = null,
...
)
val csvContents = csvReader().readAllWithHeader(file)
val dataClasses = grass<PrimitiveTypes>().harvest(csvContents)
val contents = File("file/path").inputStream()
val dataClasses: Flow<PrimitiveTypes> = csvReader().openAsync(contents) {
val data = readAllWithHeaderAsSequence().asFlow()
grass<PrimitiveTypes>().harvest(data)
}
Option | default value | description |
---|---|---|
dateFormat | yyyy-MM-dd | date format |
timeFormat | HH:mm | time format |
dateTimeSeparator | (space) | date time separator |
trimWhiteSpace | true | trims white spaces on csv entries |
ignoreUnknownFields | false | ignore unknown / unmapped fields in input |
caseSensitive | true | case sensitive header matching |
customKeyMap | null | Map<String,String> custom key mapping, priority if not empty or null |
customKeyMapDataProperty | null | Map<String, KProperty<*>> custom key mapping |
time | datetime | date |
---|---|---|
12:00 | 2020-12-31 12:00 | 2020-12-31 |
data class DateTimeTypes(
val time: LocalTime,
val datetime: LocalDateTime,
val date: LocalDate,
)
val grass = grass<DateTimeTypes> {
dateFormat = "MM-dd-yyyy"
timeFormat = "HH:mm:ss"
dateTimeSeparator = "/"
}
hour | birthdate |
---|---|
12:00 | 2020-12-31 |
data class DateTime(
val time: LocalTime,
val date: LocalDate,
)
val grass = grass<DateTimeTypes> {
customKeyMap = mapOf("hour" to "time", "birthdate" to "date")
}
// or
val grass = grass<DateTimeTypes> {
customKeyMapDataProperty = mapOf("hour" to DateTime::time, "birthdate" to DateTime::date)
}
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 blackmo18.
This project is Apache License 2.0 licensed.
This project inspired ❤️ by kotlin-csv
FAQs
Unknown package
We found that io.github.blackmo18:kotlin-grass-jvm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.