pyrfc6266
A python implementation of RFC 6266 meant to replace https://github.com/g2p/rfc6266 and its forks as they rely on LEPL.
This implementation relies on pyparsing which seems to continue to get updates.
Installation
pip install pyrfc6266
Usage
Parse a content-disposition header into its components:
>>> import pyrfc6266
>>> pyrfc6266.parse('attachment; filename="foo.html"')
('attachment', [ContentDisposition(name='filename', value='foo.html')])
Parse a header into a useful filename:
>>> import pyrfc6266
>>> pyrfc6266.parse_filename('attachment; filename="foo.html"')
'foo.html'
Turn a requests response into a filename:
>>> import requests
>>> import pyrfc6266
>>> response = requests.get('http://httpbin.org/response-headers?Content-Disposition=attachment;%20filename%3d%22foo.html%22')
>>> pyrfc6266.requests_response_to_filename(response)
'foo.html'
License
MIT
Release files for pyrfc6266 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrfc6266-1.0.2.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrfc6266-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / pyrfc6266-1.0.2.tar.gz
| Download URL | pyrfc6266-1.0.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c41616b6a1f2e9a26df7f005fbaa634f960121769ccc4445acfb404e9f8fd4c
|
|
BLAKE2b-256 checksum How to use checksums |
74ef693fe33d34317facaf26a5716f965dac492d0f47e56e90bf310d7d4e74df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Release files / pyrfc6266-1.0.2-py3-none-any.whl
| Download URL | pyrfc6266-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0532307f319566f337dba97577dfaefe493c3e0c40ab211449ba4566fc2cf73d
|
|
BLAKE2b-256 checksum How to use checksums |
69fcd416c1bfb54f86259f631fd9ff6a9b813f7050129a377d94c43500109479
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|