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 DOI

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.1.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

manchester_code-1.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manchester-code-1.1.0.tar.gz
  • Upload date:
  • Size: 27.5 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.5

File hashes

Hashes for manchester-code-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e8b09dd45785233359de02cc1baf2747af7993a6335099ca3c6784d21f184e54
MD5 908e946035c7dd1490ecd611c93982c4
BLAKE2b-256 ba6c7e8d4e9113e10fb931d0cfa28edc878cbd634d40129465d75dd7edbfe0d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: manchester_code-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.5

File hashes

Hashes for manchester_code-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23251eed4c91f42b8f05dd7e1cc4c97b895d9f7ad8dadaa0162b75680e282d37
MD5 94cb7a7ce057773be06e57dabedc26ea
BLAKE2b-256 0102c9601fa2e9b87ea76de751838c5fd09cac61deee014c7256b9592a1cc7c2

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