Python的物种工具包
项目描述
pytaxize
这是R包taxize的移植版。这个库在R版本中有许多功能,所以将所有相同的功能移植过来需要一些时间。
为什么?taxize的Python版本的显著优势是对于那些真正喜欢Python的人来说。此外,您可以在Web应用程序中使用pytaxize(例如,在Shiny应用程序中),但不会扩展,速度不会很快等。
python 2/3
pytaxize仅在Python 3中开发和测试
安装
从pypi稳定版
pip install pytaxize
开发版本
sudo pip install git+git://github.com/sckott/pytaxize.git#egg=pytaxize
物种ID
我开始为物种ID编写类接口,它将有一系列扩展方法来进行各种操作。目前可用的只是获取COL ID。
from pytaxize import Ids
res = Ids('Poa annua')
res.ncbi()
res.ids
{'Poa annua': [{'id': '93036',
'name': 'Poa annua',
'rank': 'species',
'uri': 'https://www.ncbi.nlm.nih.gov/taxonomy/93036'}]}
Vascan搜索
import pytaxize
pytaxize.vascan_search(q = ["Helianthus annuus"])
{u'apiVersion': u'0.1',
u'results': [{u'matches': [{u'canonicalName': u'Helianthus annuus',
u'distribution': [{u'establishmentMeans': u'introduced',
u'locality': u'NS',
u'locationID': u'ISO 3166-2:CA-NS',
u'occurrenceStatus': u'introduced'},
{u'establishmentMeans': u'',
u'locality': u'PE',
u'locationID': u'ISO 3166-2:CA-PE',
u'occurrenceStatus': u'excluded'},
{u'establishmentMeans': u'',
u'locality': u'NT',
u'locationID': u'ISO 3166-2:CA-NT',
u'occurrenceStatus': u'doubtful'},
{u'establishmentMeans': u'introduced',
抓取物种名称
out = pytaxize.scrapenames(url = 'http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf')
out['data'][0:3]
[{'verbatim': '(Hemiptera:',
'scientificName': 'Hemiptera',
'offsetStart': 222,
'offsetEnd': 233},
{'verbatim': 'Sternorrhyncha:',
'scientificName': 'Sternorrhyncha',
'offsetStart': 234,
'offsetEnd': 249},
{'verbatim': 'Coccoidea:',
'scientificName': 'Coccoidea',
'offsetStart': 250,
'offsetEnd': 260}]
ITIS低级函数
from pytaxize import itis
itis.accepted_names(504239)
{'acceptedName': 'Dasiphora fruticosa',
'acceptedTsn': '836659',
'author': '(L.) Rydb.'}
itis.comment_detail(tsn=180543)
[{'commentDetail': 'Status: CITES - Appendix I as U. arctos (Mexico, Bhutan, China, and Mongolia populations) and U. a. isabellinus; otherwise Appendix II. U. S. ESA - Endangered as U. arctos pruinosus, as U. arctos in Mexico, and as U. a. arctos in Italy. Threatened as U. a. ho...',
'commentId': '18556',
'commentTimeStamp': '2007-08-20 15:06:38.0',
'commentator': 'Wilson & Reeder, eds. (2005)',
'updateDate': '2014-02-03'},
{'commentDetail': "Comments: Reviewed by Erdbrink (1953), Couturier (1954), Rausch (1963a), Kurtén (1973), Hall (1984) and Pasitschniak-Arts (1993). Ognev (1931) and Allen (1938) recognized U. pruinosus as distinct; not followed by Ellerman and Morrison-Scott (1951), Gao (1987), and Stroganov (1962). Lönnberg (1923b) believed that differences between pruinosus and arctos warranted subgeneric distinction as (Mylarctos) pruinosus; however, this was not supported by Pocock's (1932b) thorough revision. Synonyms allocated a...",
'commentId': '18557',
'commentTimeStamp': '2007-08-20 15:06:38.0',
'commentator': 'Wilson & Reeder, eds. (2005)',
'updateDate': '2014-02-03'}]
itis.hierarchy_up(tsn = 36485)
{'author': 'Raf.',
'parentName': 'Asteraceae',
'parentTsn': '35420',
'rankName': 'Genus',
'taxonName': 'Agoseris',
'tsn': '36485'}
生命之树目录
from pytaxize import col
x = col.children(name=["Apis"])
x[0][0:3]
[{'id': '7a4a38c5095963949d6d6ec917d471de',
'name': 'Apis andreniformis',
'rank': 'Species'},
{'id': '39610a4ceff7e5244e334a3fbc5e47e5',
'name': 'Apis cerana',
'rank': 'Species'},
{'id': 'e1d4cbf3872c6c310b7a1c17ddd00ebc',
'name': 'Apis dorsata',
'rank': 'Species'}]
解析名称
使用GBIF的解析器API解析名称
from pytaxize import gbif
gbif.parse(name=['Arrhenatherum elatius var. elatius',
'Secale cereale subsp. cereale', 'Secale cereale ssp. cereale',
'Vanessa atalanta (Linnaeus, 1758)'])
[{'scientificName': 'Arrhenatherum elatius var. elatius',
'type': 'SCIENTIFIC',
'genusOrAbove': 'Arrhenatherum',
'specificEpithet': 'elatius',
'infraSpecificEpithet': 'elatius',
'parsed': True,
'parsedPartially': False,
'canonicalName': 'Arrhenatherum elatius elatius',
'canonicalNameWithMarker': 'Arrhenatherum elatius var. elatius',
'canonicalNameComplete': 'Arrhenatherum elatius var. elatius',
'rankMarker': 'var.'},
{'scientificName': 'Secale cereale subsp. cereale',
'type': 'SCIENTIFIC',
...
贡献者
元数据
变更日志
0.7.0 (2020-06-15)
首次发布到pypi
项目详情
下载文件
下载适合您平台的文件。如果您不确定该选择哪个,请了解更多关于安装包的信息。
源代码发行版
pytaxize-0.7.0.tar.gz (71.7 kB 查看哈希值)
构建发行版
pytaxize-0.7.0-py3.8.egg (155.9 kB 查看哈希值)
pytaxize-0.7.0-py2.py3-none-any.whl (94.5 kB 查看哈希值)
关闭
pytaxize-0.7.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 42742555325f78f3e054f19a2ada9e22924715970db10023d12b2131e282539a |
|
MD5 | 62341b8070a35928d4c44c42add93f8d |
|
BLAKE2b-256 | 8e2f7f5459d553ae894000baa98068da122378f614283776cca87d91f7213e12 |
关闭
pytaxize-0.7.0-py3.8.egg的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5fd79eb74e7e53b0be4f8fbb940d08c6398b0d0c7a819f382f06a6e7c8531cd7 |
|
MD5 | 5ba7dbbd7f1f7429d167e276f90c3dbc |
|
BLAKE2b-256 | f78366ac0ab333656df95ca81bee32bfda58f9aa83eee1f21db2638f7056a8fa |
关闭
pytaxize-0.7.0-py2.py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8cb0b84235e9c62ee9f22985f67029c0c9e5d4d5b5b8095d39beaec991e72d29 |
|
MD5 | b3fd0bdcf6dd9efec0d17bb3455db668 |
|
BLAKE2b-256 | 2abd05b054fc54220133ec4576284d918231a945dcc0e302932cc3a853ad19a2 |