Transform binary data into DNA sequences with lossless encoding, robust error correction, and DNA-native computation capabilities.
A comprehensive toolkit for binary-to-DNA conversion, storage, and computation
Four optimized encoding schemes for different use cases: Quaternary for density, Balanced GC for synthesis, RLL for sequencing, and Triplet for error tolerance.
Robust error correction adapted for GF(4) arithmetic. Automatically detects and corrects up to 8 nucleotide errors per block, ensuring data integrity.
Perform computations directly on DNA-encoded data with logic gates (AND, OR, XOR, NOT) and arithmetic operations (add, subtract, multiply, divide).
Store and manage files as DNA sequences with full CRUD operations, hierarchical directories, metadata handling, and powerful search capabilities.
Feature-rich command-line interface with rich output formatting, plus a RESTful API with OpenAPI documentation for seamless integration.
Versioned file format with headers, data blocks, ECC parity, and footers. Deterministic encoding ensures reproducible results every time.
A simple yet powerful encoding pipeline
Any file or data is converted to a binary stream of 0s and 1s
01001000 01100101 01101100 01101100 01101111
Bits are mapped to nucleotides using the selected encoding scheme
00 → A
01 → T
10 → C
11 → G
Data is packaged with headers, checksums, and error correction codes
Final output: a complete, verifiable DNA sequence ready for use
Four encoding schemes optimized for different requirements
Standard 2-bit per nucleotide encoding. Maximum information density for general-purpose use.
00→A 01→T 10→C 11→G
Rotating mapping maintains 40-60% GC content. Ideal for compatibility with synthesis requirements.
Rotating schedule every N bases
Prevents homopolymer runs for improved sequencing accuracy. Uses deterministic escaping scheme.
Max run length configurable
3x redundancy for maximum error tolerance. Decode by majority voting for robust recovery.
0→ATC 1→GAC
A layered design for flexibility and extensibility
Multiple interfaces for every use case
# Encode a file to DNA sequence
vibedna encode document.pdf -o document.dna --scheme quaternary
# Decode back to original file
vibedna decode document.dna -o recovered.pdf --verify
# Quick text encoding (no container headers)
vibedna quick "Hello, DNA World!"
# Output: TACGTACGTACGATCG...
# Perform DNA computation
vibedna compute gate XOR ATCGATCG GCTAGCTA
# Output: GGGCGGGC
# DNA File System operations
vibedna fs cp ./report.docx /documents/report.docx
vibedna fs ls /documents/
vibedna fs export /documents/report.docx ./output/
from vibedna import DNAEncoder, DNADecoder, DNAFileSystem
from vibedna.core.encoder import EncodingConfig, EncodingScheme
# Initialize encoder with configuration
config = EncodingConfig(scheme=EncodingScheme.QUATERNARY)
encoder = DNAEncoder(config)
# Encode data to DNA
dna_sequence = encoder.encode(
b"Hello, DNA World!",
filename="hello.txt"
)
print(f"Encoded: {dna_sequence[:50]}...")
# Decode back to original data
decoder = DNADecoder()
result = decoder.decode(dna_sequence)
print(f"Decoded: {result.data}")
print(f"Filename: {result.filename}")
# DNA File System usage
fs = DNAFileSystem()
fs.create_file("/docs/report.txt", b"Report content")
data = fs.read_file("/docs/report.txt")
# DNA Computation
from vibedna.compute import DNALogicGates
gates = DNALogicGates()
result = gates.xor("ATCG", "GCTA")
print(f"XOR Result: {result}")
# Start the API server
uvicorn vibedna.api.rest_server:app --host 0.0.0.0 --port 8000
# Encode data (base64 input)
curl -X POST "http://localhost:8000/encode" \
-H "Content-Type: application/json" \
-d '{
"data": "SGVsbG8gV29ybGQh",
"filename": "hello.txt",
"scheme": "quaternary"
}'
# Quick encode text
curl -X POST "http://localhost:8000/quick/encode" \
-H "Content-Type: application/json" \
-d '{"text": "Hello World"}'
# Decode DNA sequence
curl -X POST "http://localhost:8000/decode" \
-H "Content-Type: application/json" \
-d '{"sequence": "ATCGATCG..."}'
# Perform DNA computation
curl -X POST "http://localhost:8000/compute" \
-H "Content-Type: application/json" \
-d '{
"operation": "XOR",
"sequence_a": "ATCGATCG",
"sequence_b": "GCTAGCTA"
}'
# Pull the VibeDNA image
docker pull vibedna/vibedna:latest
# Run the API server
docker run -p 8000:8000 vibedna/vibedna
# Run CLI commands via Docker
docker run vibedna/vibedna vibedna encode /data/file.pdf
# Build from source
docker build -t vibedna .
# Run with volume mount for file access
docker run -v $(pwd)/data:/data \
-p 8000:8000 \
vibedna/vibedna
# Docker Compose for full stack
docker-compose up -d
A robust container format with built-in integrity verification
ATCGATCG
Identifies valid VibeDNA files
GCTAGCTA
Marks the end of data stream
SHA-256
Ensures complete data integrity
Get started with VibeDNA today and explore the intersection of digital and biological computing.
pip install vibedna