{"id":21441,"library":"http-sf","title":"http-sf","description":"A Python library for parsing and serializing HTTP Structured Fields (RFC 8941). Current version 1.2.0, released 2025-01-13. Cadence: irregular, ~1 minor per year. Requires Python >=3.10.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/Groover/http-sf","tags":["http","structured-fields","rfc-8941","serialization","parsing"],"install":[{"cmd":"pip install http-sf","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"parse_item","correct":"from http_sf import parse_item"},{"note":"","wrong":"","symbol":"serialize_item","correct":"from http_sf import serialize_item"},{"note":"","wrong":"","symbol":"parse_list","correct":"from http_sf import parse_list"},{"note":"","wrong":"","symbol":"serialize_list","correct":"from http_sf import serialize_list"},{"note":"","wrong":"","symbol":"parse_dictionary","correct":"from http_sf import parse_dictionary"},{"note":"","wrong":"","symbol":"serialize_dictionary","correct":"from http_sf import serialize_dictionary"}],"quickstart":{"code":"from http_sf import parse_item, serialize_item\n\n# Parse a structured field string\nparsed = parse_item('\"hello world\"')\nprint(parsed.value)  # hello world\n\n# Serialize back to string\nserialized = serialize_item(parsed)\nprint(serialized)  # b'\"hello world\"'\n\n# With parameters: parse_item(b'i=1;a=true')","lang":"python","description":"Parses and serializes HTTP Structured Fields (RFC 8941). Functions for item, list, and dictionary types. All return BareItem objects with .value and .params."},"warnings":[{"fix":"Upgrade to >=1.2.0 and use .value accessor.","message":"Version 1.0 changed the return type from strings to BareItem objects. Old code relying on string returns may break.","severity":"breaking","affected_versions":"<1.0"},{"fix":"Use import http_sf (underscore).","message":"The module name is http_sf (underscore), not http-sf. Import errors occur if using hyphen.","severity":"deprecated","affected_versions":"all"},{"fix":"Encode string to bytes before parsing: parse_item(b'\"value\"').","message":"Input must be bytes, not str, for parsing functions. Passing str will raise TypeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use serialized.decode() if you need a string.","message":"Serialize functions return bytes, not str. May need .decode() for string output.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-01':21 '-13':22 '-8941':37 '1':25 '1.2.0':18 '2025':20 '3.10':31 '8941':15 'cadenc':23 'current':16 'field':13,35 'http':2,11,32 'http-sf':1 'irregular':24 'librari':6 'minor':26 'pars':8,39 'per':27 'python':5,30 'releas':19 'requir':29 'rfc':14,36 'serial':10,38 'sf':3 'structur':12,34 'structured-field':33 'version':17 'year':28","created_at":"2026-04-27T16:59:55.609780+00:00","updated_at":"2026-04-27T16:59:55.609780+00:00","problems":[{"fix":"Use parse_item(b'...') instead of parse_item('...').","cause":"Passing a Python str instead of bytes to parse functions.","error":"TypeError: argument should be bytes, buffer or ASCII string, not 'str'"},{"fix":"Install with 'pip install http-sf' and import as 'from http_sf import parse_item'.","cause":"Wrong module name; often confused with 'http-sf' (hyphen) or 'http_sf' not installed.","error":"TypeError: cannot import name 'parse_item' from 'http_sf'"},{"fix":"Upgrade to >=1.2.0: pip install --upgrade http-sf.","cause":"Using older version (<1.0) where BareItem was a string.","error":"AttributeError: 'BareItem' object has no attribute 'value'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.3.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/mnot/http-sf","docs":null,"changelog":null,"pypi":"https://pypi.org/project/http-sf/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}