{"id":20196030,"url":"https://github.com/thehxdev/jacson","last_synced_at":"2025-04-10T10:22:50.652Z","repository":{"id":229891078,"uuid":"776683075","full_name":"thehxdev/jacson","owner":"thehxdev","description":"JSON parser and query engine library written in C, from scratch!","archived":false,"fork":false,"pushed_at":"2025-02-28T09:52:56.000Z","size":111,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T09:11:30.813Z","etag":null,"topics":["c","json","json-parser","parser"],"latest_commit_sha":null,"homepage":"","language":"C","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/thehxdev.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}},"created_at":"2024-03-24T07:17:59.000Z","updated_at":"2025-02-28T09:52:59.000Z","dependencies_parsed_at":"2024-03-26T20:26:17.101Z","dependency_job_id":"f6fe3dd4-5995-4438-8952-0b7268687fee","html_url":"https://github.com/thehxdev/jacson","commit_stats":null,"previous_names":["thehxdev/jacson"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fjacson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fjacson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fjacson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fjacson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thehxdev","download_url":"https://codeload.github.com/thehxdev/jacson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199079,"owners_count":21063641,"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":["c","json","json-parser","parser"],"created_at":"2024-11-14T04:21:21.317Z","updated_at":"2025-04-10T10:22:50.630Z","avatar_url":"https://github.com/thehxdev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jacson\nJacson is a simple Json parsing library and query engine in C (in ~1100 LoC).\n\n\u003e [!WARNING]\n\u003e This project is just a simple json parser with simple query engine. Don't use this library for real programs.\n\n\n\n## Features\n\n- By not using recursion Jacson can handle deeply nested structures.\n- Simple Public API\n\n\n\n## Build\nTo build Jacson, you need a C compiler (`gcc` or `clang`), `cmake` and `make` installed on your system.\n\n```bash\ngit clone --depth=1 --branch=main https://github.com/thehxdev/jacson\n\ncd jacson\n\nmkdir -p build \u0026\u0026 cmake -B build -S .\n\ncmake --build build\n```\n\nThen you can use `libjacson.a` file for your projects in `build` directory and header files in `include` directory.\nOr use `test` program in `build` directory to parse a json file and query data from that.\n\nTake a look at `test/test.c` file to see how to use Jacson as a library.\n\n\n\n## Query Syntax\n\nJacson has very simple query syntax to get data from AST (Parsed json data).\n\n- Use `.` to seperate different parts of query.\n- Use `[N]` syntax to show an array's index where N is a positive integer or 0.\n\n### Example\nConsider this json data:\n```json\n{\n    \"message\": \"Hello World!\",\n    \"status\": 200,\n    \"ok\": true,\n    \"arr\": [\n        true,\n        false,\n        56,\n        12.841,\n        {\n            \"name\": \"thehxdev\"\n        },\n        null\n    ]\n}\n```\nTo get `thehxdev` string, you can use `arr.[4].name` query string.\n\n\u003e [!NOTE]\n\u003e Use `test` program in `build` directory to parse and query json files. Execute it with no arguments to get a help message.\n\n\n\n## Architecture:\nJacson architecture\n\n```\n+------------------+\n|   Raw Json Data  |\n+---------+--------+\n          |         \n+---------v--------+\n|     Tokenizer    |\n+---------+--------+\n          |         \n+---------v--------+\n|     Validator    |\n+---------+--------+\n          |         \n+---------v--------+\n|      Parser      |\n+------------------+\n```\n\n\n## TODO\n\nList of improvements and features to add:\n- [x] Free all memory used by Jacson (without recursion)\n- [x] Query engine for getting data from AST\n- [x] Handle control characters in json strings\n- [ ] Unicode (utf-8) support\n- [ ] Handle control characters in query strings\n- [ ] Change or add data to AST\n- [ ] Better and more advanced query engine\n- [ ] Documentation for Jacson's public API\n- [ ] Error handling and reporting errors to top-level callers\n- [ ] More advanced json syntax validation\n- [ ] Lazy evaluation capabilities\n- [ ] Write tests for each module\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehxdev%2Fjacson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthehxdev%2Fjacson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehxdev%2Fjacson/lists"}