Skip to main content

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_sequence to 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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bseqgen-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for bseqgen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99f9ef5209d4badc15798afc6caf80cdd70814f774c6f87bb5e662672a7c0136
MD5 9e37c6fa688df6cde33a579302a7b292
BLAKE2b-256 4d34afe8f03ea6114e2a46017ecbec56b2bd6b1d98bb5e31a64ed4b124b5f613

See more details on using hashes here.

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

Hashes for bseqgen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e30acd206fee918215478ead8fdea20d8de3299be7bb961cafa720b85b9f3d30
MD5 5b372cfdf08d22df27f785fe64ade3de
BLAKE2b-256 7a139d895c9f570e902e794b137017e83ddf330896f6090fb84d210a1ef10285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page