{"id":24316506,"url":"https://github.com/jferard/jsoneventparser","last_synced_at":"2026-04-24T07:34:06.885Z","repository":{"id":170593569,"uuid":"370461448","full_name":"jferard/JSONEventParser","owner":"jferard","description":"A pure python JSON event based parser","archived":false,"fork":false,"pushed_at":"2021-11-05T16:02:37.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T12:56:24.946Z","etag":null,"topics":["iterative","json","python3","xml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jferard.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":"2021-05-24T19:19:24.000Z","updated_at":"2021-11-05T16:02:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"a982282d-b90e-4da3-aff2-68d4bda5cb26","html_url":"https://github.com/jferard/JSONEventParser","commit_stats":null,"previous_names":["jferard/jsoneventparser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jferard/JSONEventParser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJSONEventParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJSONEventParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJSONEventParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJSONEventParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferard","download_url":"https://codeload.github.com/jferard/JSONEventParser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJSONEventParser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32214417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["iterative","json","python3","xml"],"created_at":"2025-01-17T12:56:42.300Z","updated_at":"2026-04-24T07:34:06.871Z","avatar_url":"https://github.com/jferard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSON Event Parser - a pure python JSON event based parser.\n\nCopyright (C) 2021 J. Férard \u003chttps://github.com/jferard\u003e\n\nLicense: GPLv3\n\n[![Build Status](https://travis-ci.com/jferard/JSONEventParser.svg?branch=main)](https://travis-ci.com/jferard/JSONEventParser)\n[![codecov](https://codecov.io/gh/jferard/JSONEventParser/branch/main/graph/badge.svg)](https://codecov.io/gh/jferard/JSONEventParser)\n\n# Summary\nJSON Event Parser is a toy project written to convert JSON files to XML without\nthe need to load the whole JSON object into memory. It relies on three elements :\n* a straightforward lexer, based on the [RFC 8259](\n  https://datatracker.ietf.org/doc/html/rfc8259) ;\n* a straightforward parser, based on the lexer above and the same [RFC 8259](\n  https://datatracker.ietf.org/doc/html/rfc8259) ;\n* a simple converter from JSON to XML.\n\nEach of these elements is a generator which can be used in a simple `for` loop.\nThe lexer provides tokens, the parser provides other tokens, and \nthe converter provides lines of an XML file.\n\nJSON Event Parser is really slow but does not require any dependency.\n\nIf you want to use a full iterative parser, have a look at \n[ijson](https://pypi.org/project/ijson) that relies on [YAJIL](\nhttp://lloyd.github.com/yajl/) (there is also a pure Python backend). \n\n# Usage\n\n## Command line\n\n```\n  usage: json_event_parser.py [-h] [-hd HEADER] [-r ROOT] [-li LIST_ITEM] [-t]\n                              [-f]\n                              [infile] [outfile]\n  \n  Convert an JSON file to an XML file.\n  \n  positional arguments:\n    infile                a JSON file to convert\n    outfile               the output file\n  \n  optional arguments:\n    -h, --help            show this help message and exit\n    -hd HEADER, --header HEADER\n                          the header line\n    -r ROOT, --root ROOT  the root tag\n    -li LIST_ITEM, --list-item LIST_ITEM\n                          the list item tag (default is \u003cli\u003e as in HTML\n    -t, --typed           tags are typed\n    -f, --formatted       format the XML (use with caution: huge files may be\n                          generated because of spaces)\n```\n\n\n## As a library\nParse a JSON file\n\n    with open(\"path/to/json/file\", \"r\", encoding=\"utf-8\") as source:\n        for token, value in JSONParser(source):\n            print(token, value)\n\nPrint the XML counterpart of a JSON file\n\n    with open(\"path/to/json/file\", \"r\", encoding=\"utf-8\") as source:\n        print(\"\\n\".join(JSONAsXML(source, typed=True)))\n\n# Tests\n\n    $ python3.8 -m pytest --cov-report term-missing --cov=json_event_parser \\\n      \u0026\u0026 python3.8 -m pytest --cov-report term-missing --cov-append --doctest-modules json_event_parser.py --cov=json_event_parser \\\n      \u0026\u0026 flake8 json_event_parser.py\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fjsoneventparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferard%2Fjsoneventparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fjsoneventparser/lists"}