Skip to main content

Python library to encode & decode data as Manchester code

Project description

manchester-code

Code style: black CI Pipeline Status Last Release Compatible Python Versions

Python library to encode & decode data as Manchester code

Setup

$ pip3 install --user --upgrade manchester-code

Usage

0-bits translate to low-high, 1-bits to high-low (G. E. Thomas convention).

import manchester-code

manchester_code = encode([0b00001111, 0b01101001])
print(''.join(['{:08b}'.format(m) for m in manchester_code]))
# 01010101101010100110100110010110

encode(b'msg')
# b'i\xa6jZij'

decode([0b01010101, 0b10101010, 0b01101001, 0b10010110])
# 0000111101101001

decode(b'ieiVjeiV')
# b'data'

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

manchester-code-1.0.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

manchester_code-1.0.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file manchester-code-1.0.0.tar.gz.

File metadata

  • Download URL: manchester-code-1.0.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2

File hashes

Hashes for manchester-code-1.0.0.tar.gz
Algorithm Hash digest
SHA256 744b906ff5ebb7ebc7193150c71d31fd7a516fe302be99b483af61712525dfe4
MD5 221b685e5cef59784b4288ba0aa97a80
BLAKE2b-256 4f972aade336d4c75b7819648150f13e7499c3c0c4c88713bbc80be024d5e743

See more details on using hashes here.

File details

Details for the file manchester_code-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: manchester_code-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2

File hashes

Hashes for manchester_code-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe7b75702c77dd1c8ab66466535c064f1f668bb9442ebf7569881fdb6a88f971
MD5 514f13e2ed1471d9ac53ba7a815d84cb
BLAKE2b-256 b0e928e166cf3a9f05ec93021ce6446519adf53394d4f820365681a43da19415

See more details on using hashes here.

Supported by

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