{"id":20060121,"url":"https://github.com/dermasmid/py-jsoneditor","last_synced_at":"2025-05-05T15:32:32.938Z","repository":{"id":44299912,"uuid":"351464637","full_name":"dermasmid/py-jsoneditor","owner":"dermasmid","description":"View and edit your JSON data in the browser, With Python API and CLI.","archived":false,"fork":false,"pushed_at":"2023-06-19T19:30:53.000Z","size":1561,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T01:07:55.347Z","etag":null,"topics":["gui","json","json-search","jsoneditor","jsonviewer","python"],"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/dermasmid.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-03-25T14:24:49.000Z","updated_at":"2024-10-24T12:40:20.000Z","dependencies_parsed_at":"2023-02-09T15:17:01.875Z","dependency_job_id":null,"html_url":"https://github.com/dermasmid/py-jsoneditor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermasmid%2Fpy-jsoneditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermasmid%2Fpy-jsoneditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermasmid%2Fpy-jsoneditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermasmid%2Fpy-jsoneditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dermasmid","download_url":"https://codeload.github.com/dermasmid/py-jsoneditor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252524214,"owners_count":21762052,"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":["gui","json","json-search","jsoneditor","jsonviewer","python"],"created_at":"2024-11-13T13:13:08.004Z","updated_at":"2025-05-05T15:32:32.481Z","avatar_url":"https://github.com/dermasmid.png","language":"Python","readme":"# 💥py-jsoneditor💥\nQuickly View and Edit any JSON data.\n\n\n# Why?\n\nWhen working with JSON data, You often need to get a structured view of the JSON in order to be able to work with it. There's an online tool [https://jsoneditoronline.org/](https://jsoneditoronline.org/) which I used for this, but copying/pasting all the time got frustrating pretty quickly, This is why I created this package which you can launch right from Python or from the command line.\n\n\n# Screenshot\n\n![](https://res.cloudinary.com/dermasmid/image/upload/v1624745064/Screenshot_from_2021-06-27_01-02-58_qymcrb.png)\n\n\n# Installation\n\n```bash\npip install jsoneditor\n```\n\n\n# Python example\n\nIn python you can simply import `jsoneditor` and call the `editjson` function, the first argument is going to be the data. See [Formats you can pass the JSON as](#formats-you-can-pass-the-json-as) for all the formats you can pass the JSON in. See [Python api](#python-api) for a full list of addtional arguments that you can pass to `editjson`.\n```python\nimport requests\nimport jsoneditor\n\ndata = requests.get('https://jsonplaceholder.typicode.com/comments').json()\njsoneditor.editjson(data)\n```\n\n\n# Command line example\n\nFrom the command line you can either pass the data as an argument as so:\n```bash\njsoneditor '{\"Hey\": \"Hi\"}'\n```\nOr you can pipe it in like so:\n```bash\ncurl https://jsonplaceholder.typicode.com/comments | jsoneditor\n```\nOr you can use what you have in your clipboard like so:\n```bash\njsoneditor -c\n```\nSee [Formats you can pass the JSON as](#formats-you-can-pass-the-json-as) for all the formats you can pass the JSON in.\n\nRefer to [CLI options](#cli-options) for a list of all cli options. Alternatively you can run `jsoneditor --help` from your terminal to see it.\n\n\n## \u003ca\u003e\u003c/a\u003eFormats you can pass the JSON as\n\nYou can pass the json in any of the following formats:\n* as valid json string. Example: `{\"Hey\": \"Hi\"}`\n* as a python dict. Example: `{'Hey': 'hi'}`\n* as a url the points to valid json. Example: `https://jsonplaceholder.typicode.com/comments`\n* as a file path that is valid json. Example: `data.json`\n\n\n## \u003ca\u003e\u003c/a\u003ePython Api\n\n| parameter | type    | optional  |description                                                                  |\n| --------- | ------- | -------- |-----------------------------------------------------------------------------|\n| `data`    | `Any`     | ❌ |  The data in any of [these](#formats-you-can-pass-the-json-as) formats.       |\n| `callback`| `callable`| ✔️ |  If you provide this argument you will have a ✅ button which will trigger this callback.|\n| `options` | `dict`    | ✔️ | Options to pass the the jsoneditor object. See [here](https://github.com/josdejong/jsoneditor/blob/master/docs/api.md#configuration-options)|\n| `additional_js`| `str`| ✔️ |  You can pass some JavaScript to run on the client side. You can interact with the editor by accessing the `window.editor` variable.|\n| `keep_running`| `bool` | ✔️ | Whether to keep the server running. Defaults to `False`.                 |\n| `run_in_thread`| `bool` | ✔️ | Whether to run the server in a separate thread. Defaults to `False`.    |\n| `is_csv`| `bool` | ✔️ | Whether the data is csv data. Defaults to `False`.                             |\n| `is_yaml`| `bool` | ✔️ | Whether the data is yaml data. Defaults to `False`.                           |\n| `is_ndjson`| `bool` | ✔️ | Whether the data is Newline Delimited JSON  . Defaults to `False`.          |\n| `is_js_object`| `bool` | ✔️ | Whether the data is a JavaScript Object. Defaults to `False`.            |\n| `title`| `str` | ✔️ | A title to display in the browser.                                               |\n| `port`| `int` | ✔️ | specify which port to use.                                                        |\n\n\n## \u003ca\u003e\u003c/a\u003eCLI options\n\n| parameter | description                                                           |\n| --------- | ----------------------------------------------------------------------|\n| `data`    | The data in any of [these](#formats-you-can-pass-the-json-as) formats |\n| `-o`      | Add a button that will output the json back to the console            |\n| `-b`      | Keep running in background                                            |\n| `-c`      | Get JSON input from clipboard                                         |\n| `-k`      | Keep alive                                                            |\n| `-e`      | Edit mode                                                             |\n| `-n`      | Don't launch browser                                                  |\n| `-p`      | Server port                                                           |\n| `--out`   | File to output when in edit mode                                      |\n| `-t`      | Title to display in browser window                                    |\n| `--csv`   | Input is CSV                                                          |\n| `--yaml`  | Input is YAML                                                         |\n| `--js`    | Input is a JavaScript Object                                          |\n| `--ndjson`| Input is Newline Delimited JSON                                       |\n\n\n## Build\n\n```bash\npython setup.py sdist\n```\n\n# Acknowledgements\n\n* [jsoneditor](https://github.com/josdejong/jsoneditor)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermasmid%2Fpy-jsoneditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdermasmid%2Fpy-jsoneditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermasmid%2Fpy-jsoneditor/lists"}