Fast Header
HTTP Header Encoder & Decoder for Python
Install
pip install fast-header
Usage
cache control
from fast_header import CacheControl
cc = CacheControl(max_stale=True)
assert cc.max_stale
assert str(cc) == "max_stable"
cc = CacheControl.parse("max_stable")
etag
from fast_header import ETag
setag = ETag(value="a") # strong etag
wetag = ETag(value="a", weak=True) # weak etag
Content Disposition
from fast_header import ContentDisposition
cd = ContentDisposition.parse('attachment; filename="=?ISO-8859-1?Q?foo-=E4.html?="')
assert cd.type == 'attachment'
assert cd.parameters == { 'filename': '=?ISO-8859-1?Q?foo-=E4.html?=' }
Content Type
from fast_header import ContentType
cd = ContentType.parse('text/html; charset=utf-8; foo=bar')
assert cd.type == 'text/html'
assert cd.parameters == { 'charset': 'utf-8', 'foo': 'bar' }
Content Range
from fast_header import ContentRange
from fast_header import ContentRange
cr = ContentRange.parse("bytes 0-20/30")
assert cr.unit == "bytes"
assert cr.range is not None
assert cr.range.start == 0
assert cr.range.stop == 20
assert cr.size == 30
Metadata
Release files for fast-header 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fast_header-0.1.3.tar.gz | 6.8 kB | Without provenance | Details for fast_header-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fast_header-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for fast_header-0.1.3-py3-none-any.whl |
Total release size: 16.1 kB
Release files / fast_header-0.1.3.tar.gz
| Download URL | fast_header-0.1.3.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
312f7486d7952f7e43c9acf7a207d305fef004ff311b1cbdef23a6624a2eb81e
|
|
BLAKE2b-256 checksum How to use checksums |
640709bcbf7c01e8c6cbe4ed04cf483884be4eb044b6d50433f57373a1ae9cdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
|
Release files / fast_header-0.1.3-py3-none-any.whl
| Download URL | fast_header-0.1.3-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f0722c0a126ff4b19fd160796fd0d42efd8503516714a7d012f79f84c57d93a
|
|
BLAKE2b-256 checksum How to use checksums |
b364db25735e0cc100d148bccd78685973cf4e3cdddf92e23138af2273259128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
|
Security for fast-header 0.1.3
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.