package ledes

  1. Overview
  2. Docs
Legal Electronic Data Exchange Standard

Install

Dune Dependency

Authors

Maintainers

Sources

ledes-0.1.0.tbz
sha256=0687b2c6627d3e5a530e2e96c83dc1ffe402cc5ce9faed0c401a5a82c9917034
sha512=bf6463929f4aaea10bf073e7391c36b4bc96c4b758116e4de9a43a50b4a55609bb5a00d6d3913a5b4973589571db2b4ed208033dc3bb321983478a411ab274e2

Description

Legal Electronic Data Exchange Standard

Tags

parser legal

Published: 29 May 2025

README

CI"

Documentation

LEDES

Legal Electronic Data Exchange Standard(https://ledes.org/)

Currently supports the parsing and validation of the following formats:

  • LEDES98BI
  • LEDES1998B

Two errors reporting modes are supported:

  • eager: the first error encountered is bubbled up, fast path
  • greedy: collects all errors, slow path

Parsing example

open Ledes

let read_lines filename =
  let lines = ref [] in
  let ic = open_in filename in
  try
    while true do
      let line = input_line ic in
      lines := line :: !lines
    done;
    []
  with End_of_file ->
    close_in ic;
    List.rev !lines

let lines = read_lines "ledes98bi.txt" in
  let err = Ledes1998b.parse_and_validate_greedy lines in
  if err = [] then print_endline "successful" else print_endline @@ String.concat "\n" err;

Command line utility

A CLI app is also included which supports processing a LEDES file or a data string

Download the latest release:

Linux: https://github.com/Lexitree-Labs/LEDES/releases/download/0.1.0/ledes_cli_linux

MACOS: https://github.com/Lexitree-Labs/LEDES/releases/download/0.1.0/ledes_cli_macos

WINDOWS: https://github.com/Lexitree-Labs/LEDES/releases/download/0.1.0/ledes_cli_windows.exe

NAME
       ledes_cli - A tool for parsing and validating LEDES file format
       Example: ledes_cli_linux -- --eager --LEDES1998B --file /path/to/ledes199b

SYNOPSIS
       ledes_cli [OPTION]…

Error collection options
       --eager
           Eager mode stops on first error encountered

       --greedy
           Greedy mode collects all error encountered

Data format options
       --LEDES1998B
           Process LEDES1998B data format

       --LEDES98BI
           Process Use LEDES98BI data format

Input options
       --file=FILE
           Specify data file location

       --line=LINE
           Specify data string

CAVEAT

Certain field validations, e.g. field totals which are open to interpretations on both sending and receiving end are omitted. Due to certain LEDES standard inconsistencies, few fields are validated in a more stricter fashion for total correctness.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in LEDES by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies (6)

  1. re >= "1.7.2"
  2. ptime
  3. angstrom >= "0.16.0"
  4. cmdliner >= "1.2.0"
  5. ocaml >= "4.08.0"
  6. dune >= "3.18"

Dev Dependencies (2)

  1. odoc with-doc
  2. ppx_expect with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.