This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python API for the Interactive Tree of Life (iTOL)

Created by Albert Wang (albertyw at mit.edu)

With Complements to: iTOL (Interactive Tree of Life), Python requests package.

This iTOL API allows local software to upload trees to iTOL using Itol.py and export uploaded trees using ItolExport.py using direct Python calls or through shell. An active internet connection to the iTOL website is required.

Installation

pip install itolapi

Uploading Trees To iTOL (Itol.py)

From Command Line

(If you need to do anything more than displaying basic tree structures, you must call the Python iTOL API from within a Python program)

$ Itol.py /path/to/example.tree
http://itol.embl.de/external.cgi?tree=1234567890&restore_saved=1

From Python

Running from a python program is much more flexible than running from command line and allows access to all iTOL options

from itolapi import Itol
itol_uploader = Itol.Itol()
itol_uploader.add_variable('treeFile', '/path/to/example.tree')
itol_uploader.add_variable('treeFormat', 'newick')
itol_uploader.add_variable('treeName', 'apple')
status = itol_uploader.upload()
assert status != False
itol_uploader.comm.upload_output
# SUCCESS: 1234567890
itol_uploader.comm.tree_id
# 1234567890
itol_uploader.get_webpage()
# http://itol.embl.de/external.cgi?tree=1234567890&restore_saved=1
itol_uploader.get_itol_export()
# <ItolExport.ItolExport instance at 0x207c5f0>

An example for using the Python iTOL API can found in examples/example.py.

Downloading Trees From iTOL (ItolExport.py)

From Command Line

(If you would like to set any parameters other than the tree id, location to save the file, file format, and whether to display datasets, you must use ItolExport from a Python program)

$ ItolExport.py TREEID FILELOCATION FORMAT [OPTIONS]
Options include:
  • -d: show datasets
  • -r: verbose output
  • -h: help

From Python

Running ItolExport.py from a Python program allows you to use all the options that iTOL has available.

from itolapi import ItolExport
itol_exporter = ItolExport.ItolExport()
itol_exporter.add_export_param_value('tree', tree_id)
assert format in ['png', 'svg', 'eps', 'ps', 'pdf', 'nexus', 'newick']
itol_exporter.add_export_param_value('format', format)
itol_exporter.add_export_param_value(param_key, param_value)
itol_exporter.export(file_location)

Valid param_key and param_value values can be found on the iTOL API page.

Bugs/Comments

Send bugs and comments as issues on the Github repository.

Development

To run tests:

pip install tox
python setup.py install
tox

To update PyPI:

python setup.py sdist upload
Release History

Release History

1.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
itolapi-1.3.0.tar.gz (5.8 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting