Add your description here
Project description
YTTP - Custom HTTP Parser
Project Objective
This project implements a custom HTTP parser that supports messages with or without request lines, unlike h11 which requires request lines.
Key Features
- Flexible Message Parsing: Supports both standard HTTP requests and header-only messages (like LSP/MCP protocols)
- Event-driven Architecture: Compatible with h11's interface using Request, Headers, Data, and EndOfMessage events
- Content-Length Body Parsing: Handles fixed-length message bodies
- Chunked Transfer Encoding: Supports chunked message parsing with hex size indicators
- Error Handling: Uses Result[T] pattern for consistent error handling without exceptions
Technical Implementation
The parser uses a state machine approach:
WANT_REQUEST_OR_HEADERS: Determines if first line is HTTP request or headerWANT_HEADERS: Parses header sectionWANT_BODY: Parses message body based on Content-Length or Transfer-EncodingCOMPLETE: Message fully parsed
Use Case
Enables parsing of protocols that send header-only messages without HTTP request lines, which h11 cannot handle due to its strict HTTP compliance requirements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yttp-0.0.2.tar.gz.
File metadata
- Download URL: yttp-0.0.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ee9e02fe248ab137d06b0828335357aa19484e46d3b163fc81680abe2de9c2
|
|
| MD5 |
9c8a7c00b8e25f95514f91897e22c66b
|
|
| BLAKE2b-256 |
64ac660995a0942a496ca86b70b28ddba12e744d3f04f9126c3d977367579456
|
File details
Details for the file yttp-0.0.2-py3-none-any.whl.
File metadata
- Download URL: yttp-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e135c5c3e62a9649a9a19d609fb9ef5c5d2af200313103d064fb73edc1860a0
|
|
| MD5 |
45e90f8de494dc682c5e268fd21f2c48
|
|
| BLAKE2b-256 |
240a1eac4f499f4703221042070964bda91c7695016b5f6e16ae19b9b298f02f
|