Skip to main content

Python translation of prosemirror parts needed to modify a document in Python

Project description

=====
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 tested!**

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

1. Install with `pip install prosemirror`

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

```
from prosemirror import create_doc, transform_doc
```

First use `doc = create_doc(doc_data, schema_spec)` to create a Document object.

Then use `updated_doc = transform_doc(steps_data, doc)` to create a new Document object with the given steps applied.

Use `updated_doc.toJSON()` to get the JSON version of the updated document.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prosemirror-python-0.0.1.tar.gz (60.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page