Skip to content

Fetch plants and animals scientific name information from the internet

License

Notifications You must be signed in to change notification settings

rizqirizqi/scientific-name-fetcher

Repository files navigation

scientific-name-fetcher (scifetcher)

contributions welcome MIT License

Watch on GitHub Star on GitHub Tweet

Fetch plants/animals scientific name information from the internet.

Current supported sources:

Requirements

Detailed Guide for Windows
  1. Download python from https://www.python.org/downloads/
  2. Install python, follow the instruction
  3. Press Win button (something like window icon on keyboard), search "env", then open Edit the system environment variables
  4. Click Environment Variables
  5. On System Variables section, edit the Path key
  6. Add these paths using the New button:
    # Please replace the username with your windows username, you can see it in C:\Users folder
    # Please replace the python version with your installed python version
    C:\Users\<YOUR_USERNAME>\AppData\Local\Programs\Python\Python310
    C:\Users\<YOUR_USERNAME>\AppData\Local\Programs\Python\Python310\Scripts
    C:\Users\<YOUR_USERNAME>\AppData\Roaming\Python\Python310\Scripts
    
  7. Click OK, then OK
  8. Open cmd, then type python --version, then it should respond with the python version.
  9. Type pip3 install --user pipenv, then it should install pipenv, make sure it's successfully installed.
  10. Type pipenv --version, then it should respond with the pipenv version.
  11. Done! You can continue follow the guide in the "How to run" section.

How to run

  1. Clone

    git clone git@github.com:rizqirizqi/scientific-name-fetcher.git
    cd scientific-name-fetcher
  2. Copy env

    Linux:

    cp env.sample .env

    Windows:

    copy env.sample .env
  3. Install dependencies

    pipenv --python 3
    pipenv install
  4. Fill your input in input.txt, please look at samples/input.txt for example. You can also use csv or xlsx if you want.

  5. Run

    pipenv run python -m scifetcher -i input.txt
  6. The result will be placed in a file named result.*.txt

Help

pipenv run python -m scifetcher --help

Settings

  1. Edit .env file (see env.sample file for reference)
  2. Change the settings

Available settings:

Setting Default Description
AUTO_SEARCH_SIMILAR_SPECIES True Search GBIF database with similar name from wikipedia result.
INCLUDE_GBIF_SEARCH True Include GBIF search result if it can't find the exact match of the scientific name.
IUCN_API_TOKEN - Required token to fetch data from IUCN API. Request a token here.

Contributing

  1. Fork this repo
  2. Develop
  3. Create pull request
  4. Tag @rizqirizqi for review
  5. Merge~~

Run Test

# all
pipenv run python -m unittest
# one file
pipenv run python -m unittest tests
# coverage
pipenv run coverage run -m unittest
coverage report
coverage html && xdg-open ./htmlcov/index.html

Lint

If you're using VSCode:

  1. Open the Command Palette in the View menu (or just Ctrl+Shift+P)
  2. Type Python: Select Interpreter
  3. Select scientific-name-fetcher
  4. Choose pipenv

License

GPL-3.0