Skip to main content

KARP Communication Protocol

Project description

KeepAliveRequestProtocol

PiPy Code style: black

A mix-in protocol between http and websocket. It combines the route-based navigation of http with the streamed aspects of websockets.

This is still an early stage of development, things can change heavily in the future.

Requirements

Python3.6+

Installation

Pip:

pip install karp

From Source:

git clone --depth=1 https://github.com/tooxo/karp
cd karp/
pip install .

Protocol Definition

Request

name content length
Header Text KARP_HEAD 9
Route (case insensitive) route name ([A-z_]) n/a
Type (Request=0; Response=1) 0 1
Response Wanted (0 or 1) 1 1
Request ID Request Identifier (16* [0-9]) 16
Content_Length C_LEN 5
Content_Length content length in num of bytes n/a
Data KARP_DATA 9
Data request data encoded in base64 Content_Length
End of Request KARP_END 7

Length = 9 + len(route_name) + 1 + 1 + 16 + 5 + len(content_length) + 9 + content_length +

Meta

  • Allowed chars: [A-Za-z0-9+/=]

Response

name content length
Header Text KARP_HEAD 9
Type (Request=0; Response=1) 1 1
Request Successful (1/0)*¹ 1 1
Request ID Request Identifier (16* [0-9]) 16
Content_Length C_LEN 5
Content_Length content length in num of bytes n/a
Data KARP_DATA 9
Data request data encoded in base64 Content_Length
End of Request KARP_END 7

*¹ = If the request was not successful, the data will be an error message.

Meta

  • Allowed chars: [A-Za-z0-9+/=]
  • Every Response/Request sent to the socket ends with \n as a command-separator.

TODO:

  • Add Getting Started to README
  • Unit-Tests

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

karp-0.0.14.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

karp-0.0.14-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file karp-0.0.14.tar.gz.

File metadata

  • Download URL: karp-0.0.14.tar.gz
  • Upload date:
  • Size: 7.6 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.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for karp-0.0.14.tar.gz
Algorithm Hash digest
SHA256 bd8eb0ff9940d540d597203b960af9bf58f59908db13855ffbaa2b19b986a44b
MD5 8e9020c5897e5eb96e4b3a84a11ea2f8
BLAKE2b-256 401db25568084d6464d939c640d659ccc265b89f5312e6f72bffd196317e90e8

See more details on using hashes here.

File details

Details for the file karp-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: karp-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 8.7 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.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for karp-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 f65c019985fb1b35f23eeda856aff44667926a9eaa1db392eb3abad4d8352134
MD5 53dd36951092d260bfb76b469728c2a7
BLAKE2b-256 c8e5901a90f67a5f77830f01fd0484701aa570fc86be6ae02dd40e467053e004

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