Fetch plants/animals scientific name information from the internet.
Current supported sources:
- MediaWiki. See Docs.
- Global Biodiversity Information Facility (GBIF). See Docs.
- International Union for Conservation of Nature (IUCN). See Docs. (Need API Token)
- Plants of the World Online (POWO). See Docs.
- python >= 3.7 (you can use pyenv for easier python version management)
- pipenv
Detailed Guide for Windows
- Download python from https://www.python.org/downloads/
- Install python, follow the instruction
- Press Win button (something like window icon on keyboard), search "env", then open
Edit the system environment variables
- Click Environment Variables
- On
System Variables
section, edit thePath
key - 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
- Click OK, then OK
- Open cmd, then type
python --version
, then it should respond with the python version. - Type
pip3 install --user pipenv
, then it should install pipenv, make sure it's successfully installed. - Type
pipenv --version
, then it should respond with the pipenv version. - Done! You can continue follow the guide in the "How to run" section.
-
Clone
git clone [email protected]:rizqirizqi/scientific-name-fetcher.git cd scientific-name-fetcher
-
Copy env
Linux:
cp env.sample .env
Windows:
copy env.sample .env
-
Install dependencies
pipenv --python 3 pipenv install
-
Fill your input in
input.txt
, please look atsamples/input.txt
for example. You can also use csv or xlsx if you want. -
Run
pipenv run python -m scifetcher -i input.txt
-
The result will be placed in a file named
result.*.txt
pipenv run python -m scifetcher --help
- Edit .env file (see env.sample file for reference)
- Change the 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. |
- Fork this repo
- Develop
- Create pull request
- Tag @rizqirizqi for review
- Merge~~
# 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
If you're using VSCode:
- Open the Command Palette in the
View
menu (or just Ctrl+Shift+P) - Type
Python: Select Interpreter
- Select
scientific-name-fetcher
- Choose
pipenv
GPL-3.0