skillfed

pyrfc6266

RFC6266 implementation in Python

pyrfc6266 v1.0.2 76.8K downloads/30d#14,591 on PyPI14
Permissive license MIT Abandoned released

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 pyrfc6266

uv

uv add pyrfc6266

poetry

poetry add pyrfc6266

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: MIT License

Tags

rfc 6266 content-disposition parserextract filename from http headerparse content-dispositionhttp header filename extractioncontent-disposition parsing
http-headersrfc-compliance

More WWW/HTTP packages