Skip to main content

A script to encode/decode arbitrary computer files into DNA sequences.

Project description

[![Code Health](](

This is a python script to encode/decode arbitrary computer files into DNA sequences. It is a straight implementation of a method published in [this][1] Nature’s paper. The details of the method can be found in the [Supplementary Information][2] report. The source code organization follows the article steps and nomenclature, so it should be easy to understand.

How to use

The script accepts four types of operations passed as arguments together with the file name:

./ <arg> <inputfile>

The following arguments are accepted: * -e: encode <inputfile> and save as <inputfile>.dna * -d: decode <inputfile(.dna)> and save as <inputfile>.decoded * -s: encode <inputfile> splitting into various DNA segments and save as <inputfile> * -j: decode <inputfile(> joining the segments and save as <inputfile>.decoded

As a example, we can decode one the [files][3] encoded by the authors of the paper:

./ -d examples/DNA_versions/wssnt10.txt.dna

To see the decoded file:

cat examples/DNA_versions/wssnt10.txt.decoded

[1]: [2]: [3]:

Project details

Release history Release notifications

History Node


History Node


This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
file2dna-0.2.tar.gz (5.0 kB) Copy SHA256 hash SHA256 Source None Sep 4, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page