Skip to main content

Binary and Arduino simulation toolkit with waveform visualization and signal processing

Project description

Binaryduino

Binaryduino is a powerful Python library for simulating binary-level communication with Arduino-like devices. It enables developers to encode messages into binary, simulate noisy transmission, visualize waveforms, run virtual socket communication, and handle Arduino serial simulations. The library is ideal for educational purposes, low-level protocol simulation, and digital communication visualization.


🚀 Features

  • Encode/decode text messages to binary
  • Visualize binary waveforms using matplotlib
  • Simulate noisy signals and compute accuracy
  • Simulate Arduino serial communication (mock)
  • Binary manipulation (AND, OR, XOR, flip, parity)
  • Pydantic-based configuration validation
  • Rich CLI via Click and Typer
  • Load environment variables securely
  • Save/load binary to/from file
  • Display binary data in styled tables

📦 Installation

Ensure you have Python 3.7+ and pip installed. Then, run:

pip install binaryduino

Or, from local development:

git clone https://github.com/EdenGithhub/binaryduino.git
cd binaryduino
pip install -e .

🛠 Usage

CLI Binary Encoder

python -m binaryduino.core

You'll be prompted:

Enter message to encode: Hello

➡ This will:

  • Encode "Hello" to binary
  • Display the binary result
  • Open waveform visualization

Example: Visualizing Binary Signal

from binaryduino.core import binary_waveform

binary_waveform("110011001100")

Example: Encoding and Decoding

from binaryduino.core import encode_message, decode_message

binary = encode_message("Hi")
text = decode_message(binary)
print(text)  # Output: Hi

Example: Simulating Noisy Transmission

from binaryduino.core import generate_signal_noise, signal_accuracy

original = "10101010"
noisy = generate_signal_noise(original, noise_level=0.2)
accuracy = signal_accuracy(original, noisy)
print(f"Accuracy: {accuracy * 100:.2f}%")

🧪 Development

Setup Virtual Environment

python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt

Run CLI

python -m binaryduino.core

Test Pydantic Config Validation

from binaryduino.core import test_config_validation

test_config_validation()

🔐 Environment Variables for PyPI

$env:PYPI_USERNAME = "your_username"
$env:PYPI_TOKEN = "pypi-xxxxxxx"

To upload with twine:

python -m twine upload dist/* --username $env:PYPI_USERNAME --password $env:PYPI_TOKEN --verbose

📜 License

MIT License. See LICENSE file.


🙌 Author

Created by Adam Alcander et Eden. Contributions welcome!

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

binaryduino-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

binaryduino-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file binaryduino-0.1.0.tar.gz.

File metadata

  • Download URL: binaryduino-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for binaryduino-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42c4db6edd225e95c018360e1d7a9ebba6dcf339aa1e8b10b15fb0e92dd863ae
MD5 32dd1edfd0cd7e830eaa35fffb1e8456
BLAKE2b-256 1030b35099f51c86c24fee6bb2bf521d4391aa26d120ba156c6ec673c8a5d73d

See more details on using hashes here.

File details

Details for the file binaryduino-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: binaryduino-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for binaryduino-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c538b943057dae6a83617cae7228d21daca565788a8e78d6e765df5989a1008c
MD5 ade13c1fc1b837e0f0c473bc365df757
BLAKE2b-256 638fd7a619bb573b8cc4e00ecd94b946cc7af4ee68b00a5db864e61ebdf3caed

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