This directory contains example scripts to interact with MapCraft API. This is a public repo and we encourage user contributions. Pull Requests are welcomed!
- Install dependencies (use of isolated environment tools like
virtualenvorcondaare recommended)
pip install -r requirements.txt- Run the script
python quick_test.py YOUR_EMAIL YOUR_PASSWORDFunctions in utils.py
-
Authentication
get_user_token(email: str, password: str) -> str:
-
Basic communication
make_post_request(endpoint: str, token: str, body: dict) -> dict:make_get_request(endpoint: str, token: str) -> dict:
-
Data I/O
get_layer_data_url(project_id: str, token: str) -> str:download_layer_data_to_file(project_id: str, file_name: str, token: str):upload_base_data_from_file(project_id: str, layer_id: str, file_name: str, token: str):upload_join_csv_data_from_file(project_id: str, layer_id: str, scenario_id: str, file_name: str, token: str):
-
Monitor Simulations Status
poll_simulation_status_until_complete(project_id: str, simulation_id: str, token: str):