{"id":21847646,"url":"https://github.com/dzikoysk/ksb","last_synced_at":"2026-05-04T10:32:34.572Z","repository":{"id":265000574,"uuid":"870268462","full_name":"dzikoysk/ksb","owner":"dzikoysk","description":"Kotlin Scripting Bundle - my personal all-in-one set of tools for rapid prototyping \u0026 scripting","archived":false,"fork":false,"pushed_at":"2024-10-09T20:18:28.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T15:15:26.932Z","etag":null,"topics":["kotlin","script","sdk"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dzikoysk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-09T18:24:28.000Z","updated_at":"2024-10-09T20:25:44.000Z","dependencies_parsed_at":"2024-11-27T06:48:14.057Z","dependency_job_id":null,"html_url":"https://github.com/dzikoysk/ksb","commit_stats":null,"previous_names":["dzikoysk/ksb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fksb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fksb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fksb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fksb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzikoysk","download_url":"https://codeload.github.com/dzikoysk/ksb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244835574,"owners_count":20518263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","script","sdk"],"created_at":"2024-11-27T23:18:55.426Z","updated_at":"2026-05-04T10:32:34.563Z","avatar_url":"https://github.com/dzikoysk.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KSB [![Reposilite](https://maven.reposilite.com/api/badge/latest/snapshots/com%2Fdzikoysk%2Fksb?name=Reposilite)](https://maven.reposilite.com/#/snapshots/com/dzikoysk/ksb)\n\n**ksb** \u003csup\u003e_(Kotlin Scripting Bundle)_\u003c/sup\u003e - all-in-one set of tools for rapid prototyping \u0026 scripting. Use `ksb` object as an entry point to the whole API.\nYou don't need to remember nor import anything from the library, just discover all you need via the intellisense.\n\n```kotlin\nrepository {\n    maven(\"https://maven.reposilite.com/snapshots\")\n}\n\ndependencies {\n    implementation(\"com.dzikoysk:ksb:0.0.8-SNAPSHOT\")\n}\n```\n\n## Docs\n\nBundled APIs:\n* General: Jackson (for Kotlin), BCrypt, Logback\n* HTTP: Client - Unirest, Server - Javalin\n* Database: JDBI (PostgreSQL / SQLite / MySQL)\n* AWS: SDKv1 \u0026 SDKv2\n\n### Serialization\n\n* JSON\n\n```kotlin\ndata class Monke(\n    val name: String\n)\n\nval json: String = Monke(\"Młynarz\").toJson() // available for any object\nval deserializedObject: Monke = json.convertTo()\n```\n\n* CSV _(todo)_\n\n### HTTP\n\nServing the API:\n\n```kotlin\nval (server, address) = ksb.http.server.start { \n    get(\"/api/read\") { it.result(\"Monke\") }\n    post(\"/api/write\") { println(it.body()) }\n}\n```\n\nInteracting with the API:\n\n```kotlin\nval (_, statusCode, headers) = ksb.http.head(\"https://github.com/dzikoysk/ksb\")\nval (body, statusCode, headers) = ksb.http.get(\"https://github.com/dzikoysk/ksb\")\nval (body, statusCode, headers) = ksb.http.delete(\"https://github.com/dzikoysk/ksb\")\n\nval (body, statusCode, headers) = ksb.http.post(\"https://github.com/dzikoysk/ksb\", Monke(\"Młynarz\").toJson())\nval (body, statusCode, headers) = ksb.http.update(\"https://github.com/dzikoysk/ksb\", Monke(\"Młynarz\").toJson())\n\nval (body, statusCode, headers) = ksb.http.patch(\n    url = \"https://github.com/dzikoysk/ksb\", \n    value = Monke(\"Młynarz\").toJson(),\n    headers = mapOf(\"X-API-KEY\" to \"123\")\n)\n\nval monke = body.readText() / body.readAsObject\u003cMonke\u003e()\n```\n\nGraphQL\n\n```kotlin\ndata class MonkeData(val monke: Monke) {\n    data class Monke(val name: String)\n}\n\nval response = ksb.http.gql.query\u003cMonkeData\u003e(\"$url/graphql\", mapOf(\"x-api-key\" to \"secret\")) { \n    \"query Monke { name }\" \n}\n\nval monke: Monke = response.get().data.monke\n```\n\n### File System\n\n```kotlin\nksb.fs.override(\"monke.txt\") { \"Monke\" }\nval content = ksb.fs.read(\"monke.txt\")\n```\n\n### CSV\n\n* Using rows\n\n```kotlin\nval elements = listOf(1, 2, 3)\n\nval csv = ksb.csv.rows(elements) {\n    cell { \"input\" to it }\n    cell { \"double\" to it * 2 }\n    cell { \"triple\" to it * 3 }\n}\n\n// input,double,triple\n// 1,2,3\n// 2,4,6\n// 3,6,9\ncsv.toString()\n\n// input,double,triple\n// 3,6,9\n// 2,4,6\n// 1,2,3\ncsv.toString(sortedBy = listOf(\"triple\" to DESC))\n```\n\n* Using columns\n\n```kotlin\nksb.csv(\n    \"input\" to listOf(1, 2, 3),\n    \"double\" to listOf(2, 4, 6),\n    \"triple\" to listOf(3, 6, 9),\n)\n```\n\n### SQL\n\n* JDBI\n\n### Cloud\n\n* AWS S3 _(todo)_\n* Google Drive _(todo)_\n\n### Data types\n\n* `Quad\u003cA, B, C, D\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikoysk%2Fksb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzikoysk%2Fksb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikoysk%2Fksb/lists"}