Skip to main content
=====
Prosemirror-python
=====

This is an unofficial and not production ready package. Contributions and improvements are welcome.

This package does not attempt at importing all of Prosemirror in Python. It is merely trying to use those parts of
prosemirror-model and prosemirror-transform that are needed for serverside operations.


**This package has not yet been extensively tested!**

How to use it
-----------

1. Install with `pip install prosemirror`

2. In your python code, import the two included functions with:


from prosemirror import create_doc, transform_doc

3. Then create a Document object:

doc = create_doc(doc_data, spec_data) # spec_data = JSON.parse(JSON.stringify(view.state.schema.spec))


4. Thereafter create an updated Document object with the given steps applied:

updated_doc = transform_doc(steps_data, doc)

5. To get the JSON version of a Document object, simply use the builtin toJSON method:

updated_doc.toJSON()


Speed
-----------

It is not setting any speed records so far. These tests were conducted with Python 2 with the test files in the repo (applying three steps to an existing doc):

prosemirror-python: 0.024s

nodejs: 0.00013s

jsonpatch (Python): 0.00024s

So it is around 200 times slower than nodejs and 100 times slower than using jsonpatch. It is possible that it could be sped up in various ways, for example by using pypy and a vm or alike. Please let me know if you figure something out!

License questions
-----------

**Q - What license is this under?**

A - AGPL-3, check the LICENSE file.


**Q - I have spent the past month building a webbased text editing app. I am in stealth
mode as my editor is really unique and I'll be the next IT Billionaire once I
release it. Now I would like to use this library, but the AGPL requires me to share
changes I make with others! It's not fair that you are standing between me and my fortune!**

A - Right. If it is worth that much to you, you can try to pay me so that I'll put it under
a more liberal license. Secondly, you could suggest taking over maintainership of this
library and promise extra features to get me to change my mind. Thirdly - you could just
start from scratch as long as it's not much code, but then we both lose out of any fixes
either one of us makes.

We all need to live of something, I give a lot of code away for free
and the only requirement there is is that you contribute any changes you make back. Not
that expensive, if you think about it.

Metadata

Release files for prosemirror-python 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prosemirror-python 0.0.4
File Size Uploaded Provenance Actions
prosemirror-python-0.0.4.tar.gz 62.9 kB Without provenance Details for prosemirror-python-0.0.4.tar.gz

Release files / prosemirror-python-0.0.4.tar.gz

Download URL prosemirror-python-0.0.4.tar.gz
Size 62.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8b60d066a749e2bc8617dd4d99232c817cadccb309adc527145581a834cdc28f
BLAKE2b-256 checksum
How to use checksums
ab3e33ff3b24bfd4fb289e2086da4edcebec5b259c96bd88c47c58658e625f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Security for prosemirror-python 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page