Skip to main content

Parse and write SPART files

Project description

SpartParser

PyPI - Version PyPI - Python Version PyPI - License GitHub - Tests GitHub - Windows

Parse, edit and write data in the SPART and SPART-XML file formats.

Includes a GUI for converting between the two formats.

Installation

PyInstaller is available on PyPI. You can install it through pip:

pip install itaxotools-spart-parser

Usage

Most of the functionality is included in the Spart class. Use the class methods to open, edit and write data in the Spart file format.

from itaxotools.spart_parser import Spart
spart = Spart.fromXML("examples/spart.xml")

spartitions = spart.getSpartitions()
print(spartitions)
subsets = spart.getSpartitionSubsets(spartitions[0])
print(subsets)
individuals = spart.getSubsetIndividuals(spartitions[0], subsets[0])
print(individuals)

spart.addIndividual("new_specimen")
spart.addSubsetIndividual(spartitions[0], subsets[0], "new_specimen")
spart.addSubsetIndividual(spartitions[1], subsets[1], "new_specimen")
spart.toMatricial("converted_copy.spart")

For more details, refer to the Spart class definition, as well as the scripts and examples folders.

Demo GUI

A graphical interface is included for converting between SPART and SPART-XML.

Install with the optional GUI dependencies:

pip install itaxotools-spart-parser[gui]
SpartParserGui

Or download and run the Windows executable from the latest release.

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

itaxotools-spart-parser-0.1.3.tar.gz (50.4 kB view hashes)

Uploaded Source

Built Distribution

itaxotools_spart_parser-0.1.3-py3-none-any.whl (35.2 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