Taxon parser
This library is a pure Python adaptation of the GBIF Java name-parser library.
It is used to parse any taxonomic name into its elementary components (genus, species, authors...)
It returns a ParsedName object containing the name parts and the original parsed string.
Installation
pip install taxon_parser
Requirements
This library works for Python version 3.4 or higher
The only external package dependancy is the regex package for handling advanced regular expressions.
Usage
basic usage:
from taxon_parser import TaxonParser, UnparsableNameException
parser = TaxonParser("Abies pectinata mill.")
try:
parsed_name = parser.parse()
print(parsed_name)
except UnparsableNameException as e:
print("this name does not seem to be a valid taxon name: \n" + e )
For any name that can not be parsed, an UnparsableNameException is thrown.
ParsedName objects
Results of the parsing are ParsedName objects. These have the following attributes and functions:
-
ParsedName.combinationAuthorship: Authorship object with years of the name, but excluding any basionym authorship. For binomials the combination authors.
-
ParsedName.basionymAuthorship: basionym Authorship object with years of the name
-
ParsedName.sanctioningAuthor: The sanctioning author for sanctioned fungal names. Fr. or Pers.
-
ParsedName.rank: Rank of the name from enumeration see the rank.py for description of possible ranks
-
ParsedName.uninomial: Represents the monomial for genus, families or names at higher ranks which do not have further epithets.
-
ParsedName.genus: The genus part of an infrageneric, bi- or trinomial name. Not used for standalone genus names which are represented as uninomials.
Infrageneric epithets:
-
ParsedName.infragenericEpithet
-
ParsedName.specificEpithet
-
ParsedName.infraspecificEpithet
-
ParsedName.cultivarEpithet
-
ParsedName.strain
-
ParsedName.candidatus: A bacterial candidate name. Candidatus is a provisional status for incompletely described procaryotes (e.g. that cannot be maintained in a Bacteriology Culture Collection) which was published in the January 1995. The category Candidatus is not covered by the Rules of the Bacteriological Code but is a taxonomic assignment. The names included in the category Candidatus are usually written as follows: Candidatus (in italics), the subsequent name(s) in roman type and the entire name in quotation marks. For example, "Candidatus Phytoplasma", "Candidatus Phytoplasma allocasuarinae". See http://www.bacterio.net/-candidatus.html and https://en.wikipedia.org/wiki/Candidatus
-
ParsedName.notho: The part of the named hybrid which is considered a hybrid
-
ParsedName.taxonomicNotes: Nomenclatural status remarks of the name.
-
ParsedName.remarks: Any informal remarks found in the name
-
ParsedName.unparsed: Any additional unparsed string found at the end of the name. Only ever set when state=PARTIAL
-
ParsedName.type: The kind of name classified in broad catagories based on their syntactical structure
-
ParsedName.doubtful: Indicates some doubts that this is a name of the given type. Usually indicates the existance of unusual characters not normally found in scientific names.
-
ParsedName.state: Indicates if the full name has been parsed
-
ParsedName.getTerminalEpithet(): returns the terminal epithet. Infraspecific epithet if existing, the species epithet or null
-
ParsedName.hasName(): return
Trueif the parsed name has non null name properties or a scientific name. Remarks will not count as a name -
ParsedName.hasAuthorship(): return
Trueif any kind of authorship exists -
ParsedName.isBinomial(): return
Trueif the name is a bi- or trinomial with at least a genus and species epithet given. -
ParsedName.isTrinomial(): return true if the name is a trinomial with at least a genus, species and infraspecific epithet given.
-
ParsedName.isIndetermined(): Checks if a parsed name is missing final epithets compared to what is indicated by its rank. Returns
Trueif the name is not fully determined. -
ParsedName.isIncomplete(): returns
Trueif some "higher" epithet of a name is missing, e.g. the genus in case of a species. -
ParsedName.isAbbreviated(): returns
Trueif the name contains an abbreviated genus or uninomial. -
ParsedName.canonicalName(): A full scientific name with authorship from the individual properties in its canonical form. Autonyms are rendered without authorship and subspecies are using the subsp rank marker unless a name is assigned to the zoological code.
-
ParsedName.canonicalName(): A full scientific name just as canonicalName, but without any authorship.
-
ParsedName.canonicalComplete(): Assembles a full name with all details including non code compliant, informal remarks.
-
ParsedName.nameMinimal(): returns a minimal canonical name with nothing else but the 3 main name parts (genus, species, infraspecific). No rank or hybrid markers and no authorship, cultivar or strain information is rendered. Infrageneric names are represented without a leading genus. Unicode characters will be replaced by their matching ASCII characters. For example:
- Abies alba
- Abies alba alpina
- Bracteata
-
ParsedName.authorshipComplete(): returns the full concatenated authorship for parsed names including the sanctioning author.
Metadata
Release files for taxon-parser 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| taxon_parser-0.2.3.tar.gz | 32.7 kB | Without provenance | Details for taxon_parser-0.2.3.tar.gz |
Release files / taxon_parser-0.2.3.tar.gz
| Download URL | taxon_parser-0.2.3.tar.gz |
|---|---|
| Size | 32.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2638d9a678edc28f844f8c5071b2bf9dd0239ff33d2fcd7876cc3bc8b61386a9
|
|
BLAKE2b-256 checksum How to use checksums |
b730dfb6c72b33b319096e1981d67a147215264e0f74912726767c96201d455a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Security for taxon-parser 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.