{"id":24386,"library":"pyrfc6266","title":"pyrfc6266","description":"A Python implementation of RFC 6266 for parsing Content-Disposition headers. Version 1.0.2 is the current stable release. Low release cadence; last updated in 2021.","status":"active","version":"1.0.2","language":"python","source_language":"en","source_url":"https://github.com/JohnDoee/pyrfc6266","tags":["rfc6266","content-disposition","header-parsing","http"],"install":[{"cmd":"pip install pyrfc6266","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"note":"Always import from top-level module; no submodules.","symbol":"ContentDisposition","correct":"from pyrfc6266 import ContentDisposition"}],"quickstart":{"code":"from pyrfc6266 import ContentDisposition\n\nheader = 'attachment; filename=\"example.txt\"'\ncd = ContentDisposition.parse(header)\nprint(cd.filename_utf8)  # 'example.txt'\nprint(cd.disposition_type)  # 'attachment'","lang":"python","description":"Parse a Content-Disposition header and extract the filename."},"warnings":[{"fix":"Always use `filename_utf8` instead of `filename` for human-readable filenames.","message":"The `filename` attribute returns the raw, possibly percent-encoded value from the header; use `filename_utf8` for the decoded UTF-8 filename.","severity":"gotcha","affected_versions":"<2.0"},{"fix":"If you need RFC 5987 support, consider a different library or implement it yourself.","message":"The library does not support extended attributes like `filename*` as defined in RFC 5987. It only parses `filename` parameters.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `cd.filename_utf8` instead of `cd.filename`.","cause":"Accessing nonexistent attribute; correct attribute is 'filename_utf8' or 'raw_filename'.","error":"AttributeError: 'ContentDisposition' object has no attribute 'filename'"},{"fix":"Use `from pyrfc6266 import ContentDisposition` and call `ContentDisposition.parse(header)`.","cause":"Using an incorrect function name; the correct class is `ContentDisposition`.","error":"ImportError: cannot import name 'parse_content_disposition' from 'pyrfc6266'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}