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.1.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.1.tar.gz.
File metadata
- Download URL: bseqgen-0.1.1.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 |
99f9ef5209d4badc15798afc6caf80cdd70814f774c6f87bb5e662672a7c0136
|
|
| MD5 |
9e37c6fa688df6cde33a579302a7b292
|
|
| BLAKE2b-256 |
4d34afe8f03ea6114e2a46017ecbec56b2bd6b1d98bb5e31a64ed4b124b5f613
|
File details
Details for the file bseqgen-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bseqgen-0.1.1-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 |
e30acd206fee918215478ead8fdea20d8de3299be7bb961cafa720b85b9f3d30
|
|
| MD5 |
5b372cfdf08d22df27f785fe64ade3de
|
|
| BLAKE2b-256 |
7a139d895c9f570e902e794b137017e83ddf330896f6090fb84d210a1ef10285
|