Metadata-Version: 2.1
Name: bitslice
Version: 0.3.0
Summary: Verilog-like bitvector slicing
Home-page: https://github.com/zegervdv/bitslice
License: MIT
Author: Zeger Van de Vannet
Author-email: zegervdv@me.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown

# 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:

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

Advanced features: slice aliasing
~~~ python
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](https://github.com/zegervdv/bitslice/blob/master/bitslice/bitslice.py) for more examples.

