{"id":15061186,"url":"https://github.com/puripuri2100/yojson-rs","last_synced_at":"2025-04-10T13:32:37.621Z","repository":{"id":57672756,"uuid":"331303685","full_name":"puripuri2100/yojson-rs","owner":"puripuri2100","description":"yojson parser for Rust","archived":false,"fork":false,"pushed_at":"2021-04-22T16:48:58.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:11:29.350Z","etag":null,"topics":["cargo","crates","json","json-parser","ocaml","rust","yojson"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puripuri2100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-20T12:42:13.000Z","updated_at":"2022-06-24T15:17:35.000Z","dependencies_parsed_at":"2022-08-31T08:11:04.819Z","dependency_job_id":null,"html_url":"https://github.com/puripuri2100/yojson-rs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puripuri2100%2Fyojson-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puripuri2100%2Fyojson-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puripuri2100%2Fyojson-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puripuri2100%2Fyojson-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puripuri2100","download_url":"https://codeload.github.com/puripuri2100/yojson-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","crates","json","json-parser","ocaml","rust","yojson"],"created_at":"2024-09-24T23:11:22.059Z","updated_at":"2025-04-10T13:32:37.595Z","avatar_url":"https://github.com/puripuri2100.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yojson-rs: JSON library for Rust\n\n[![crates.io][crates-badge]][crates]\n[![docs.rs][docs-badge]][docs]\n[![Build Status][ci-badge]][ci]\n[![source badge][source-badge]][source]\n[![license badge][license-badge]][license]\n\n[crates]: https://crates.io/crates/yojson-rs\n[crates-badge]: https://img.shields.io/crates/v/yojson-rs\n[docs]: https://docs.rs/yojson-rs/\n[docs-badge]: https://img.shields.io/badge/docs.rs-yojson_rs-blue\n[ci]: https://github.com/puripuri2100/yojson-rs/actions?query=workflow%3ACI\n[ci-badge]: https://github.com/puripuri2100/yojson-rs/workflows/CI/badge.svg?branch=master\n[source]: https://github.com/puripuri2100/yojson-rs\n[source-badge]: https://img.shields.io/badge/source-github-blue\n[license]: https://github.com/puripuri2100/yojson-rs/blob/master/LICENSE\n[license-badge]: https://img.shields.io/badge/license-MIT-blue\n\n\nThis library parses [JSON data (yojson format)](https://mjambon.github.io/mjambon2016/yojson.html) into a nested Rust tree data structure.\n\n# Yojson values\n\nA value in Yojson is represented with the `Value` enum in this crate:\n\n```rust\npub enum Value {\n  Null,\n  Bool(bool),\n  Integer(i64),\n  Float(f64),\n  String(String),\n  Assoc(Assoc),\n  Array(Array),\n  Tuple(Vec\u003cValue\u003e),\n  Variant(Variant),\n}\n```\n\nThe Yojson format is an extension of the JSON format. See [\"Yojson format document\"](https://mjambon.github.io/mjambon2016/yojson.html) for more information.\n\n- Tuples: like JSON arrays but within parentheses instead of square brackets, such as `(1.23, 4.56)`.\n- Variants without argument: `\u003c\"Foo\"\u003e`.\n- Variants with one argument: `\u003c\"Bar\": 123\u003e`.\n- Unquoted field names and variants are accepted if they match the pattern `[A-Za-z][A-Za-z_0-9]*`: `{ x: \u003cFoo\u003e, \"#y\": \u003cBar2\u003e }`.\n- Comments: `/* multiline comment */` and `// end-of-line comment`.\n- Special numeric entities: `[ Infinity, -Infinity, NaN ]`.\n\n# Parsing JSON\n\nParse JSON data.\n\n```rust\nuse yojson_rs;\nfn main () {\n  let json = r#\"\n    {\n      x : 123,\n      y : {\n            \"y1\" : \"abc\\ndef\\u0021\",\n            \"y2\" : [null, 123.45, (12, \"y3\")]\n          },\n      z : NaN\n    }\n    \"#;\n  assert!(yojson_rs::parser::parse(json).is_ok());\n}\n```\n\n# Convert to a JSON string.\n\nA data structure can be converted to a JSON string by `to_string`.\n\n```rust\nuse yojson_rs;\nfn main() {\n  let json_str = r#\"\n    {\n      x : 123,\n      y : {\n             \"y1\" : \"abc\\ndef\\u0021\",\n             \"y2\" : [null, 123.45, (12, \"y3\")]\n          },\n      z : NaN\n    }\n    \"#;\n  let json = yojson_rs::parser::parse(json_str).unwrap();\n  println!(\"{}\", yojson_rs::to_string(json));\n}\n```\n\n---\n\n(c) 2021 Naoki Kaneko (a.k.a. \"puripuri2100\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuripuri2100%2Fyojson-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuripuri2100%2Fyojson-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuripuri2100%2Fyojson-rs/lists"}