argo

A lightweight j(a)son library.

https://github.com/moderocky/argo

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.6%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

A lightweight j(a)son library.

Basic Info
  • Host: GitHub
  • Owner: Moderocky
  • License: mit
  • Language: Java
  • Default Branch: master
  • Size: 121 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Argo

Opus #18

A lightweight J(a)son library.

Description

This library converts json to Java's map/list object structure and vice-versa. \ It is designed to be very small (one file plus a JsonException for nicer errors.) \ It is designed to be as light as possible (interacts directly with streams with a ~16 byte buffer) and disposes of any closeable resources.

Json arrays are converted to ArrayLists for easier modification.

It is also possible to convert Java objects to and from json data directly. Note that the data is applied to the appropriate fields. Fields with illegal Java names (e.g. containing whitespace) will be ignored. Errors will be thrown if the field cannot be written to or the data is incompatible.

This is mainly designed for use with local classes for simpler data dispersion. Converting a json array will not convert its Object contents.

Maven Information

xml <repository> <id>kenzie</id> <name>Kenzie's Repository</name> <url>https://repo.kenzie.mx/releases</url> </repository>

xml <dependency> <groupId>mx.kenzie</groupId> <artifactId>argo</artifactId> <version>1.2.2</version> </dependency>

How to Use

Reading data...

From a json object: ```java // data = { "hello": true, "there": null } // data is String / File / InputStream try (final Json json = new Json(data)) { final Map map = json.toMap(); }

// Simple string -> map final Map map = Json.fromJson(data); ```

From a json array: java // data = [ 1, 2, 3 ] // data is String / File / InputStream try (final Json json = new Json(data)) { final List<Object> list = json.toList(); }

Writing as json data: ```java // output is a File / Writer // map is the data new Json(output).write(map);

// fast object to json string Json.toJson(map); // -> { ... } Json.toJson(list); // -> [ ... ] ```

Converting json to an object: java class Result { int a, b; String hello; } final String string = // { "a": 1, "b": 6, "hello": "there" } final Result result = Json.fromJson(string, new Result());

Converting an object to json: java class Child { int bean = 3; } class Result { String hello = "there"; Child child = new Child(); } final Result result = new Result(); final String string = Json.toJson(result); // string = { "hello": "there", "child": { "bean": 3 } }

Converting a type with an array: java // data = { "numbers": [0.5, 2.2, ...], "children": [ ... ] } class Result { double[] numbers; Child[] children; } final Result result = Json.fromJson(data, new Result()); assert result.numbers[1] == 2.2;

Owner

  • Name: Moderocky
  • Login: Moderocky
  • Kind: user
  • Location: United Kingdom
  • Company: @SkriptLang

Specialist in metaprogramming tools, compilers and interpreters. Lead @ ByteSkript Lead @ SkriptLang

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Scott"
  given-names: "Mackenzie"
title: "Argo"
version: 1.2.2
date-released: 2022-07-11
url: "https://github.com/Moderocky/Argo"

GitHub Events

Total
Last Year

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 52
  • Total Committers: 1
  • Avg Commits per committer: 52.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Moderocky a****n@m****m 52
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 17 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • bluelhf (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pom.xml maven
  • org.jetbrains:annotations 23.0.0 provided
  • junit:junit 4.13.2 test