{"id":37075021,"url":"https://github.com/nitely/http-lazy-headers","last_synced_at":"2026-01-14T08:50:28.248Z","repository":{"id":57437684,"uuid":"77110365","full_name":"nitely/http-lazy-headers","owner":"nitely","description":"Sane HTTP headers with lazy parsing, validation and formatting","archived":true,"fork":false,"pushed_at":"2017-08-08T18:08:29.000Z","size":233,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-29T16:58:34.999Z","etag":null,"topics":["http","parsing","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitely.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-22T03:56:06.000Z","updated_at":"2023-01-28T13:55:47.000Z","dependencies_parsed_at":"2022-09-13T02:40:22.749Z","dependency_job_id":null,"html_url":"https://github.com/nitely/http-lazy-headers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nitely/http-lazy-headers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fhttp-lazy-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fhttp-lazy-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fhttp-lazy-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fhttp-lazy-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitely","download_url":"https://codeload.github.com/nitely/http-lazy-headers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitely%2Fhttp-lazy-headers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","parsing","python"],"created_at":"2026-01-14T08:50:27.582Z","updated_at":"2026-01-14T08:50:28.223Z","avatar_url":"https://github.com/nitely.png","language":"Python","readme":"# HTTP Lazy Headers\n\n\u003e This is in active development and it's not stable at all. Check it back later.\n\nHLH is an abstraction over raw HTTP headers, providing:\n\n* Lazy decoding, parsing and validation of input headers\n* Eager validation and lazy formatting of output headers\n* Methods and helpers for common operations\n* A headers collection on top of `OrderedDict` for fast lookups\n* WSGI support\n* A pure Python implementation without using regex!\n* A sane API\n* A way out of messy strings manipulation and typos\n\n\n## Compatibility\n\n* Python +3.5\n\n\n## Install\n\n```\n$ pip install http_lazy_headers\n```\n\n\n## Usage\n\nInput headers:\n\n```python\nimport http_lazy_headers as hlh\n\n\naccept = hlh.Accept(\n    raw_values_collection=[\n        'foo/bar;baz=qux, */*;q=0.5'])\n\naccept.values()\n# (\n#     (('foo', 'bar'), ParamsCI((('baz', 'qux'),))),\n#     (('*', '*'), ParamsCI((('q', 0.5),)))\n# )\n```\n\nOutput headers:\n\n```python\nimport http_lazy_headers as hlh\n\n\nheaders = hlh.HeadersMut()\n\nheaders.set(\n    hlh.Accept([\n        hlh.accept(\n            hlh.MediaType.text,\n            hlh.MediaType.html,\n            quality=1),\n        hlh.accept(\n            hlh.MediaType.text,\n            hlh.MediaType.star,\n            quality=0.5)]))\n\nheaders.set(\n    hlh.Host([\n        hlh.host('www.Alliancefrançaise.nu')]))\n\nheaders.set(\n    hlh.Connection([\n        hlh.ConnectionOptions.keep_alive]))\n\nstr(headers)\n# ('accept: text/html;q=1, text/*;q=0.5\\r\\n'\n#  'host: xn--www.alliancefranaise.nu-dbc\\r\\n'\n#  'connection: keep-alive')\n```\n\nMore -\u003e [docs]()\n\n\n## Specs. Support\n\n* [rfc7230](http://httpwg.org/specs/rfc7230.html)\n* [rfc7231](http://httpwg.org/specs/rfc7231.html)\n* [rfc7232](http://httpwg.org/specs/rfc7232.html)\n* [rfc7233](http://httpwg.org/specs/rfc7233.html)\n* [rfc7234](http://httpwg.org/specs/rfc7234.html)\n* [rfc7235](http://httpwg.org/specs/rfc7235.html)\n* [rfc6265](http://httpwg.org/specs/rfc6265.html)\n* [rfc3986](https://tools.ietf.org/html/rfc3986) for `Host` validation.\n* [rfc5646](https://tools.ietf.org/html/rfc5646)\n* [rfc6266](https://tools.ietf.org/html/rfc6266)\n* [rfc1034](https://tools.ietf.org/html/rfc1034) \u0026 [rfc1123](https://tools.ietf.org/html/rfc1123)\n* [rfc5234](https://tools.ietf.org/html/rfc5234) ABNF Rules\n\n\n## Is it fast?\n\nIt should be fast enough (i.e: not a bottleneck) for those using\nlibraries and frameworks written in pure Python. Also, it can just\nbe used in some of the input/output headers.\n\nIt should be quite fast in future PyPy3, though.\n\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitely%2Fhttp-lazy-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitely%2Fhttp-lazy-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitely%2Fhttp-lazy-headers/lists"}