package delimited_parsing

All checked builds pass
  1. Overview
  2. Docs
Parsing of character (e.g., comma) separated and fixed-width values

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=fb9251ba0d024506a02b68606ceb5490a8373f346d2e0329e8c0db7d19d2b0de

Description

Delimited_parsing parses character-separated values (such as CSV files) and fixed-width records.

Added to opam-repository:

README

Delimited

This library contains parsers & generators for CSVs (and CSV-like delimited formats). It additionally contains some non-csv format parsers.

Reading CSVs

The Delimited.Read module contains two mechanisms for reading CSVs:

  • The applicative interface. This interface has a small learning curve but produces clean, composable and type-safe parsers for the 'a of your choice.
  • Using the pre-built Row object & requesting headers/indices directly. This is a more obvious interface but provides little protection against programmer error.

In new code you should favour the applicative interface (it's like Command.Param). See the example under example/ or ask a delimited dev for help if you're not familiar.

Writing CSVs

The Delimited.Write module contains two mechanisms for writing CSVs:

  • The main interface. Like the applicative interface for reading CSVs, this protects fairly well against programmer error and provides clean, composable and type-safe CSV generators for the 'a of your choice.
  • The row-based interface takes string lists and formats them as CSVs. There are no checks that you have the correct number or order of columns.

New code should prefer the builder interface. There's an example under example/ or you can ask a delimited dev for help.

(Technical note: the main writer interface is not an applicative functor.)

Non-CSV parsers

There are two non-csv formats supported for parsing:

  • Non_csv.character_separated_without_quoting: like CSVs but no field may contain newlines or the delimiter character as there is no quoting
  • Non_csv.Positional: parses fixed-width fields

Dependencies (6)

  1. dune >= "3.11.0"
  2. ppx_jane >= "v0.17" & < "v0.18~"
  3. core_extended >= "v0.17" & < "v0.18~"
  4. core >= "v0.17" & < "v0.18~"
  5. async >= "v0.17" & < "v0.18~"
  6. ocaml >= "5.1.0"

Dev Dependencies

None

Optional Dependencies

None

Used by (2)

  1. core_bench >= "v0.17.0"
  2. janestreet_csv >= "v0.17.0"

Conflicts

None

Build status

Results of building delimited_parsing with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
v0.17.0 (this version) n/a n/a good good good
v0.16.0 n/a good good n/a n/a
v0.15.0 good good n/a n/a n/a
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure