22 lines
839 B
Kotlin
Vendored
22 lines
839 B
Kotlin
Vendored
import org.jetbrains.kotlinx.dataframe.*
|
|
import org.jetbrains.kotlinx.dataframe.annotations.*
|
|
import org.jetbrains.kotlinx.dataframe.api.*
|
|
import org.jetbrains.kotlinx.dataframe.io.*
|
|
import java.net.URI
|
|
|
|
fun box(): String {
|
|
val sample = dataFrameOf("full_name", "html_url", "stargazers_count", "topics", "watchers")(
|
|
"JetBrains/JPS", URI("https://github.com/JetBrains/JPS").toURL(), 23, "[]", 23
|
|
)
|
|
|
|
val organizations = listOf("https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv")
|
|
organizations.forEach { organization ->
|
|
val df = DataFrame.readCSV(organization).castTo(sample)
|
|
println(organizations)
|
|
println("Repositories: ${df.count()}")
|
|
println("Top 10:")
|
|
df.sortBy { stargazers_count.desc() }.take(10).print()
|
|
}
|
|
return "OK"
|
|
}
|