Skip to main content

RFC6266 implementation in Python

Project description



A python implementation of RFC 6266 meant to replace and its forks as they rely on LEPL.

This implementation relies on pyparsing which seems to continue to get updates.


pip install pyrfc6266


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"')

Turn a requests response into a filename:

>>> import requests
>>> import pyrfc6266
>>> response = requests.get(';%20filename%3d%22foo.html%22')
>>> pyrfc6266.requests_response_to_filename(response)



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrfc6266-1.0.2.tar.gz (4.5 kB view hashes)

Uploaded source

Built Distribution

pyrfc6266-1.0.2-py3-none-any.whl (4.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page