CSV Files (Reading/Writing)

What is the standard way to work with CSV Files?

I do not want to use any of Jane Street’s packages. Among other reasons, there is no documentation for a couple of csv related packages provided by JS.

There is also the very old and unmaintened package csv that I am not sure if I should be using it today.

Why not? Afaik the CSV format has not changed since 2019.

1 Like

Docs and a basic example for reading CSVs are available here. The README also mentions an example directory (although it seems to be absent from GitHub, maybe a bug in the export script).

I’m using csv for an internal tool at work handling production data. The only one bug I’ve reported was spotted on very specific case, and I got some reactivity from the team. So I can’t say the library is not maintened, for me it’s just working as expected.

2 Likes

The provided links are for a different package.
The links given on the package’s page csv are dead.

Thanks a lot for your reply. Indirectly it was very helpful.
It looks like the search for packages on ocaml org leads to a page with broken links.

I should have used directly opam.ocaml.org/packages/

Thanks for the information

You were mentioning Jane Street packages, so I pointed to the Jane Street package that provides CSV readers. The package named csv is not maintained by Jane Street.

Looks like these relative links only work on GitHub from the README view, and doesn’t get translated correctly when exported to the OCaml documentation website. That’s quite unfortunate, although I think the OCaml documentation website doesn’t support linking to source code files, only module documentation.

1 Like

It does, it’s just that it hosts the source code files on its own server: csv 2.4 (latest) · OCaml Package

1 Like

Thanks for the clarification

Although, It is not part of a standard library, you can use the OWL library, which has a specific module for DataFrames that allows handling CSV files.

Also other tools are:

Thanks a lot for the info. I will check it out.