Registry / web-framework / prosemirror

prosemirror

JSON →
library0.6.1pypypi✓ verified 90d ago

Python implementation of core ProseMirror modules for collaborative editing. Current version 0.6.1, requires Python >=3.10. Release cadence is irregular, with major upstream syncs every few months.

pip install prosemirror
INSTALL
IMPORT
SIG · PROSEMIRROR
P
prosemirror
web-frameworkpythonv0.6.1
Install
2.5s avg
Import
174ms
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.178s · 30.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.5s · import 0.170s · 31MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Schema
✓ from prosemirror.model import Schema
✗ from prosemirror import Schema
Schema is in the model subpackage
DOMParser
✓ from prosemirror.model import DOMParser
Transform
✓ from prosemirror.transform import Transform
✗ from prosemirror import Transform
Transform is in the transform subpackage
Step
✓ from prosemirror.transform import Step
schema
✓ from prosemirror.schema_basic import schema
✗ from prosemirror import schema
The basic schema is in the schema_basic subpackage

Parse HTML into a ProseMirror document using the basic schema.

from prosemirror.model import Schema, DOMParser from prosemirror.schema_basic import schema # Create a document from HTML dom_parser = DOMParser.from_schema(schema) doc = dom_parser.parse('<p>Hello, world!</p>') print(doc.to_json()) # Output: {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'type': 'text', 'text': 'Hello, world!'}]}]}
Debug
Known issues
gotchaPython string slicing uses Unicode codepoints, but ProseMirror positions are UTF-16 code units. This affects text_between and diff calculations. Always use UTF-16 aware functions when computing positions.
fix
Use the library's internal UTF-16 handling (no custom string slicing).
affects: >=0.6.0
breakingIn v0.5.0, `is_text_block` was renamed to `is_textblock` to match upstream. Old code using `is_text_block` will break.
fix
Replace `is_text_block` with `is_textblock`.
affects: >=0.5.0
breakingPython 3.9 and lower are no longer supported as of v0.5.0. Install may fail on older Python versions.
fix
Upgrade to Python 3.10+.
affects: >=0.5.0
gotchaImporting from `prosemirror` directly (e.g., `from prosemirror import Schema`) does not work. Use the full subpackage path.
fix
Import from subpackages like `prosemirror.model`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'prosemirror'
Package not installed or installed under a different name.
fix
Run `pip install prosemirror`.
ImportError: cannot import name 'Schema' from 'prosemirror'
Trying to import Schema from the top-level package instead of subpackage.
fix
Use `from prosemirror.model import Schema`.
KeyError: 'is_text_block'
Using old attribute name `is_text_block` which was renamed in v0.5.0.
fix
Use `is_textblock` instead.
Upgrade
Version history
0.6.1latest on PyPI · released Feb 21, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Anthropic
1
Resources
prosemirror — pip install prosemirror · libregistry