Skip to main content

Fork of delta-python with dependencies updated for python 3.12 and up

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

quill_delta_python312-0.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quill_delta_python312-0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file quill_delta_python312-0.1.tar.gz.

File metadata

  • Download URL: quill_delta_python312-0.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for quill_delta_python312-0.1.tar.gz
Algorithm Hash digest
SHA256 4989f8406a999003779f30fa73143b46723709429d72d951c9ec2230598f8652
MD5 2941c13195836eb6f2740587bd8e6657
BLAKE2b-256 2d6d2cf9fbd221b3a31a94d0eca348b605493ff806f019b75eceb61a607c3b0d

See more details on using hashes here.

File details

Details for the file quill_delta_python312-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for quill_delta_python312-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5b5a9fa486517b84383ac297f1518d6caee89ed8bc14992b237b6d5c398e8f
MD5 a4bc7f55c9e5480e1ccf842bc653260f
BLAKE2b-256 879bf02adda450de07ce2713d538909d86dd4c17c79f36e15810bcacbd931f9e

See more details on using hashes here.

Supported by

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