Script for loading data extracted from csv files exported from an Zooniverse project, MarshExplorer, into an local MySQL server to collect annotations made by citizen scientists for salt marsh photos
** These notes are for Windows, commands may differ for Mac
- marsh_explorer.json: can be edited to add any additional subject sets along with any additional subjects of interest that are being annotated by either rectangles or circles
- MarshExplorer.ipynb: Jupyter notebook file
- script.py: Python script
- ER_diagram: image of database schema created in Figma
- queries.txt: list of requested queries that can be run to query specific data
- Python
- Jupyter notebook (optional if using Python script)
- MySQL with MySQL Workbench
- When setting up MySQL, take note of your database username and password
- Navigate into the folder after pulling repo and open the command line
- In the command line, run to install the dependencies for PyMySQL:
$ python -m pip install PyMySQL
- Download the csv files from Zooniverse for classifications and subjects and put them in the directory. The names should be:
- marsh-explorer-classifications.csv
- marsh-explorer-subjects.csv
- Check to see if your MySQL services are on. Go to services.msc and look for MySQL80 and click start
- Run script
- Run this command in the terminal to run Python script:
$ python script.py
- Enter your username and password from setting up MySQL in the command line
- Go on MySQL Workbench and connect to the local database.
- A database called "marshexplorer" should be present on the left list of databases
- Select the database and click on any tables to view table data
- Create new SQL tab and copy/paste any queries from the queries.txt file to do specific queries
File needs to be edited when:
- New subject sets are added on Zooniverse
- Follow format and add the subject set id (assigned in Zooniverse), subject set name and location
- New subjects of interest are added on Zooniverse
- Follow format and add the name of subjects of interest under the corresponding shape
- New shapes for annotating are added on Zooniverse
- Follow format and add the shape along with any subjects of interest being annotated by it
- **Note: code and database needs to be changed to account for any new tool labels (shapes) for annotation