Skip to main content

HTTP Structured Field Values in Python

Actions Status

This is a Python 3 library implementing parsing and serialisation of HTTP Structured Fields.

The library's initial purpose is to prove the algorithms in the specification; as a result, it is not at all optimised. It tracks the specification closely, but since it is not yet an RFC, may change at any time.

The top-level parse and serialise functions are the ones your code should call.

Currently, this implements draft 19 of the specification.

Command Line Use

You can validate and examine the data model of a field value by calling the library on the command line, using -d, -l and -i to denote dictionaries, lists or items respectively; e.g.,

> python3 -m http_sfv -i "foo;bar=baz"
[
    {
        "__type": "token",
        "value": "foo"
    },
    {
        "bar": {
            "__type": "token",
            "value": "baz"
        }
    }
]

or:

> python3 -m http_sfv -i "foo;&bar=baz"
FAIL: Key does not begin with lcalpha or * at: &bar=baz

Note that if successful, the output is in the JSON format used by the test suite.

Metadata

Release files for http-sfv 0.8.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 http-sfv 0.8.2
File Size Uploaded Provenance Actions
http_sfv-0.8.2.tar.gz 9.8 kB Without provenance Details for http_sfv-0.8.2.tar.gz

Release files / http_sfv-0.8.2.tar.gz

Download URL http_sfv-0.8.2.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
071bf9847e2e3bb548f25841cdc72ab21127fcaaf544bae26f3f754a7c5af2cb
BLAKE2b-256 checksum
How to use checksums
18ccbb601ce54e5fc318f891fa71dc9e9e623594a15e36d773b5e37080d9dee2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

Security for http-sfv 0.8.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.

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