itolapi


Nameitolapi JSON
Version 4.1.4 PyPI version JSON
download
home_page
SummaryAPI for interacting with itol.embl.de
upload_time2024-01-20 08:06:39
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords tree life compbio biology bioinformatics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            iTOL Python API
===============

![PyPI](https://img.shields.io/pypi/v/itolapi)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/itolapi)
![PyPI - License](https://img.shields.io/pypi/l/itolapi)

[![Build Status](https://drone.albertyw.com/api/badges/albertyw/itolapi/status.svg)](https://drone.albertyw.com/albertyw/itolapi)
[![Test Coverage](https://api.codeclimate.com/v1/badges/365d217b9dd6c2f97cb4/test_coverage)](https://codeclimate.com/github/albertyw/itolapi/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/365d217b9dd6c2f97cb4/maintainability)](https://codeclimate.com/github/albertyw/itolapi/maintainability)
[![Updates](https://pyup.io/repos/github/albertyw/itolapi/shield.svg)](https://pyup.io/repos/github/albertyw/itolapi/)

> Notice: Due to [iTOL requiring paid subscriptions for batch uploads](https://itol.embl.de/infoReg.cgi),
> this library will be deprecated after October 1, 2020.

Python API for the Interactive Tree of Life (iTOL)

Created by Albert Wang (git at albertyw.com)

With Complements to [iTOL (Interactive Tree of Life)](http://itol.embl.de/).

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](http://itol.embl.de/) 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](http://itol.embl.de/help.cgi#batch).

```python
from itolapi import Itol
from pathlib import Path


itol_uploader = Itol()
itol_uploader.add_file(Path('/path/to/example.tree'))
itol_uploader.params['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
 - `-v`: verbose output
 - `-h`: help

### From Python

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

```python
from itolapi import ItolExport
from pathlib import Path


itol_exporter = 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(Path('/path/to/example_tree'))
```

Valid `param_key` and `param_value` values can be found on [the iTOL API
page](http://itol.embl.de/help.cgi#batch).

Bugs/Comments
-------------

Send bugs and comments as issues on the
[itolapi Github](https://github.com/albertyw/itolapi/) repository.

Development
-----------

To run tests:

```bash
pip install -e .
pip install -r requirements-test.txt
ruff check .
mypy .
coverage run -m unittest
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "itolapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "tree,life,compbio,biology,bioinformatics",
    "author": "",
    "author_email": "Albert Wang <git@albertyw.com>",
    "download_url": "https://files.pythonhosted.org/packages/bc/59/71fbabb6abca0afdbe7edc0d491b2a631de8a57369ad0160cc66e2ea3e7c/itolapi-4.1.4.tar.gz",
    "platform": null,
    "description": "iTOL Python API\n===============\n\n![PyPI](https://img.shields.io/pypi/v/itolapi)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/itolapi)\n![PyPI - License](https://img.shields.io/pypi/l/itolapi)\n\n[![Build Status](https://drone.albertyw.com/api/badges/albertyw/itolapi/status.svg)](https://drone.albertyw.com/albertyw/itolapi)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/365d217b9dd6c2f97cb4/test_coverage)](https://codeclimate.com/github/albertyw/itolapi/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/365d217b9dd6c2f97cb4/maintainability)](https://codeclimate.com/github/albertyw/itolapi/maintainability)\n[![Updates](https://pyup.io/repos/github/albertyw/itolapi/shield.svg)](https://pyup.io/repos/github/albertyw/itolapi/)\n\n> Notice: Due to [iTOL requiring paid subscriptions for batch uploads](https://itol.embl.de/infoReg.cgi),\n> this library will be deprecated after October 1, 2020.\n\nPython API for the Interactive Tree of Life (iTOL)\n\nCreated by Albert Wang (git at albertyw.com)\n\nWith Complements to [iTOL (Interactive Tree of Life)](http://itol.embl.de/).\n\nThis iTOL API allows local software to upload trees to iTOL using\n`itol.py` and export uploaded trees using `itolexport.py` using direct\nPython calls or through shell. An active internet connection to the\n[iTOL website](http://itol.embl.de/) is required.\n\nInstallation\n------------\n\n`pip install itolapi`\n\nUploading Trees To iTOL (itol.py)\n---------------------------------\n\n### From Command Line\n\n(If you need to do anything more than displaying basic tree structures,\nyou must call the Python iTOL API from within a Python program)\n\n```\n$ itol.py /path/to/example.tree\nhttp://itol.embl.de/external.cgi?tree=1234567890&restore_saved=1\n```\n\n### From Python\n\nRunning from a python program is much more flexible than running from\ncommand line and allows access to all [iTOL options](http://itol.embl.de/help.cgi#batch).\n\n```python\nfrom itolapi import Itol\nfrom pathlib import Path\n\n\nitol_uploader = Itol()\nitol_uploader.add_file(Path('/path/to/example.tree'))\nitol_uploader.params['treeName'] = 'apple'\nstatus = itol_uploader.upload()\nassert status != False\nitol_uploader.comm.upload_output\n# SUCCESS: 1234567890\nitol_uploader.comm.tree_id\n# 1234567890\nitol_uploader.get_webpage()\n# http://itol.embl.de/external.cgi?tree=1234567890&restore_saved=1\nitol_uploader.get_itol_export()\n# <ItolExport.ItolExport instance at 0x207c5f0>\n```\n\nAn example for using the Python iTOL API can found in\n`examples/example.py`.\n\nDownloading Trees From iTOL (itolexport.py)\n-------------------------------------------\n\n### From Command Line\n\n(If you would like to set any parameters other than the tree id,\nlocation to save the file, file format, and whether to display datasets,\nyou must use ItolExport from a Python program)\n\n```\n$ itolexport.py TREEID FILELOCATION FORMAT [OPTIONS]\n```\n\nOptions include:\n - `-d`: show datasets\n - `-v`: verbose output\n - `-h`: help\n\n### From Python\n\nRunning itolexport.py from a Python program allows you to use all the\noptions that iTOL has available.\n\n```python\nfrom itolapi import ItolExport\nfrom pathlib import Path\n\n\nitol_exporter = ItolExport()\nitol_exporter.add_export_param_value('tree', tree_id)\nassert format in ['png', 'svg', 'eps', 'ps', 'pdf', 'nexus', 'newick']\nitol_exporter.add_export_param_value('format', format)\nitol_exporter.add_export_param_value(param_key, param_value)\nitol_exporter.export(Path('/path/to/example_tree'))\n```\n\nValid `param_key` and `param_value` values can be found on [the iTOL API\npage](http://itol.embl.de/help.cgi#batch).\n\nBugs/Comments\n-------------\n\nSend bugs and comments as issues on the\n[itolapi Github](https://github.com/albertyw/itolapi/) repository.\n\nDevelopment\n-----------\n\nTo run tests:\n\n```bash\npip install -e .\npip install -r requirements-test.txt\nruff check .\nmypy .\ncoverage run -m unittest\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "API for interacting with itol.embl.de",
    "version": "4.1.4",
    "project_urls": {
        "Homepage": "https://github.com/albertyw/itolapi"
    },
    "split_keywords": [
        "tree",
        "life",
        "compbio",
        "biology",
        "bioinformatics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "635ed6c5cc94c2530b0e6b0d7a3ded92f4aeb030cc025849606f840cad0d0ecb",
                "md5": "07b4a3cb9ea306ea46931a57fae8d4f1",
                "sha256": "bba9b28e87003954908ae7cd12f62ef91d76d559d847e1f9526ac361c9df91b8"
            },
            "downloads": -1,
            "filename": "itolapi-4.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07b4a3cb9ea306ea46931a57fae8d4f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7264,
            "upload_time": "2024-01-20T08:06:38",
            "upload_time_iso_8601": "2024-01-20T08:06:38.482817Z",
            "url": "https://files.pythonhosted.org/packages/63/5e/d6c5cc94c2530b0e6b0d7a3ded92f4aeb030cc025849606f840cad0d0ecb/itolapi-4.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc5971fbabb6abca0afdbe7edc0d491b2a631de8a57369ad0160cc66e2ea3e7c",
                "md5": "7e1dab1332987bd26614af3181484fed",
                "sha256": "68e87ba51d209da556b0e373b3b0456b644a1a732c193fedbd7785ff37b6a2cb"
            },
            "downloads": -1,
            "filename": "itolapi-4.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "7e1dab1332987bd26614af3181484fed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6432,
            "upload_time": "2024-01-20T08:06:39",
            "upload_time_iso_8601": "2024-01-20T08:06:39.638341Z",
            "url": "https://files.pythonhosted.org/packages/bc/59/71fbabb6abca0afdbe7edc0d491b2a631de8a57369ad0160cc66e2ea3e7c/itolapi-4.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-20 08:06:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "albertyw",
    "github_project": "itolapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "itolapi"
}
        
Elapsed time: 0.20569s