Skip to content

TreeSearch - a synonym-aware location search tool for tree species.

License

Notifications You must be signed in to change notification settings

Limsande/TreeSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreeSearch

TreeSearch is a synonym-aware location search tool for tree species. For a given species name it uses publicly available online data bases, namely Plants of the World online and GlobalTreeSearch, to search for known locations of all available synonyms.

Installation

Setting up Python 3

TreeSearch requires Python 3, which you can get from Python.org, if it is not already installed on your system. You can find out by typing

python3 --version

in bash (Linux and Mac) or the Windows PowerShell or Command Shell cmd (from now on all referred to as terminal). One of two things should happen:

  1. This gives an error like "Command not found". Try again, but with python instead of python3 (leave out the 3).
    1. The error persists. You need to install Python 3.
    2. It reports a Python version less than 3. You need to install Python 3.
    3. It reports a Python version of at least 3.0. Your good to go, but have to substitute python3 by python in all other commands described in this document.
  2. It reports some version information like Python 3.7.6. Your good to go.

Installing dependencies

After downloading and extracting the code to, say, Downloads/treesearch, use

cd Downloads/treesearch

in your terminal to change into that directory and execute following commands from there. Alternatively, some file managers let you open a directory in the terminal by right clicking it (while holding Shift on Windows) and then selecting an entry from the context menu like "Open in terminal", "Open command window here.", or "Open Windows PowerShell window here".

Then, to install all dependencies with pip, type

python3 -m pip install -r requirements.txt

If this gives an error like "File not found", make sure that you executed the command from within the extracted TreeSearch directory. This should tell you the pwd command or cd on Windows.

Once pip finished downloading and installing the dependencies, you should be able to run TreeSearch by typing

python3 -m treesearch -h

which will show you instructions on how to use it (as the next section of this document does).

Usage

To search for locations of the stone pine (Pinus pinea, described by L.), for example, simply type

python3 -m treesearch Pinus pinea L.

It is also possible to write the results to a comma-separated CSV file with the -o (or --output) flag:

python3 -m treesearch Pinus pinea L. -o output_file.csv

TreeSearch can also operate in batch mode by accepting a CSV file (arbitrary field separator) with multiple species names as input via the -i (or --input) flag:

python3 -m treesearch -i input_file.csv -o output_file.csv

This input file must (at least) contain a column "Name", and a column "Author". All additional columns are preserved and ignored.

Example CSV file

Using this CSV file as input:

example input

TreeSearch is able to find locations for 3/5 species and yields the following file:

example output

Valid names

To extract genus and species from a name such as Daphne sericea, the first two groups of alphabetic characters, separated by any number of whitespaces, are used. In this example this yields Daphne as genus and sericea as species, as it would for names with more than two parts, like Daphne sericea spec. Names without such two groups, like Daphne, are invalid and therefor ignored.

Contact and bug reports

You can contact the author via e-mail at <limsande(at)yahoo dot com>. Feature suggestions and feedback of any kind are very appreciated.

To file a bug report, please use this project's issue tracker.

About

TreeSearch - a synonym-aware location search tool for tree species.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages