{"id":25197294,"url":"https://github.com/zaironjacobs/streamjson","last_synced_at":"2026-03-07T04:01:41.264Z","repository":{"id":57471750,"uuid":"437332415","full_name":"zaironjacobs/streamjson","owner":"zaironjacobs","description":"Write to or read from JSON file using a stream.","archived":false,"fork":false,"pushed_at":"2025-02-13T01:05:01.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-29T18:24:08.091Z","etag":null,"topics":["json","python","stream","streamjson"],"latest_commit_sha":null,"homepage":"","language":"Python","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/zaironjacobs.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,"zenodo":null}},"created_at":"2021-12-11T16:27:51.000Z","updated_at":"2025-02-13T01:05:05.000Z","dependencies_parsed_at":"2025-05-08T21:03:34.140Z","dependency_job_id":null,"html_url":"https://github.com/zaironjacobs/streamjson","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/zaironjacobs/streamjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaironjacobs%2Fstreamjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaironjacobs%2Fstreamjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaironjacobs%2Fstreamjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaironjacobs%2Fstreamjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaironjacobs","download_url":"https://codeload.github.com/zaironjacobs/streamjson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaironjacobs%2Fstreamjson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30207390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"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":["json","python","stream","streamjson"],"created_at":"2025-02-10T01:52:12.004Z","updated_at":"2026-03-07T04:01:41.243Z","avatar_url":"https://github.com/zaironjacobs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StreamJSON\n\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/streamjson?color=blue)](https://pypi.python.org/pypi/streamjson)\n[![PyPI](https://img.shields.io/pypi/v/streamjson?color=blue)](https://pypi.python.org/pypi/streamjson)\n[![PyPI - License](https://img.shields.io/pypi/l/streamjson)](https://pypi.python.org/pypi/streamjson)\n\n[![tests](https://github.com/zaironjacobs/streamjson/actions/workflows/test.yml/badge.svg)](https://github.com/zaironjacobs/streamjson/actions/workflows/test.yml)\n\nWrite objects or arrays to a JSON file using a stream. Useful for when you don't want to read large amounts of data in\nmemory, for example when you need to save large amounts of data from a database to a single JSON file.\n\nRead objects from a JSON file using a stream. Does not require loading the whole JSON file in memory.\n\n## Install\n\n```console\npip install streamjson\n```\n\n## How to write to JSON file\n\nFetch data from a database or anywhere else and send to a JSON file. The send function takes in a dictionary or a list.\nA new file with the given name will be created, the root of the JSON file is an array by default.\n\n```Python\nfrom streamjson import StreamJSONWriter\n\npersons = [{'id': '0001', 'first_name': 'John', 'last_name': 'Doe'},\n           {'id': '0002', 'first_name': 'Jane', 'last_name': 'Doe'}]\n\nwith StreamJSONWriter('persons.json', indent=2) as writer:\n    for person in persons:\n        writer.send(person)\n```\n\npersons.json:\n\n```JSON\n[\n  {\n    \"id\": \"0001\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\"\n  },\n  {\n    \"id\": \"0002\",\n    \"first_name\": \"Jane\",\n    \"last_name\": \"Doe\"\n  }\n]\n```\n\n## How to read from JSON file\n\nThe reader will stream each object from the JSON file.\n\n```Python\nfrom streamjson import StreamJSONReader\n\nwith StreamJSONReader('persons.json') as reader:\n    for obj in reader.find():\n        print(obj)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaironjacobs%2Fstreamjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaironjacobs%2Fstreamjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaironjacobs%2Fstreamjson/lists"}