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
- set users
cp .env.example .env
vi .env
SSH_USERS can have multiple users (username:password) for SSH login
SSH_USERS=docker:docker user:user
- launch docker container
make up
The below command is connecting to localhost
with user docker
through port 2222
.
ssh docker@localhost -p 2222
# it will automatically enter venv in /app folder
# then run rapida command
rapida --help
make down
make shell
pipenv run rapida --help # run CLI in shell on docker container