{"id":37016229,"url":"https://github.com/sergejsha/csv","last_synced_at":"2026-01-14T01:49:26.886Z","repository":{"id":198689423,"uuid":"701254245","full_name":"sergejsha/csv","owner":"sergejsha","description":"Tiny Kotlin Multiplatform library for parsing and building CSV strings","archived":false,"fork":false,"pushed_at":"2025-12-21T14:21:08.000Z","size":350,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-23T03:21:42.791Z","etag":null,"topics":["csv","csv-export","csv-parser","csv-reader","kotlin-multiplatform"],"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/sergejsha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-06T08:55:55.000Z","updated_at":"2025-12-21T14:21:12.000Z","dependencies_parsed_at":"2023-11-11T21:24:06.626Z","dependency_job_id":"5780f13e-2790-488b-9688-d25800841185","html_url":"https://github.com/sergejsha/csv","commit_stats":null,"previous_names":["sergejsha/csv"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/sergejsha/csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Fcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Fcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Fcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Fcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergejsha","download_url":"https://codeload.github.com/sergejsha/csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Fcsv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csv","csv-export","csv-parser","csv-reader","kotlin-multiplatform"],"created_at":"2026-01-14T01:49:26.222Z","updated_at":"2026-01-14T01:49:26.880Z","avatar_url":"https://github.com/sergejsha.png","language":"Kotlin","readme":"[![Maven Central](http://img.shields.io/maven-central/v/de.halfbit/csv.svg)](https://central.sonatype.com/artifact/de.halfbit/csv)\n![maintenance-status](https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg)\n\nFeel free to open PRs for features you miss, please remember keeping API minimalistic, predictable and self-explanatory.\n\n# 🗂 CSV ️\n\nSmall, fast and convenient multiplatform CSV parser and builder written for one of my projects, and then shared with awesome Kotlin community.\n\n# Architecture\n\n\u003cimg src=\"http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/sergejsha/csv/master/documentation/architecture.v3.iuml\"\u003e\n\n# Usage\n\nHere is what you can do with the library:\n```kotlin\n\n// (1) build csv\nval csv = buildCsv {\n    header {\n        column(\"Code\")\n        column(\"Name\")\n    }\n    data {\n        value(\"DE\")\n        value(\"Deutschland\")\n    }\n    data {\n        value(\"BY\")\n        value(\"Belarus\")\n    }\n} as CsvWithHeader\n\nval code = csv.header.columnByName(\"Code\") as CsvColumn\nval name = csv.header.columnByName(\"Name\") as CsvColumn\n\nassertEquals(code, CsvColumn(0, \"Code\"))\nassertEquals(name, CsvColumn(1, \"Name\"))\nassertEquals(csv.data[0][code.index], \"DE\")\nassertEquals(csv.data[0][name.index], \"Deutschland\")\nassertEquals(csv.data[1][code.index], \"BY\")\nassertEquals(csv.data[1][name.index], \"Belarus\")\n\n// (2) csv to text\nval csvText = csv.toCsvText()\nassertEquals(\"Code,Name\\nDE,Deutschland\\nBY,Belarus\\n\", csvText)\n\n// (3) parse csv text\nval csv2 = CsvWithHeader.fromCsvText(csvText) as CsvWithHeader\n\nassertEquals(csv.header, csv2.header)\nassertEquals(csv.data, csv2.data)\nassertEquals(csv.allRows, csv2.allRows)\n\n// (4) transform csv\nval csv3 = csv.copy(\n    data = csv.data.map { row -\u003e\n        row.mapValueOf(name) { value -\u003e\n            if (value == \"Belarus\") \"Weißrussland\" else value\n        }\n    }\n)\nassertEquals(\"Code,Name\\nDE,Deutschland\\nBY,Weißrussland\\n\", csv3.toCsvText())\n```\n\n# Dependencies\n\nIn `gradle/libs.versions.toml`\n```toml\n[versions]\nkotlin = \"2.3.0\"\ncsv = \"1.3\"\n\n[libraries]\ncsv = { module = \"de.halfbit:csv\", version.ref = \"csv\" }\n\n[plugins]\nkotlin-multiplatform = { id = \"org.jetbrains.kotlin.multiplatform\", version.ref = \"kotlin\" }\n```\n\nIn `shared/build.gradle.kts`\n```kotlin\nplugins {\n    alias(libs.plugins.kotlin.multiplatform)\n}\n\nkotlin {\n    sourceSets {\n        commonMain.dependencies {\n            implementation(libs.csv)\n        }\n    }\n}\n```\n\n# Releasing\n\n1. Bump version in `build.gradle.kts` of the root project\n2. `./gradlew clean build releaseToMavenCentral`\n\n# License\n```\nCopyright 2023-2025 Sergej Shafarenka, www.halfbit.de\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergejsha%2Fcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergejsha%2Fcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergejsha%2Fcsv/lists"}