A Trefle API Integration.
Shamrock - A Trefle API Library
☘ Shamrock is a Python shallow API library for Trefle integration. It enables interacting with the Trefle plants API in Python to get the information needed for various things you might want to use the API with such as research, gardening software, automation, etc. It is made for use with Python 3.6 and above.
For the full documentation refer to Shamrock documentation.
For more information what the Trefle service provides, refer to the Trefle API documentation. It is also useful for checking out how to use the API with Shamrock library.
pipenv install shamrock
pip install shamrock
Simple Usage Example
from shamrock import Shamrock api = Shamrock('mytoken') species = api.species()
You can configure the API initially like this:
api = Shamrock(TOKEN, page_size=10)
Currently, page_size is the only available option.
Methods that can be run with the API are:
api.kingdoms() api.subkingdoms() api.divisions() api.families() api.genuses() api.plants() api.species()
They correspond to the Trefle API endpoints.
You can also query a specific item from the database:
Searching is covered with a separate method:
Navigating the API is covered with these methods:
api.next() api.prev() api.first() api.last()
It will work only if you previously made a request. For example:
By default, the API responds with the list of whatever number is set in the Trefle. You can manipulate it with previously mentioned page_size:
You can also use the varoius query string options described on Trefle API documentation as keyword arguments in methods:
- First release on PyPI.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size shamrock-0.0.1-py3-none-any.whl (12.1 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size shamrock-0.0.1.tar.gz (10.3 kB)||File type Source||Python version None||Upload date||Hashes View|