Library for generating and working with binary sequences.
Project description
bseqgen
Small Python library for working with Binary Sequences, with a focus on pseudorandom binary sequences and signal-processing style operations.
Status: Beta (API may evolve and change significantly before v1.0)
Features
- Tuple binary sequence representation.
- Input validation from strings, lists, tuples, etc.
- Shift sequences left/right (circular, supports negative shifts).
- Sequence repetition and truncation.
- Byte/hex/string representations.
- Basic sequence metrics (bit counts, balance, basic symbol entropy).
- Use
random_sequenceto generate a random binary sequence.
Installation
pip install bseqgen
Quick Examples
from bseqgen.base import BinarySequence
from bseqgen import random_sequence
# can define your own binary sequence.
seq = BinarySequence("110011")
# or use one that comes with bseqgen
random_seq = random_sequence(n=10)
# enjoy!
print(seq.bits)
# (1, 1, 0, 0, 1, 1)
print(seq.shift(2).bits)
# (0, 0, 1, 1, 1, 1)
print(seq.ones, seq.zeros)
# 4 2
Roadmap
Planned additions include:
- PRBS generators (Gold codes, Walsh-Hadamard, Kasami and more)
- Autocorrelation and cross-correlation operations.
- Run length analysis.
- NumPy interoperability.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bseqgen-0.1.0b1.tar.gz
(14.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bseqgen-0.1.0b1.tar.gz.
File metadata
- Download URL: bseqgen-0.1.0b1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2dd14803998498f70bdb18de1586b2894035a8debd915cec1efe6c72c3c2110
|
|
| MD5 |
455724aea480e1c68e973459457d44ac
|
|
| BLAKE2b-256 |
3b58323368f6ce829fe9a6252daa91a3f15c70d9a20a9359bd5b193430d393ff
|
File details
Details for the file bseqgen-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: bseqgen-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b198b1396245e4f1fda258fecc9ad6ff594b0d5f54a07dcf0effe2a2e8be321
|
|
| MD5 |
3c1ff8804e453151ee5eb98020053e70
|
|
| BLAKE2b-256 |
381877b8267c0dd9fcab1e2aab7b63cc83097d2fa475dc8333e7c31f80120d12
|