{"id":436,"library":"httptools","title":"httptools","description":"A Python binding for the Node.js HTTP parser, providing fast and efficient HTTP parsing capabilities. Current version: 0.7.1. Maintained actively with regular updates.","status":"active","version":"0.7.1","language":"python","source_language":"en","source_url":"https://github.com/MagicStack/httptools","tags":["HTTP parsing","Python binding","Node.js parser"],"install":[{"cmd":"pip install httptools","lang":"bash","label":"Install httptools"}],"dependencies":[],"imports":[{"note":"Ensure correct import path to access the HttpRequestParser class.","symbol":"HttpRequestParser","correct":"from httptools import HttpRequestParser"}],"quickstart":{"code":"from httptools import HttpRequestParser\n\n# Initialize the parser with a protocol object\nparser = HttpRequestParser(protocol)\n\n# Feed data to the parser\nparser.feed(data)\n\n# Access parsed data\nparsed_data = parser.get_parsed_data()","lang":"python","description":"A basic example demonstrating how to import and use the HttpRequestParser class from httptools."},"warnings":[{"fix":"Upgrade to Python 3.9 or later.","message":"Python 3.8 is no longer supported; Python 3.9 or higher is required.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Ensure the 'protocol' object is defined and instantiated before being passed to HttpRequestParser, and that it implements all necessary methods as per httptools documentation.","message":"The 'protocol' object passed to HttpRequestParser must be defined and then have the required methods implemented.","severity":"breaking","affected_versions":"all"},{"fix":"Define and initialize the 'protocol' object before passing it to HttpRequestParser.","message":"The 'protocol' variable is not defined before being passed to HttpRequestParser.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T13:48:18.954Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install httptools`","cause":"The `httptools` library is not installed in the Python environment where the code is being run.","error":"ModuleNotFoundError: No module named 'httptools'"},{"fix":"Ensure you have the necessary C++ build tools installed (e.g., Microsoft Visual C++ Build Tools on Windows). Alternatively, try installing within a virtual environment or using a package manager like conda: `conda install -c conda-forge httptools`","cause":"This error typically occurs during installation, especially on Windows, because `httptools` is a C extension and requires a C++ compiler (like Microsoft Visual C++ Build Tools) to build from source if a pre-built wheel is not available for your specific Python version and operating system.","error":"ERROR: Failed building wheel for httptools"},{"fix":"Ensure that the data being fed to `httptools` parser methods is a byte string (e.g., `b'GET / HTTP/1.1\\r\\n\\r\\n'`) rather than a regular string.","cause":"This error can occur when `httptools` parser methods, such as `feed_data`, expect byte-like objects but receive a string instead.","error":"TypeError: 'str' does not have the buffer interface"},{"fix":"Validate the incoming HTTP request or response data, specifically the URL, to ensure it conforms to HTTP specifications before passing it to the `httptools` parser.","cause":"This error indicates that the HTTP parser encountered a malformed or invalid URL within the HTTP request or response it was trying to process.","error":"httptools.HttpParserInvalidURLError"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.5,"disk_size":"18.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.5,"disk_size":"20M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":0.7,"disk_size":"20.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":0.7,"disk_size":"22M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":0.6,"disk_size":"12.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.6,"disk_size":"14M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.7,"disk_size":"12.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.5,"disk_size":"13M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.5,"disk_size":"18.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.5,"disk_size":"19M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}