{"id":19979042,"url":"https://github.com/fphammerle/python-manchester-code","last_synced_at":"2025-05-04T04:32:26.680Z","repository":{"id":37082936,"uuid":"292872290","full_name":"fphammerle/python-manchester-code","owner":"fphammerle","description":"Python library to encode \u0026 decode data as Manchester code","archived":false,"fork":false,"pushed_at":"2025-04-19T14:28:23.000Z","size":553,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T06:03:19.710Z","etag":null,"topics":["encoding","phase-encoding","radio-frequency","telecommunication","transmission"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/manchester-code/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fphammerle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-09-04T14:44:00.000Z","updated_at":"2025-04-19T14:28:26.000Z","dependencies_parsed_at":"2023-02-18T03:46:26.166Z","dependency_job_id":"3113c9bb-03bc-4a64-92ff-57fe0c8afbde","html_url":"https://github.com/fphammerle/python-manchester-code","commit_stats":{"total_commits":164,"total_committers":2,"mean_commits":82.0,"dds":"0.27439024390243905","last_synced_commit":"1b6d3ff894cd4da596550b70132191d3d0ecc36c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphammerle%2Fpython-manchester-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphammerle%2Fpython-manchester-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphammerle%2Fpython-manchester-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fphammerle%2Fpython-manchester-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fphammerle","download_url":"https://codeload.github.com/fphammerle/python-manchester-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252288911,"owners_count":21724323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","phase-encoding","radio-frequency","telecommunication","transmission"],"created_at":"2024-11-13T03:36:14.919Z","updated_at":"2025-05-04T04:32:24.800Z","avatar_url":"https://github.com/fphammerle.png","language":"Python","readme":"# manchester-code\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![CI Pipeline Status](https://github.com/fphammerle/python-manchester-code/workflows/tests/badge.svg)](https://github.com/fphammerle/python-manchester-code/actions)\n[![Last Release](https://img.shields.io/pypi/v/manchester-code.svg)](https://pypi.org/project/manchester-code/#history)\n[![Compatible Python Versions](https://img.shields.io/pypi/pyversions/manchester-code.svg)](https://pypi.org/project/manchester-code/)\n[![DOI](https://zenodo.org/badge/292872290.svg)](https://zenodo.org/badge/latestdoi/292872290)\n\nPython library to encode \u0026 decode data as [Manchester code](https://en.wikipedia.org/wiki/Manchester_code)\n\n## Setup\n\n```sh\n$ pip3 install --user --upgrade manchester-code\n```\n\n## Usage\n\n0-bits translate to low-high, 1-bits to high-low (G. E. Thomas convention).\n\n```python\nfrom manchester_code import encode, decode, decode_bits\n\nmanchester_code = encode([0b00001111, 0b01101001])\nprint(''.join(f'{m:08b}' for m in manchester_code))\n# 01010101101010100110100110010110\n\nencode(b'msg')\n# b'i\\xa6jZij'\n\ndecode([0b01010101, 0b10101010, 0b01101001, 0b10010110])\n# 0000111101101001\n\ndecode(b'ieiVjeiV')\n# b'data'\n\nlist(decode_bits([False, True, True, False]))\n# [False, True]\n\nlist(decode_bits([0, 1, 1, 0, 0, 1, 0, 1]))\n# [False, True, False, False]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffphammerle%2Fpython-manchester-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffphammerle%2Fpython-manchester-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffphammerle%2Fpython-manchester-code/lists"}