{"id":17685224,"url":"https://github.com/zegervdv/bitslice","last_synced_at":"2026-02-24T00:34:47.594Z","repository":{"id":57415444,"uuid":"258633106","full_name":"zegervdv/bitslice","owner":"zegervdv","description":"Verilog bit slicing for python","archived":false,"fork":false,"pushed_at":"2021-05-13T08:46:35.000Z","size":36,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-07T22:07:15.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zegervdv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-24T21:55:45.000Z","updated_at":"2024-11-30T15:49:02.000Z","dependencies_parsed_at":"2022-09-10T01:41:33.366Z","dependency_job_id":null,"html_url":"https://github.com/zegervdv/bitslice","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegervdv%2Fbitslice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegervdv%2Fbitslice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegervdv%2Fbitslice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegervdv%2Fbitslice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zegervdv","download_url":"https://codeload.github.com/zegervdv/bitslice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zegervdv%2Fbitslice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259159612,"owners_count":22814490,"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":[],"created_at":"2024-10-24T10:27:03.296Z","updated_at":"2026-02-24T00:34:47.549Z","avatar_url":"https://github.com/zegervdv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitslice\n\nVerilog-like bitslicing for Python.\n\n## Installation\n\nInstall the library from PyPI:\n~~~\npip install bitslice\n~~~\n\n## Quickstart\nBitslice is designed to behave as an integer value as much as possible.\nAll operators defined on `int` should be supported.\n\nBitslice objects use indexing to emulate Verilog-style bit slicing.\n\n~~~ python\nfrom bitslice import Bitslice\nvalue = Bitslice(5, size=4)\n\n# Binary: 0b0101\nprint(value)\n0x0005 (5)\n\n# Select the lowest bit (index 0, right-most)\n#\n#   index:   3210\n#   value: 0b0101\nprint(value[0])\n0x0001 (1)\n\n# Select bits 2 -\u003e 1\n# resulting in 0b10 == 2\nprint(value[2:1])\n0x0002 (2)\n\n# Set the upper bit\nvalue[3] = 1\n# 0b1101\nprint(value)\n0x000D (13)\n~~~\n\nAdvanced features: slice aliasing\n~~~ python\nvalue = Bitslice(5, size=4)\nvalue.add_alias('lower', start=0, end=1)\nvalue.add_alias('upper', start=2, end=3)\n\nvalue['lower'] == value[1:0]\n~~~\nSee [bitslice.py](https://github.com/zegervdv/bitslice/blob/master/bitslice/bitslice.py) for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzegervdv%2Fbitslice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzegervdv%2Fbitslice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzegervdv%2Fbitslice/lists"}