Skip to main content

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:

  1. WANT_REQUEST_OR_HEADERS: Determines if first line is HTTP request or header
  2. WANT_HEADERS: Parses header section
  3. WANT_BODY: Parses message body based on Content-Length or Transfer-Encoding
  4. COMPLETE: 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yttp-0.0.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yttp-0.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

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

Hashes for yttp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 87ee9e02fe248ab137d06b0828335357aa19484e46d3b163fc81680abe2de9c2
MD5 9c8a7c00b8e25f95514f91897e22c66b
BLAKE2b-256 64ac660995a0942a496ca86b70b28ddba12e744d3f04f9126c3d977367579456

See more details on using hashes here.

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

Hashes for yttp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e135c5c3e62a9649a9a19d609fb9ef5c5d2af200313103d064fb73edc1860a0
MD5 45e90f8de494dc682c5e268fd21f2c48
BLAKE2b-256 240a1eac4f499f4703221042070964bda91c7695016b5f6e16ae19b9b298f02f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page