Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ma2gedev/ltsvex
LTSV parser implementation in Elixir
https://github.com/ma2gedev/ltsvex
Last synced: 2 months ago
JSON representation
LTSV parser implementation in Elixir
- Host: GitHub
- URL: https://github.com/ma2gedev/ltsvex
- Owner: ma2gedev
- License: mit
- Created: 2013-12-15T15:14:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-13T12:22:42.000Z (over 9 years ago)
- Last Synced: 2024-11-01T09:34:36.177Z (3 months ago)
- Language: Elixir
- Size: 249 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - LTSV parser implementation in Elixir. (Text and Numbers)
- fucking-awesome-elixir - ltsvex - LTSV parser implementation in Elixir. (Text and Numbers)
- awesome-elixir - ltsvex - LTSV parser implementation in Elixir. (Text and Numbers)
README
# LTSV - A Pure Elixir LTSV Parser
[![hex.pm version](https://img.shields.io/hexpm/v/ltsv.svg)](https://hex.pm/packages/ltsv) [![hex.pm downloads](https://img.shields.io/hexpm/dt/ltsv.svg)](https://hex.pm/packages/ltsv) [![Build Status](https://travis-ci.org/ma2gedev/ltsvex.svg?branch=master)](https://travis-ci.org/ma2gedev/ltsvex) [![Coverage Status](https://img.shields.io/coveralls/ma2gedev/ltsvex.svg)](https://coveralls.io/r/ma2gedev/ltsvex)
A Labeled Tab-separated Values parser implementation in Elixir
## What's LTSV?
http://ltsv.org/
## Installation
Add `:ltsv` library to your project's dependencies in `mix.exs`:
```elixir
defp deps do
[
{:ltsv, "~> 0.1"}
]
end
```And fetch:
```
$ mix deps.get
```## Usage
### Parse a ltsv string
```
iex> LTSV.parse("name:taka\taddress:Seattle\\nname:neko\taddress:near") |> Enum.map(&Dict.to_list/1)
[[{"name", "taka"}, {"address", "Seattle"}], [{"name", "neko"}, {"address", "near"}]]
```### Dump a list of `Dict`s into a ltsv string
```
iex> LTSV.dump [%{"address" => "Seattle", "name" => "taka"}, %{"address" => "Chicago", "name" => "tetsuo"}]
"address:Seattle\tname:taka\naddress:Chicago\tname:tetsuo"iex> LTSV.dump [%{name: "taka"}]
"name:taka"
```## Documentation
http://hexdocs.pm/ltsv/
## License
Copyright © 2014 Takayuki Matsubara, released under the MIT license.