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).
Release files for unpoly 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unpoly-3.2.0.tar.gz | 8.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unpoly-3.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 MB
Release files / unpoly-3.2.0.tar.gz
| Download URL | unpoly-3.2.0.tar.gz |
|---|---|
| Size | 8.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
353930d904330b194f9f6792f2fb8e52cd2985e2d64d30b7446a5481a5910f22
|
|
BLAKE2b-256 checksum How to use checksums |
7505f95db62e2adbd1a4f329d5da8b2e0131ca001ba9be63700ec2f69a225408
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / unpoly-3.2.0-py3-none-any.whl
| Download URL | unpoly-3.2.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98a5f8b7075aa1fcab49686d8bae970154f072ea56c8b5e46ffdcf03cc7c41ef
|
|
BLAKE2b-256 checksum How to use checksums |
148606eee3284e051b277b56e540cac1356acd07db54a2e83024b645a76e9141
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|