An mbox parser in Gleam
Find a file
2024-03-23 22:38:51 +05:30
.github/workflows kinda sorta print headers 2024-03-23 19:08:06 +05:30
src mbox -> gleambox 2024-03-23 22:21:50 +05:30
test fix things around 2024-03-23 22:27:24 +05:30
.gitignore kinda sorta print headers 2024-03-23 19:08:06 +05:30
gleam.toml fix things around 2024-03-23 22:27:24 +05:30
manifest.toml kinda sorta print headers 2024-03-23 19:08:06 +05:30
README.md update README for package name change 2024-03-23 22:38:51 +05:30

mbox

Read mbox files.

WARNING: This library is a personal project to learn Gleam. It is extremely incomplete, barely works, highly un - optimized, and is NOT guaranteed to work, in present or future. I do intend to make it useable and utilise in another project, but right now, if you use it and it breaks stuff, you get to keep all the pieces. Be warned and prosper.

Package Version Hex Docs

gleam add mbox
import gleambox
import simplifile

pub fn main() {
  let mboxcontents =
    "/path/to/file"
    |> simplifile.read
    |> result.unwrap(or: "")

  mboxcontents
  |> gleambox.get_headers
  |> dict.to_list
  |> list.map(io.debug)

  mboxcontents
  |> gleambox.get_body
  |> io.println
}

Further documentation can be found at https://hexdocs.pm/gleambox.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell