Skip to main content

Chunked transfer encoding as defined in RFC 7230

Project description

httpchunked

Do you need support for chunked transfer encoding in your Python web server, without adding a dependency on a complete framework? Then httpchunked is the module you need! It has no third-party dependencies and consists of only two functions: decode and encode.

Usage

Decoding

$ cat main.py
from io import BytesIO

from httpchunked import decode

if __name__ == "__main__":
    dst = BytesIO()
    src = BytesIO(b"3\r\nfoo\r\n0\r\n\r\n")
    decode(dst, src)
    raw = dst.getvalue()
    print(raw)
$ python main.py
b'foo'

Encoding

$ cat main.py
from io import BytesIO

from httpchunked import encode

if __name__ == "__main__":
    dst = BytesIO()
    src = BytesIO(b"foo")
    encode(dst, src)
    raw = dst.getvalue()
    print(raw)
$ python main.py
b'3\r\nfoo\r\n0\r\n\r\n'

Installation

pip install httpchunked

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

httpchunked-0.1.2.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

httpchunked-0.1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file httpchunked-0.1.2.tar.gz.

File metadata

  • Download URL: httpchunked-0.1.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for httpchunked-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a522c0b9e6287c3898685374b1f00008103d8f56d1a5ffec059de7f938b6e71a
MD5 9fb21de3d5cf5b9bafe25f44f22fed86
BLAKE2b-256 80e0ef7a87fcd9489ebcd773631c09b78d94e05296fcfa6aa07141a5fae9529b

See more details on using hashes here.

File details

Details for the file httpchunked-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: httpchunked-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for httpchunked-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14ab89bd65f3992482ca555a63e2e670dff65346ee2dba77eddbcd8018be2923
MD5 489681819a32f097f734796e0683f3e7
BLAKE2b-256 786d37673387a770b77243c68d200351c19c0545f3eaa32ad61c21f911a7ea3b

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