Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yegor256/tojos
Text Object Java Objects (TOJOs): an object representation of a multi-line structured text file like CSV, YAML, or JSON
https://github.com/yegor256/tojos
csv file-format java json
Last synced: 3 months ago
JSON representation
Text Object Java Objects (TOJOs): an object representation of a multi-line structured text file like CSV, YAML, or JSON
- Host: GitHub
- URL: https://github.com/yegor256/tojos
- Owner: yegor256
- License: mit
- Created: 2021-12-23T16:54:45.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T16:29:41.000Z (3 months ago)
- Last Synced: 2024-10-23T22:57:11.790Z (3 months ago)
- Topics: csv, file-format, java, json
- Language: Java
- Homepage:
- Size: 206 KB
- Stars: 19
- Watchers: 5
- Forks: 9
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# NoSQL Single-File Database
[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/tojos)](http://www.rultor.com/p/yegor256/tojos)
[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)[![mvn](https://github.com/yegor256/tojos/actions/workflows/mvn.yml/badge.svg)](https://github.com/yegor256/tojos/actions/workflows/mvn.yml)
[![PDD status](http://www.0pdd.com/svg?name=yegor256/tojos)](http://www.0pdd.com/p?name=yegor256/tojos)
[![Maintainability](https://api.codeclimate.com/v1/badges/742bde48ea6fabdba1ce/maintainability)](https://codeclimate.com/github/yegor256/tojos/maintainability)
[![Maven Central](https://img.shields.io/maven-central/v/com.yegor256/tojos.svg)](https://maven-badges.herokuapp.com/maven-central/com.yegor256/tojos)
[![Javadoc](http://www.javadoc.io/badge/com.yegor256/tojos.svg)](http://www.javadoc.io/doc/com.yegor256/tojos)
[![codecov](https://codecov.io/gh/yegor256/tojos/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor256/tojos)
[![Hits-of-Code](https://hitsofcode.com/github/yegor256/tojos)](https://hitsofcode.com/view/github/yegor256/tojos)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/tojos/blob/master/LICENSE.txt)It's a simple manager of "records" in a text file of CSV, JSON, etc. format.
It's something you would use when you don't want to run a full database, but
just a list of lines in a file is not enough. You need a file with structured
records.You add this to your `pom.xml`:
```xml
com.yegor256
tojos
0.18.2```
Then, to manage `books.csv` file:
```java
import com.yegor256.tojos.MnCsv;
import com.yegor256.tojos.TjDefault;
import com.yegor256.tojos.Tojo;
import com.yegor256.tojos.Tojos;Tojos tojos = new TjDefault(new MnCsv("books.csv"));
Tojo t1 = tojos.add("Object Thinking"); // unique ID
t1.set("author", "David West");
Tojo t2 = tojos.select(
t -> t.get("author").equals("David West")
).get(0);
```Each record has a unique ID, which is also the first column.
## How to Contribute
Fork repository, make changes, send us a [pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).
We will review your changes and apply them to the `master` branch shortly,
provided they don't violate our quality standards. To avoid frustration,
before sending us your pull request please run full Maven build:```bash
mvn clean install -Pqulice
```You will need Maven 3.3+ and Java 8+.