Scripts for using GBIF data in combination with MongoDB and Python
Most of this can be done using plain Bash. However, my long-term goal is to automate some processes, so I'm using GNU Make.
- Python 3
- GNU Make
- Mongo DB
- Download GBIF occurence data as .csv.
- Using GNU make, do:
make -f tools/build import host=<host> db=<db-name> collection=<collection-name> file=<occurences-file-path>
There are several possible definitions of taxonomic diversity. The simplest definition is the number of species within a region (species richness). To create a spreadsheet with species count per taxon grade, do:
- Download GBIF occurence data as .csv.
- Import the data into the local Mongo database as shown above.
- Using GNU make, do:
make -f tools/build diversity output=<csv-file-path>
This will create a .csv file with species count per taxon grade.
To run all tests, start mongo and then using GNU make do:
make -f tools/test
or, to run test using the "green" test runner, with test coverage do:
make -f tools/test green
GNU Make Manual: https://www.gnu.org/software/make/manual/
"Green" test runner docs: https://github.com/CleanCut/green/blob/master/cli-options.txt