Skip to main content

version python versions docs pipeline status coverage report

Unpoly

Unpoly is a framework agnostic python library implementing the Unpoly server protocol.

Features

  • Full protocol implementation: The whole Unpoly server protocol is implemented and well tested.
  • Django support: Out of the box we currently ship a middleware for Django support.
  • Easily extendable: The library abstracts the actual HTTP stuff via adapters and can easily plugged into frameworks like Flask etc.

Download & Install

pip install unpoly

Usage with Django

Add unpoly.contrib.django.UnpolyMiddleware to your middlewares and then you can access request.up. Details can be found in the usage section of the docs.

Example usage:

def my_view(request):
    if request.up: # Unpoly request
        # Send an event down to unpoly
        request.up.emit("test:event", {"event": "params"})
        # ... and also clear the cache for certain paths
        request.up.expire("/users/*")
    else:
        ...

def form_view(request):
    form = MyForm(request.GET)
    # When unpoly wants to validate a form it sends
    # along X-Up-Validate which contains the field
    # being validated.
    if form.is_valid() and not request.up.validate:
        form.save()
    return render(request, "template.html", {"form": form})

Usage with Flask etc

Subclass unpoly.adapter.BaseAdapter and initialize unpoly.Unpoly with it for every request (see the docs for details).

Metadata

Release files for unpoly 3.3.1

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

Source distribution (sdist)

Source distribution for unpoly 3.3.1
File Size Uploaded Provenance Actions
unpoly-3.3.1.tar.gz 8.9 kB Without provenance Details for unpoly-3.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unpoly 3.3.1
File Interpreter ABI Platform Actions
unpoly-3.3.1-py3-none-any.whl Python 3 none any Details for unpoly-3.3.1-py3-none-any.whl

Total release size: 19.7 kB

Release files / unpoly-3.3.1.tar.gz

Download URL unpoly-3.3.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
053528ab5313c35b73405188b6b32200be35f9a78588c64d48951548411594ee
BLAKE2b-256 checksum
How to use checksums
eb5d89b926ca5485dc330398db89842dc1d93cbace085b08cd950b9ff78253a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / unpoly-3.3.1-py3-none-any.whl

Download URL unpoly-3.3.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22283cb2e135601ea5a35b9d0ed57ca583e43e820824e1448cb9d9f0e2fc54b6
BLAKE2b-256 checksum
How to use checksums
cbc616afdde4f6968eac7533c57052b972e969ba21ab99904d3be09d6a803bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

Security for unpoly 3.3.1

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