Skip to content

Commit

Permalink
Documentation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmasek committed Aug 8, 2020
1 parent b53d2b2 commit 484555f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ History
* Authorization is now handled through query parameter, copy module needed, new query_parameters property added and removed headers property.
* Pagination handled through links in the body and made relative instead of absolute. No more page size.
* Gzip response needed to unwrap the JSON response now. Will remove this in the future versions.
* New endpoints added for division classes, division orders and distributions.
* New bascic endpoints added for division classes, division orders and distributions.
* Added new methods for client-side auth, selecting plants by distributions or genus, submitting
errors and corrections.
* Genuses endpoint renamed to genus.
* Versioning of the API started so the url parameter in the constructor is split to base and relative urls.
* Response changed to handle the added meta and links additions for the navigation.
Expand Down
5 changes: 3 additions & 2 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Reporting an error is done through a report_error method that requires two posit

The first argument is describing what is wrong, the second argument is either a slug or an id of the
entry in question. By default, it is reporting a plant entry, but can be overriden to report an
error of the species as well like so::
error of the species as well, like so::

api.report_error("chenopodium-album", "A sentence of what is wrong", what="species")

Expand Down Expand Up @@ -146,7 +146,8 @@ Client Authentication
~~~~~~~~~~~~~~~~~~~~~

While it's easy to obtain a token from Trefle and use the library on the server, it becomes tricky
when one wants to use it on the browser side. This is achieved by periodically obtaining JWT token.
when one wants to use it on the browser side. This is achieved by periodically obtaining a JWT
token.

It is still a server call because the common token needs to be provided. Once the Shamrock is
initialized, using a normal token, this is called to obtain a JWT::
Expand Down
10 changes: 5 additions & 5 deletions shamrock/shamrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def search(self, q: str, what: str = "plants", **kwargs: Any) -> Any:
:param q: A string that is used to search the plant with.
:type q: str
:param what: A string that is that is signifying what item to report an error on.
:param what: A string that is signifying what item to report an error on.
:type what: str (if not specified, then "plants", but can be specified as "species")
:param **kwargs: Any query strings to add to the search object.
:type **kwargs: dict
Expand Down Expand Up @@ -251,7 +251,7 @@ def report_error(
:type identifier: int or str
:param notes: A string that is delivered to report an error on the entry.
:type notes: str
:param what: A string that is that is signifying what item to report an error on.
:param what: A string that is signifying what item to report an error on.
:type what: str (if not specified, then "plants", but can be specified as "species")
:param kwargs: Any query strings to add to the post object.
:type kwargs: dict
Expand Down Expand Up @@ -293,7 +293,7 @@ def corrections(
json: Optional[Any] = None,
**kwargs: Any,
) -> Any:
"""Returns one correction or a list of corrections, or submit one.
"""Returns one correction or a list of corrections, or submits one.
:param identifier: An identifier, a primary key of the correction.
:type identifier: int
Expand All @@ -315,8 +315,8 @@ def corrections(
return self._get_result(request_kwargs, method="POST", json=json)

def auth(self, origin: str, **kwargs: Any) -> Any:
"""Return a JWT that you can use in a browser. You need to specify where you'll be using the
token so it can be bound to a certain address.
"""Returns a JWT that you can use in a browser. You need to specify where you'll be using
the token so it can be bound to a certain address.
:param origin: A URL that is delivered to the endpoint so the responding JWT can use it.
:type origin: str
Expand Down

0 comments on commit 484555f

Please sign in to comment.