{"id":21647127,"url":"https://github.com/massivefermion/juno","last_synced_at":"2025-10-11T13:02:48.432Z","repository":{"id":209093218,"uuid":"723221648","full_name":"massivefermion/juno","owner":"massivefermion","description":"Flexible JSON decoding","archived":false,"fork":false,"pushed_at":"2024-12-19T15:40:14.000Z","size":264,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T05:08:56.913Z","etag":null,"topics":["decode","decoder","decoding","deserialization","deserialize","flexible","gleam","json","thoas"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/juno","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/massivefermion.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"massivefermion","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2023-11-25T01:29:30.000Z","updated_at":"2025-01-03T23:56:42.000Z","dependencies_parsed_at":"2023-11-26T09:22:09.618Z","dependency_job_id":"157be92a-9b57-4b18-8075-24af8bb89ef0","html_url":"https://github.com/massivefermion/juno","commit_stats":null,"previous_names":["massivefermion/juno"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massivefermion%2Fjuno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massivefermion%2Fjuno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massivefermion%2Fjuno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massivefermion%2Fjuno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/massivefermion","download_url":"https://codeload.github.com/massivefermion/juno/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244530998,"owners_count":20467390,"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":["decode","decoder","decoding","deserialization","deserialize","flexible","gleam","json","thoas"],"created_at":"2024-11-25T06:48:34.073Z","updated_at":"2025-10-11T13:02:48.344Z","avatar_url":"https://github.com/massivefermion.png","language":"Gleam","funding_links":["https://github.com/sponsors/massivefermion"],"categories":[],"sub_categories":[],"readme":"\u003c!-- ![juno](https://raw.githubusercontent.com/massivefermion/bison/main/banner.png) --\u003e\n![juno](https://raw.githubusercontent.com/massivefermion/juno/main/banner.png)\n\n[![Package Version](https://img.shields.io/hexpm/v/juno)](https://hex.pm/packages/juno)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/juno)\n\n# juno \n\nJuno is a tool for decoding JSON in a more flexible way, which can be useful in situations where the exact structure of the data is not known but there are still patterns in it that need to be captured.\n\n## 🦋 Quick start\n\n```sh\ngleam test  # Run the tests\ngleam shell # Run an Erlang shell\n```\n\n## 🦋 Installation\n\n```sh\ngleam add juno\n```\n\n## 🦋 Usage\n\n```gleam\nimport gleam/dynamic\nimport juno\n\npub type Entity {\n  Player(id: String, score: Int, eliminated: Bool)\n  Game(id: String, players: List(String), winner: String, prize: String)\n}\n\npub fn main() {\n  let json = \"{\n      \\\"2023-11-24\\\": {\n        \\\"weather\\\": \\\"rainy\\\",\n        \\\"attending\\\": {\n          \\\"anton\\\": {\n            \\\"id\\\": \\\"P36\\\",\n            \\\"scores\\\": [45, 55],\n            \\\"eliminated\\\": true\n          },\n          \\\"vincent\\\": {\n            \\\"id\\\": \\\"P3\\\",\n            \\\"score\\\": 28,\n            \\\"eliminated\\\": false\n          },\n          \\\"gerome\\\": {\n            \\\"id\\\": \\\"P6\\\",\n            \\\"score\\\": 15,\n            \\\"eliminated\\\": false\n          },\n          \\\"irene\\\": {\n            \\\"id\\\": \\\"P10\\\",\n            \\\"score\\\": 21,\n            \\\"eliminated\\\": false\n          }\n        },\n        \\\"14:00\\\": {\n          \\\"id\\\": \\\"G528\\\", \n          \\\"players\\\": [\n            \\\"P10\\\",\n            \\\"P6\\\"\n          ],\n          \\\"winner\\\": \\\"P10\\\",\n          \\\"prize\\\": \\\"vacation\\\"\n        },\n        \\\"16:00-\u003e21:00\\\": [\n          {\n            \\\"id\\\": \\\"G561\\\", \n            \\\"players\\\": [\n              \\\"P10\\\",\n              \\\"P3\\\"\n            ],\n            \\\"winner\\\": \\\"P10\\\",\n            \\\"prize\\\": \\\"toaster\\\"\n          },\n          {\n            \\\"id\\\": \\\"G595\\\", \n            \\\"players\\\": [\n              \\\"P3\\\",\n              \\\"P6\\\"\n            ],\n            \\\"winner\\\": \\\"P3\\\",\n            \\\"prize\\\": \\\"car\\\"\n          } \n        ]\n      }\n    }\"\n\n  let active_player_decoder =\n    dynamic.decode3(\n      Player,\n      dynamic.field(\"id\", dynamic.string),\n      dynamic.field(\"score\", dynamic.int),\n      dynamic.field(\"eliminated\", dynamic.bool),\n    ) \n\n  let game_decoder =\n    dynamic.decode4(\n      Game,\n      dynamic.field(\"id\", dynamic.string),\n      dynamic.field(\"players\", dynamic.list(dynamic.string)),\n      dynamic.field(\"winner\", dynamic.string),\n      dynamic.field(\"prize\", dynamic.string),\n    )\n\n  juno.decode(json, [active_player_decoder, game_decoder])\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassivefermion%2Fjuno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmassivefermion%2Fjuno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassivefermion%2Fjuno/lists"}