{"id":13770869,"url":"https://github.com/SKevo18/pyEditorJS","last_synced_at":"2025-05-11T03:32:56.107Z","repository":{"id":58513812,"uuid":"420383595","full_name":"SKevo18/pyEditorJS","owner":"SKevo18","description":"A very simple Editor.js parser written in pure Python","archived":false,"fork":false,"pushed_at":"2023-07-10T12:28:34.000Z","size":51,"stargazers_count":21,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T10:55:29.104Z","etag":null,"topics":["editorjs","editorjs-converter","editorjs-tool","python","python3"],"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/SKevo18.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}},"created_at":"2021-10-23T10:40:31.000Z","updated_at":"2025-02-28T11:51:14.000Z","dependencies_parsed_at":"2024-01-06T20:55:39.478Z","dependency_job_id":null,"html_url":"https://github.com/SKevo18/pyEditorJS","commit_stats":null,"previous_names":["cwkevo/pyeditorjs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKevo18%2FpyEditorJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKevo18%2FpyEditorJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKevo18%2FpyEditorJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKevo18%2FpyEditorJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SKevo18","download_url":"https://codeload.github.com/SKevo18/pyEditorJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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":["editorjs","editorjs-converter","editorjs-tool","python","python3"],"created_at":"2024-08-03T17:00:43.468Z","updated_at":"2025-05-11T03:32:55.796Z","avatar_url":"https://github.com/SKevo18.png","language":"Python","funding_links":["https://www.buymeacoffee.com/skevo","https://img.buymeacoffee.com/button-api/?text=Support"],"categories":["Libraries"],"sub_categories":["Python"],"readme":"# pyEditorJS\n\nA minimal, fast, Python 3.6+ package for parsing [Editor.js](https://editorjs.io) content.\n\n## Features\n\n- Handles all out-of-the-box Editor.js elements;\n- Optional sanitization via the `bleach` library;\n- Checks whether the data is valid (e. g.: a header can't have more than 6 levels), and raises `EditorJsParseError` if data is malformed;\n- Uses Editor.js's class names for styles, so the output will be consistent with WYSIWYG (see [Editor.js's example style](https://github.com/codex-team/editor.js/blob/8ae8823dcd6877d63241fcb94694a8a18744485d/example/assets/demo.css) and [styles documentation](https://editorjs.io/styles))\n\n## Installation\n\n```bash\n    pip install pyeditorjs\n```\n\n**Optional:** install [bleach](https://pypi.org/project/bleach) for clean HTML:\n\n```bash\n    pip install bleach\n```\n\n## Usage\n\n### Quickstart\n\n```python\nfrom pyeditorjs import EditorJsParser\n\neditor_js_data = ... # your Editor.js JSON data\nparser = EditorJsParser(editor_js_data) # initialize the parser\n\nhtml = parser.html(sanitize=True) # `sanitize=True` requires `bleach` to be installed\nprint(html) # your clean HTML\n```\n\n### Obtain texts only (for creating audio-only version, for example)\n\n\u003e **WARNING:** This does not sanitize the texts! Please, call `bleach.clean(...)` directly. This also doesn't obtain text from bold texts, markers, etc... - you should use [BeautifulSoup](https://pypi.org/project/beautifulsoup4/) for this.\n\n```python\n#import bleach\nfrom pyeditorjs import EditorJsParser\n\neditor_js_data = ... # your Editor.js JSON data\nparser = EditorJsParser(editor_js_data) # initialize the parser\n\nall_texts = []\n\nfor block in parser:\n    text = getattr(block, 'text', None)\n\n    if text:\n        all_texts.append(text) # all_texts.append(bleach.clean(text))\n\nprint(all_texts)\n```\n\n## Disclaimer\n\nThis is a community-provided project, and is not affiliated with the Editor.js team.\nIt was created in my spare time. I cannot make sure that it will receive consistent updates.\n\nBecause of this, PRs, bug reports and suggestions are welcome!\n\n\u003ca href=\"https://www.buymeacoffee.com/skevo\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Support me\u0026emoji=🐣\u0026slug=skevo\u0026button_colour=ffa200\u0026font_colour=000000\u0026font_family=Poppins\u0026outline_colour=000000\u0026coffee_colour=FFDD00\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSKevo18%2FpyEditorJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSKevo18%2FpyEditorJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSKevo18%2FpyEditorJS/lists"}