Skip to main content

A library to encode text as DNA and decode DNA to text.

Project description

GeneSpeak

GitHub - License PyPI - Python Version PyPI - Package Version Conda - Platform Conda (channel only) Docs - GitHub.io

A library to encode text as DNA and decode DNA to text.

GeneSpeak allows you to encode regular text as DNA using base-pairs (A, T, G, C) and convert back to text. The coding scheme could be any combination of A, T, G, C.

Example

import genespeak as gp
print(f'{gp.__name__} version: {gp.__version__}')

schema = "ATCG"
text = "Hello World!"
dna = gp.text_to_dna(text, schema=schema)
print(f'Text: {text}\nEncoded DNA: {dna}\n')
text_from_dna = gp.dna_to_text(dna, schema=schema)
print(f'Text: {text}\nEncoded DNA: {dna}\nDecoded Text: {text_from_dna}\n')

Output

genespeak version: 0.0.3
Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT

Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT
Decoded Text: Hello World!

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

genespeak-0.0.4.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

genespeak-0.0.4-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

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