Skip to main content

Delta (Python Port)

Python port of the javascript Delta library for QuillJS: https://github.com/quilljs/delta

Some basic pythonizing has been done, but mostly it works exactly like the above library.

There is no other python specific documentation at this time, sorry. Please see the tests for reference examples.

Install with Poetry

With HTML rendering:

> poetry add -E html quill-delta

Without HTML rendering:

> poetry add quill-delta

Install with pip

Note: If you're using zsh, see below.

With HTML rendering:

> pip install quill-delta[html]

With HTML rendering (zsh):

> pip install quill-delta"[html]"

Without HTML rendering:

> pip install quill-delta

Rendering HTML in Python

This library includes a module delta.html that renders html from an operation list, allowing you to render Quill Delta operations in full from a Python server.

For example:

from delta import html

ops = [ 
    { "insert":"Quill\nEditor\n\n" },
    { "insert": "bold",
      "attributes": {"bold": True}},
    { "insert":" and the " },
    { "insert":"italic",
      "attributes": { "italic": True }},
    { "insert":"\n\nNormal\n" },
]

html.render(ops)

Result (line formatting added for readability):

<p>Quill</p>
<p>Editor</p>
<p><br></p>
<p><strong>bold</strong> and the <em>italic</em></p>
<p><br></p>
<p>Normal</p>

See test_html.py for more examples.

Developing

Setup

If you'd to contribute to quill-delta-python, get started setting your development environment by running:

Checkout the repository

> git clone https://github.com/forgeworks/quill-delta-python.git

Make sure you have python 3 installed, e.g.,

> python --version

From inside your new quill-delta-python directory:

> python3 -m venv env
> source env/bin/activate
> pip install poetry
> poetry install -E html

Tests

To run tests do:

> py.test

Metadata

Release files for quill-delta 1.0.3

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

Source distribution (sdist)

Source distribution for quill-delta 1.0.3
File Size Uploaded
quill-delta-1.0.3.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quill-delta 1.0.3
File Interpreter ABI Platform
quill_delta-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.3 kB

Release files / quill-delta-1.0.3.tar.gz

Download URL quill-delta-1.0.3.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
937b67725489b5406038715897a5f2795eda3d4dd85f4d9fcebbc9c22462523a
BLAKE2b-256 checksum
How to use checksums
48d15e3baaef4b835c5fd435c2a78c120483e959d94d5a8bd51b5d9bbb0b9611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.1 CPython/3.8.5 Darwin/19.4.0

Release files / quill_delta-1.0.3-py3-none-any.whl

Download URL quill_delta-1.0.3-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2fbdcb04231d16108487862136e5170c2fbfc8051519f20a6ac455a6f4fd301
BLAKE2b-256 checksum
How to use checksums
37ba19e77d8e1643f3c750df22cbaa6065b407a20f2060199d3a598c41e4cd2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.1 CPython/3.8.5 Darwin/19.4.0

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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