A repo to hold python tools that facilitate the assessment of natural hazards over various domains like population, landuse, infrastructure, etc
Install the project with dependencies to virtual environment as below.
pipenv run pip install -e .
To uninstall the project from Python environment, execute the following command.
pipenv run pip uninstall geo-cb-surge
Then, run the below command to show help menu.
pipenv run rapida --help
To access blob storage in Azure, each user must have a role of Storage Blob Data Contributor
.
- inside Docker container
Since it has an issue of opening browser by azure.identity package inside docker container, use az login
to authenticate prior to use API.
az login # authenticate with az login
pipenv run rapida init
- without Docker
init
command will open browser to authenticate to Azure
pipenv run rapida init
admin
command provides functionality to retrieve admin data for passed bounding bbox from either OpenStreetMap or OCHA.
- OSM
pipenv run rapida admin osm --help
- ocha
pipenv run rapida admin ocha --help
Each cbsurge
's modules has its own test suite which can be ran independently
make test
before running the above command, please use devcontainer
or make shell
to enter to docker container first.
make build
- launch docker container
make up
You can access to JupyterHub through http:localhost:8100
in your browser.
- set users
Authenticate users can be set through JUPYTER_USERS
variable at .env
file.
cp .env.example .env
vi .env
JUPYTER_USERS can have multiple users (username:password) for authentication
JUPYTER_USERS=docker:docker user:user
folder structure in the container will be as follows:
- /data - it will be mounted to fileshare. All files under this folder will be kept
- /data/{username} - users can explore all users file, a user has no permission to edit other users' folder.
- /home/{username} - user home folder. This data will be lost when the server is restarted.
make down
make shell
pipenv run rapida --help # run CLI in shell on docker container