Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seratch/ltsv4s
LTSV parser implementation in Scala
https://github.com/seratch/ltsv4s
Last synced: about 1 month ago
JSON representation
LTSV parser implementation in Scala
- Host: GitHub
- URL: https://github.com/seratch/ltsv4s
- Owner: seratch
- License: apache-2.0
- Created: 2013-02-08T07:34:41.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2023-02-13T03:45:25.000Z (over 1 year ago)
- Last Synced: 2024-08-25T00:53:36.985Z (3 months ago)
- Language: Scala
- Homepage:
- Size: 44.9 KB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# LTSV4S
LTSV Parser implementation in Scala
[![Build Status](https://travis-ci.org/seratch/ltsv4s.svg?branch=develop)](https://travis-ci.org/seratch/ltsv4s)
[![Coverage Status](https://coveralls.io/repos/seratch/ltsv4s/badge.png?branch=develop)](https://coveralls.io/r/seratch/ltsv4s?branch=develop)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.seratch/ltsv4s_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.seratch/ltsv4s_2.13)## What's LTSV?
http://ltsv.org/
## Usage
### sbt settings
Add ltsv4s to libraryDependencies.
```scala
libraryDependencies += "com.github.seratch" %% "ltsv4s" % "1.0.+"
```### Example
```scala
import com.github.seratch.ltsv4s._val log: Map[String, String] = LTSV.parseLine("field1:value1\tfield2:value2")
val line: String = LTSV.dump(log)val logs: List[Map[String, String]] = LTSV.parseLines("field1:value1\tfield2:value2\nfield1:value1\tfield2:value2")
val lines: List[String] = LTSV.dump(logs)
```In lenient mode, the parser will allow any character in a field value, apart from tab and newline chars.
```scala
val ltsv: Map[String, String] = LTSV.parseLine("name:クリス\tage:28", lenient=true)
ltsv.size should equal(2)
ltsv("name") should equal("クリス")
```## How to release this library
```bash
sbt test
sbt ++publishSigned sonatypeBundleRelease
```## License
Copyright 2013 - Kazuhiro Sera
Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.html