pyrfc6266
RFC6266 implementation in Python
What it is and what it does
pyrfc6266 is a Python parser for RFC 6266 Content-Disposition headers, designed as a replacement for older implementations that relied on the LEPL parsing library. It uses pyparsing to extract structured information from HTTP Content-Disposition headers, which are commonly used to specify how browsers should handle file downloads and attachments.
The package provides three main functions: parsing a header into its disposition type and parameters, extracting just the filename from a header, and extracting the filename directly from a requests response object. It's useful when handling file downloads where you need to recover the intended filename from HTTP response headers rather than relying on URLs.
Use it for:
- Extract download filenames from HTTP responses when the filename comes from a Content-Disposition header
- Parse attachment headers in email or HTTP contexts to determine disposition type and parameters
- Build download managers or file-handling utilities that need RFC 6266 compliant filename extraction
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses RFC 6266 Content-Disposition headers to extract filename and disposition information from HTTP responses and header strings.
Yes, if you need RFC 6266 parsing and can accept abandoned maintenance. The package is stable for its narrow use case, has no known vulnerabilities, and low install friction. However, be aware it will not receive updates or bug fixes—only install if the current implementation meets your needs and you're comfortable maintaining a fork if issues arise.
Install
pyrfc6266 on PyPI
pip
pip install pyrfc6266uv
uv add pyrfc6266poetry
poetry add pyrfc6266Installing pyrfc6266
Before you install
Low install friction with a single lightweight dependency on pyparsing. However, the package is in abandoned maintenance status with no releases since April 2022 and the last commit in April 2023, so it will not receive bug fixes or updates.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—you need only include the license text in distributions.
Quickstart
pip install pyrfc6266
import pyrfc6266
result = pyrfc6266.parse('attachment; filename="foo.html"')
filename = pyrfc6266.parse_filename('attachment; filename="foo.html"')
Verify before relying
- Whether the package handles all RFC 6266 edge cases and modern Content-Disposition variants correctly
- Compatibility with current versions of requests library if using the requests integration
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyparsing |
| Maintenance | abandoned — 1,568 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,775/month — #14,591 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyrfc6266-1.0.2-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
cookiesParses and renders HTTP Cookie and Set-Cookie…
permissive · top 15,000 on PyPI
tnefparseDecodes Microsoft's Transport Neutral…
copyleft · top 15,000 on PyPI
git-url-parseParses Git repository URLs to extract…
permissive · top 15,000 on PyPI
http-sfParses and serializes HTTP Structured Fields as…
permissive · top 15,000 on PyPI
uritoolsParses, validates, and composes URIs and URI…
permissive · top 5,000 on PyPI
mediatypeParses and creates MIME types (media types)…
permissive · top 15,000 on PyPI
pyRFC3339Parses and generates RFC 3339-compliant…
permissive · top 5,000 on PyPI
rfc3986Parses, validates, and normalizes URIs…
permissive · top 1,000 on PyPI