Skip to main content

Bitslice

Verilog-like bitslicing for Python.

Installation

Install the library from PyPI:

pip install bitslice

Quickstart

Bitslice is designed to behave as an integer value as much as possible. All operators defined on int should be supported.

Bitslice adds the ability to extract or set one or more bits of the value:

from bitslice import Bitslice
value = Bitslice(5, size=4)
value[3:1] - 1

Advanced features: slice aliasing

value = Bitslice(5, size=4)
value.add_alias('lower', start=0, end=1)
value.add_alias('upper', start=2, end=3)

value['lower'] == value[1:0]

See bitslice.py for more examples.

Metadata

Release files for bitslice 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitslice 0.3.0
File Size Uploaded
bitslice-0.3.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bitslice 0.3.0
File Interpreter ABI Platform
bitslice-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / bitslice-0.3.0.tar.gz

Download URL bitslice-0.3.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
57918d8828a673561013dff32c5dacb7619b33b6db543007088141d964817bfb
BLAKE2b-256 checksum
How to use checksums
b3f12bfd48d1247f7fd19647d9a1af59e41f533cc02f69bc8a3f50bff644b991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.5 Linux/5.8.0-48-generic

Release files / bitslice-0.3.0-py3-none-any.whl

Download URL bitslice-0.3.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
092a898746020be9b349110ec1507677bb0f489867020bffd9a858065e5b217a
BLAKE2b-256 checksum
How to use checksums
c0f97ab9937e208c66ea185ca0e59826c845901851f09989ac6207236c47d504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.5 Linux/5.8.0-48-generic

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page