Skip to main content

uniform

Uniform

📋 Dress your form processing endpoints. 📋


Pipeline Status Coverage Report PyPI: uniform Code Style: Black


Introduction

Uniform is a form processing tool that can be easily plugged into your Starlette backend.

It gives you the following:

  • Extract and validate form data against typesystem.Schema
  • Return 400 Bad Request with validation problems explained
  • 100% test coverage.
  • 100% type annotated codebase.

Requirements

Python 3.6+

Installation

$ pip3 install uniform

Example

example.py:

import uvicorn

from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import PlainTextResponse
from typesystem import Schema, Boolean

from uniform import Uniform, validate

app = Starlette()


class TestSchema(Schema):
    test = Boolean()


@app.route("/")
@validate(Uniform(TestSchema))
async def home(request: Request) -> PlainTextResponse:
    return JSONResponse(
        content={"ok": True, "description": None, "result": dict(request.state.data)}
    )


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8080)

Then run the application...

$ python example.py

Send POST request to http://127.0.0.1:8080/ with application/json or application/x-www-form-urlencoded data and it will be validated.

Dependencies

Uniform work with starlette endpoints and validate forms using typesystem library.

If you want to parse application/x-www-form-urlencoded form data - you will also need a python-multipart.

— 📋 —

Uniform is Unlicensed code in Public Domain.

Metadata

Release files for uniform 0.2.2

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

Source distribution (sdist)

Source distribution for uniform 0.2.2
File Size Uploaded Provenance Actions
uniform-0.2.2.tar.gz 4.3 kB Without provenance Details for uniform-0.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 9.6 kB

Release files / uniform-0.2.2.tar.gz

Download URL uniform-0.2.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0480c77cf476e255d026dce02c802b4d957b77f512f4b0482a3eace447d93b1
BLAKE2b-256 checksum
How to use checksums
91c4fb45b22ca335a28345b429a5a099f706a6180a9dff40e9109fed54e87329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9

Release files / uniform-0.2.2-py3-none-any.whl

Download URL uniform-0.2.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed4358bebc3ed2a7fbccbfaa881599aca974ff7a5b7a42ea4727c01b4d80ac5b
BLAKE2b-256 checksum
How to use checksums
5c59a3f0642ba23631058b4f8fafd165cb77f67df36aa79dd50d39e7aede710b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9

Security for uniform 0.2.2

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.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

0.1

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