For information about the Australian Threatened Species Index project, see https://tsx.org.au
The code in this repository is responsible for data import and pre-processing of data, and visualsation of the generated trend graphs and associated data.
The easiest way to learn about running the TSX workflow is to check out the User Guide at https://tsx.org.au/user-guide/
First create a new MySQL database.
You can call it anything but the instructions below assume it is named "tsx".
Initialise the database using the provided scripts:
mysql tsx < data/sql/create.sql
mysql tsx < data/sql/init.sql
Copy example configuration:
cp tsx.conf.example tsx.conf
Then edit the [database]
section in tsx.conf to match the database you just created.
pip install pipenv # if you don't have virtualenv already
pipenv sync
python -m tsx.import_taxa [path to TaxonList.xlsx]
Via command line:
python -m tsx.importer --type 1 --commit data/type-1-sample.csv
Or alternatively via web upload interface
# Start back-end API:
FLASK_DEBUG=1 FLASK_APP=tsx/api/api.py python -m flask run
# Start front-end (in a separate terminal):
cd web
npm install
npm run dev-data
python -m tsx.process alpha_hull
python -m tsx.process range_ultrataxon
python -m tsx.process pseudo_absence
Or all at once:
python -m tsx.process -c all
(TODO - more detailed instructions)
Setup database (see instructions for dev environment)
Install tsx package:
python setup.py install
Edit configuration in
/opt/tsx/conf/tsx.conf
Setup as service (Linux):
sudo cp etc/init.d/tsxapi /etc/init.d/ sudo service tsxapi start
Deploy static resources:
# If you don't have have node/npm installed: # # sudo apt install npm nodejs # # .. or might need a more recent version .. # # sudo apt-get remove nodejs npm ## remove existing nodejs and npm packages # sudo apt-get install curl # curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - # sudo apt-get install -y nodejs # cd web npm install (TODO - add step to point code to REST API base URL) npm run build sudo cp -r dist/ /var/www/tsx/ sudo chown -R www-data:www-data /var/www/tsx