Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nesp-tsr3-1/tsx
Australian Threatened Species Index
https://github.com/nesp-tsr3-1/tsx
Last synced: about 2 months ago
JSON representation
Australian Threatened Species Index
- Host: GitHub
- URL: https://github.com/nesp-tsr3-1/tsx
- Owner: nesp-tsr3-1
- License: mit
- Created: 2017-11-21T03:30:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-22T00:37:20.000Z (10 months ago)
- Last Synced: 2024-03-23T07:06:12.274Z (10 months ago)
- Language: Python
- Homepage: https://tsx.org.au
- Size: 8.37 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- open-sustainable-technology - TSX - Provides reliable and robust measures of change in the relative abundance of Australia's threatened and near-threatened species at national, state and regional levels. (Biosphere / Terrestrial Wildlife)
README
===================================================================
Welcome to the Australian Threatened Species Index (TSX) Repository
===================================================================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.
User Guide
==========The easiest way to learn about running the TSX workflow is to check out the User Guide at https://tsx.org.au/user-guide/
Developer Guide
===============1. Setup database (MySQL)
-------------------------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:
.. code:: bash
mysql tsx < data/sql/create.sql
mysql tsx < data/sql/init.sqlCopy example configuration:
.. code:: bash
cp tsx.conf.example tsx.conf
Then edit the ``[database]`` section in tsx.conf to match the database you just created.
2. Setup python virtual environment and install dependencies
------------------------------------------------------------.. code:: bash
pip install pipenv # if you don't have virtualenv already
pipenv sync3. Import taxa
--------------.. code:: bash
python -m tsx.import_taxa [path to TaxonList.xlsx]
4. Import some sample data
--------------------------Via command line:
.. code:: bash
python -m tsx.importer --type 1 --commit data/type-1-sample.csv
Or alternatively via web upload interface
.. code:: bash
# 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-data5. Run processing scripts
-------------------------.. code:: bash
python -m tsx.process alpha_hull
python -m tsx.process range_ultrataxon
python -m tsx.process pseudo_absenceOr all at once:
.. code:: bash
python -m tsx.process -c all
Deployment
==========(TODO - more detailed instructions)
1. Setup database (see instructions for dev environment)
2. Install tsx package::
python setup.py install
3. Edit configuration in ``/opt/tsx/conf/tsx.conf``
4. Setup as service (Linux)::
sudo cp etc/init.d/tsxapi /etc/init.d/
sudo service tsxapi start5. 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