Giter VIP home page Giter VIP logo

treesearch's Introduction

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.

treesearch's People

Contributors

limsande avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.