newick 1.0.0
pip install newick==1.0.0
Newer version available (1.10.0)
Released:
A python module to read and write the Newick format
Navigation
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache 2)
- Author: The Glottobank consortium
Classifiers
- Development Status
- Intended Audience
- License
- Natural Language
- Programming Language
Project description
python-newick
python package to read and write the Newick format.
Reading Newick
- From a string:
>>> from newick import loads
>>> trees = loads('(A,B,(C,D)E)F;')
>>> trees[0].name
u'F'
>>> [n.name for n in trees[0].descendants]
[u'A', u'B', u'E']
- From a
file
-like object:
>>> import io
>>> from newick import load
>>> with io.open('fname', encoding='utf8') as fp:
... trees = load(fp)
- From a file name:
>>> from newick import read
>>> trees = read('fname')
Writing Newick
In parallel to the read operations there are three functions to serialize a single Node
object or a list
of Node
objects to Newick format:
dumps(trees) -> str
dump(trees, fp)
write(trees, 'fname')
A tree may be assembled using the factory methods of the Node
class:
Node.__init__
Node.create
Node.add_descendant
Project details
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache 2)
- Author: The Glottobank consortium
Classifiers
- Development Status
- Intended Audience
- License
- Natural Language
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file newick-1.0.0.tar.gz
.
File metadata
- Download URL: newick-1.0.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8b16760dad7c39fcff8863575072990c92ea920a2af13b028551b2fb277cd3f |
|
MD5 | 1f2d4a62eda5c1b0f448a56d08a0a726 |
|
BLAKE2b-256 | be2ec4ce2a521e7ed409dfd5a0cf9a60fd8d6ae37c059e248e95d4d51a16c304 |
File details
Details for the file newick-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: newick-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90dcaa3eb408dc54abb326f1b3ce1468da516fc7f4027518b8c085652a582d45 |
|
MD5 | 768466cf9bea220eab0eae3b99d3a84c |
|
BLAKE2b-256 | 951be47a990ef159820442b0b84752329a7a16c0ad08b0536c4872e8975bcfd4 |