{"id":18005887,"url":"https://github.com/brianhicks/elm-csv","last_synced_at":"2025-07-30T05:04:53.087Z","repository":{"id":45970141,"uuid":"331687683","full_name":"BrianHicks/elm-csv","owner":"BrianHicks","description":"Decode CSV in the most boring way possible.","archived":false,"fork":false,"pushed_at":"2024-05-29T13:55:03.000Z","size":248,"stargazers_count":32,"open_issues_count":3,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-27T04:28:37.788Z","etag":null,"topics":["csv","elm"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/BrianHicks/elm-csv/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrianHicks.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":"2021-01-21T16:33:24.000Z","updated_at":"2025-05-17T13:15:59.000Z","dependencies_parsed_at":"2024-03-06T13:42:08.536Z","dependency_job_id":"c6a4e879-1805-4406-bd10-8f9c91d098ef","html_url":"https://github.com/BrianHicks/elm-csv","commit_stats":{"total_commits":259,"total_committers":3,"mean_commits":86.33333333333333,"dds":0.02316602316602312,"last_synced_commit":"3ee8d60614d8dd6028e4e67c8696eabcb1dc22a6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/BrianHicks/elm-csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHicks%2Felm-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHicks%2Felm-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHicks%2Felm-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHicks%2Felm-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrianHicks","download_url":"https://codeload.github.com/BrianHicks/elm-csv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHicks%2Felm-csv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267814349,"owners_count":24148328,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","elm"],"created_at":"2024-10-30T00:22:23.849Z","updated_at":"2025-07-30T05:04:53.049Z","avatar_url":"https://github.com/BrianHicks.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-csv\n\nDecode CSV in the most boring way possible.\nOther CSV libraries have exciting, innovative APIs... not this one!\nPretend you're writing a [JSON decoder](https://package.elm-lang.org/packages/elm/json/latest/), gimme your data, get on with your life.\n\n```elm\nimport Csv.Decode as Decode exposing (Decoder)\n\n\ndecoder : Decoder ( Int, Int, Int )\ndecoder =\n    Decode.map3 (\\r g b -\u003e ( r, g, b ))\n        (Decode.column 0 Decode.int)\n        (Decode.column 1 Decode.int)\n        (Decode.column 2 Decode.int)\n\n\ncsv : String\ncsv =\n    \"0,128,128\\r\\n112,128,144\"\n\n\nDecode.decodeCsv Decode.NoFieldNames decoder csv\n--\u003e Ok\n--\u003e     [ ( 0, 128, 128 )\n--\u003e     , ( 112, 128, 144 )\n--\u003e     ]\n```\n\nHowever, in an effort to avoid a common problem with `elm/json` (\"How do I decode a record with more than 8 fields?\") this library also exposes a pipeline-style decoder ([inspired by `NoRedInk/elm-json-decode-pipeline`](https://package.elm-lang.org/packages/NoRedInk/elm-json-decode-pipeline/latest/)) for records:\n\n```elm\nimport Csv.Decode as Decode exposing (Decoder)\n\n\ntype alias Pet =\n    { id : Int\n    , name : String\n    , species : String\n    , weight : Maybe Float\n    }\n\n\ndecoder : Decoder Pet\ndecoder =\n    Decode.into Pet\n        |\u003e Decode.pipeline (Decode.field \"id\" Decode.int)\n        |\u003e Decode.pipeline (Decode.field \"name\" Decode.string)\n        |\u003e Decode.pipeline (Decode.field \"species\" Decode.string)\n        |\u003e Decode.pipeline (Decode.field \"weight\" (Decode.blank Decode.float))\n\n\ncsv : String\ncsv =\n    \"id,name,species,weight\\r\\n1,Atlas,cat,14.5\\r\\n2,Pippi,dog,\"\n\n\nDecode.decodeCsv Decode.FieldNamesFromFirstRow decoder csv\n--\u003e Ok\n--\u003e     [ { id = 1, name = \"Atlas\", species = \"cat\", weight = Just 14.5 }\n--\u003e     , { id = 2, name = \"Pippi\", species = \"dog\", weight = Nothing }\n--\u003e     ]\n```\n\n## FAQ\n\n### Can this do TSVs too? What about European-style CSVs that use semicolon instead of comma?\n\nYes to both!\nUse `decodeCustom`.\nIt takes a field and row separator string, which can be whatever you need.\n\n### Aren't there like (*checks*) 8 other CSV libraries already?\n\nYes, there are!\nWhile I appreciate the hard work that other people have put into those, there are a couple problems:\n\nFirst, you need to put together multiple libraries to successfully parse CSV.\nBefore this package was published, you had to pick one package for parsing to `List (List String)` and another to decode from that into something you actually cared about.\nProps to those authors for making their hard work available, of course, but this situation bugs me!\n\nI don't want to have to pick different libraries for parsing and converting.\nI just want it to work like `elm/json` where I write a decoder, give the package a string, and handle a `Result`.\nThis should not require so much thought!\n\nThe second thing, and the one that prompted me to publish this package, is that none of the libraries available at the time implemented `andThen`.\nSure, you can use a `Result` to do whatever you like, but there's not a good way to make a decoding decision for one field dependent on another.\n\n## Contributing\n\nHello!\nI'm so glad that you're interested in contributing to `elm-csv`!\nJust so you know, I consider this library \"done\".\nUnless something major changes in either the CSV standard or Elm, major changes are unlikely.\nIf you want to make a case for new decoder functions (or whatever) being added to the package feel free to do so (in an issue, not a PR!), but be aware the bar is fairly high for new inclusions.\n\nThat said, I'll be publishing upgrades to track with new versions of Elm, and bug fixes as needed.\nI always welcome help with those, and with documentation improvements!\n\nStill here?\nOk, let's get set up.\nThis project uses [Nix](https://nixos.org/download.html) to manage versions (but just need a `nix` installation, not NixOS, so this will work on macOS.)\nInstall that, then run `nix-shell` to get into a development environment.\n\nThings I'd appreciate help with:\n\n- **Testing the parser on many kinds of CSV and TSV data.**\n  If you find that the parser has incorrectly interpreted some data you have, please open an issue.\n  It would be very helpful if you could include a sample of the input that's giving you problems, the versions of the software used to produce the sample, and the locale settings on your computer.\n\n- **Feedback on speed.**\n  Please let me know if you find out that parsing/decoding has become a bottleneck in your application.\n  Our parser is fairly quick (see `benchmarking` in the source) but we can always go faster.\n\n- **Docs.**\n  Always docs.\n  Forever docs.\n\n## Climate Action\n\nI want my open-source work to support projects addressing the climate crisis (for example, projects in clean energy, public transit, reforestation, or sustainable agriculture.)\nIf you are working on such a project, and find a bug or missing feature in any of my libraries, **please let me know and I will treat your issue as high priority.**\nI'd also be happy to support such projects in other ways.\nIn particular, I've worked with Elm for a long time and would be happy to advise on your implementation.\n\n## License\n\n`elm-csv` is licensed under the BSD 3-Clause license, located at `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhicks%2Felm-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianhicks%2Felm-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhicks%2Felm-csv/lists"}