--- id: prosemirror version: "0.6.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # prosemirror — Python implementation of core ProseMirror modules for collaborative editing License: permissive · Maintenance: active · Downloads: 158.6K/mo ## What it is and what it does Prosemirror-py is a native Python port of ProseMirror's core modules, enabling you to define document schemas, parse and serialize rich-text documents, and apply transformations directly in Python without embedding a JavaScript runtime. It translates the upstream implementation closely, adapting for Python idioms (snake_case naming, type annotations) and replacing browser DOM APIs with lxml for HTML parsing and a custom Element model for serialization. The package includes schema definitions (basic, list), a transform engine for applying edits, a test builder for validation, and full type annotations for static checking. It preserves JavaScript's UTF-16 string semantics to maintain compatibility with ProseMirror's position calculations. The test suite has been translated and passes, and the project is actively maintained with recent commits and support for current Python versions. Use it for: - Build server-side rich-text editors or collaborative editing backends that accept and apply ProseMirror document transforms. - Parse HTML into ProseMirror documents and serialize documents back to HTML for storage or transmission. - Validate document structure against a schema and apply bulk transformations (delete, mark, wrap) programmatically. - Generate test fixtures or synthetic documents for testing editor integrations. - Implement document diffing or version control by converting transforms to and from JSON. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python implementations of core ProseMirror modules (model, transform, schema, test builder) for building and manipulating rich-text documents programmatically without requiring a JavaScript runtime. Yes. Active maintenance, production-stable status, low install friction, no known vulnerabilities, and permissive licensing make it a solid choice for server-side ProseMirror workflows. Install if you need to manipulate ProseMirror documents in Python or build collaborative editing backends; skip if you only need client-side editing. ## Install pip install prosemirror uv add prosemirror poetry add prosemirror ## Installing prosemirror Before you install: Low friction install with three lightweight dependencies. Active maintenance with recent commits and production-stable status across Python 3.10, 3.11, 3.12, 3.13, and 3.14. License in practice: BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: from prosemirror.transform import Transform from prosemirror.schema.basic import schema doc = schema.node("doc", {}, [schema.node("paragraph", {}, [schema.text("Hello, world!")])]) tr = Transform(doc) tr.delete(3, 5) tr.add_mark(1, 4, schema.mark("strong")) Requires Python 3.10 or later; UTF-16 string semantics differ from Python's native encoding, affecting character position calculations. Verify before relying: - Performance characteristics and scalability limits for large documents or frequent transforms. - Completeness of prosemirror-schema-list implementation (node specs and wrapRangeInList only; command functions excluded). - Real-world collaborative editing workflow support and conflict resolution capabilities. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 158.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags prosemirror python port, rich text document manipulation, collaborative editing library, document transform and schema, prosemirror schema basic, text editor document model, json document serialization, collaborative-editing, document-model, schema-validation [View on SkillFed](https://skillfed.io/packages/prosemirror) · [View on PyPI](https://pypi.org/project/prosemirror/)