Skip to content

Commit

Permalink
redid docs with newer version of sphinx - ready for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jun 15, 2020
1 parent c294029 commit fc11d4e
Show file tree
Hide file tree
Showing 278 changed files with 4,998 additions and 21,996 deletions.
4 changes: 2 additions & 2 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Changelog
=========

0.5.0 (2016-02-16)
0.7.0 (2020-06-15)
--------------------
* xxxx
* first release to pypi
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = docs/_build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


all: build install

.PHONY: build install test docs distclean dist upload
Expand All @@ -12,9 +31,7 @@ test:
pytest --verbose --disable-warnings --cov=pytaxize/ --ignore setup.py

docs:
cd docs;\
make html
# open _build/html/index.html
sphinx-build -b html docs/ docs/_build

check:
python3 -m twine check dist/*
Expand Down
126 changes: 78 additions & 48 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,44 @@ pytaxize is only developed in and tested with Python 3
Installation
============

Stable from pypi

.. code-block:: console
sudo pip install git+git://github.com/sckott/pytaxize.git#egg=pytaxize
pip install pytaxize
python or ipython, etc.
Development version

.. code-block:: python
.. code-block:: console
sudo pip install git+git://github.com/sckott/pytaxize.git#egg=pytaxize
import pytaxize
Taxonomic Ids
=============

I've started working on a class interface for taxonomic IDs, which will have a bunch of extension methods to do various things with taxon ids. What's available right now is just getting COL ids.

NOT WORKING YET!

.. code-block:: python
res = pytaxize.Ids('Poa annua', db='col')
res.get_colid()
from pytaxize import Ids
res = Ids('Poa annua')
res.ncbi()
res.ids
.. code-block:: python
[19275187]
{'Poa annua': [{'id': '93036',
'name': 'Poa annua',
'rank': 'species',
'uri': 'https://www.ncbi.nlm.nih.gov/taxonomy/93036'}]}
Vascan search
=============

.. code-block:: python
import pytaxize
pytaxize.vascan_search(q = ["Helianthus annuus"])
.. code-block:: python
Expand All @@ -69,70 +76,84 @@ Vascan search
Scrape taxonomic names
======================
NOT WORKING YET!
.. code-block:: python
out = pytaxize.scrapenames(url = 'http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf')
out['data'].head()
out['data'][0:3]
.. code-block:: python
identifiedName offsetEnd offsetStart scientificName verbatim
0 Waxiella 14 7 Waxiella Waxiella
1 W. africana 395 385 Waxiella africana W. africana
2 W. egbara 581 573 Waxiella egbara W. egbara
3 W. erithraeus 771 759 Waxiella erithraeus W. erithraeus
4 W. gwaai 951 944 Waxiella gwaai W. gwaai
[{'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 low level functions
========================
.. code-block:: python
from pytaxize import itis
itis.getacceptednamesfromtsn('208527')
itis.accepted_names(504239)
'208527'
{'acceptedName': 'Dasiphora fruticosa',
'acceptedTsn': '836659',
'author': '(L.) Rydb.'}
.. code-block:: python
itis.getcommentdetailfromtsn(tsn=180543)
itis.comment_detail(tsn=180543)
comment \
0 Status: CITES - Appendix I as U. arctos (Mexic...
1 Comments: Reviewed by Erdbrink (1953), Couturi...
commentator commid commtime updatedate
0 Wilson & Reeder, eds. (2005) 18556 2007-08-20 15:06:38.0 2014-02-03
1 Wilson & Reeder, eds. (2005) 18557 2007-08-20 15:06:38.0 2014-02-03
[{'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'}]
.. code-block:: python
itis.gethierarchyupfromtsn(tsn = 36485)
itis.hierarchy_up(tsn = 36485)
author parentName parentTsn rankName taxonName tsn
0 Raf. Asteraceae 35420 Genus Agoseris 36485
{'author': 'Raf.',
'parentName': 'Asteraceae',
'parentTsn': '35420',
'rankName': 'Genus',
'taxonName': 'Agoseris',
'tsn': '36485'}
Catalogue of Life
=================
.. code-block:: python
from pytaxize import col
col.col_children(name=["Apis"])
x = col.children(name=["Apis"])
x[0][0:3]
.. code-block:: python
[ id name rank
0 6971712 Apis andreniformis Species
1 6971713 Apis cerana Species
2 6971714 Apis dorsata Species
3 6971715 Apis florea Species
4 6971716 Apis koschevnikovi Species
5 6845885 Apis mellifera Species
6 6971717 Apis nigrocincta Species]
[{'id': '7a4a38c5095963949d6d6ec917d471de',
'name': 'Apis andreniformis',
'rank': 'Species'},
{'id': '39610a4ceff7e5244e334a3fbc5e47e5',
'name': 'Apis cerana',
'rank': 'Species'},
{'id': 'e1d4cbf3872c6c310b7a1c17ddd00ebc',
'name': 'Apis dorsata',
'rank': 'Species'}]
Parse names
===========
Expand All @@ -148,11 +169,20 @@ Parse names using GBIF's parser API
.. code-block:: python
scientificName type genusOrAbove ... rankMarker
Arrhenatherum elatius var. elatius SCIENTIFIC Arrhenatherum ... var.
Secale cereale subsp. cereale SCIENTIFIC Secale ... subsp.
Secale cereale ssp. cereale SCIENTIFIC Secale ... subsp.
Vanessa atalanta (Linnaeus, 1758) SCIENTIFIC Vanessa ... sp.
[{'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',
...
Contributors
============
Expand Down
55 changes: 55 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'pytaxize'
copyright = '2020, Scott Chamberlain'
author = 'Scott Chamberlain'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
Loading

0 comments on commit fc11d4e

Please sign in to comment.