The locutus_utilities
repository includes scripts and tools that facilitate the development and maintenance of Locutus. These utilities may include automation tools, and other resources that support the application's lifecycle.
- Google Cloud SDK: Installed and authenticated to use Google Cloud services.
- Firestore enabled in your Google Cloud project.
- Install setuptools
-
Create and activate a virtual environment (recommended):
[Click here] for more on virtual environments.# Step 1: cd into the directory to store the venv # Step 2: run this code. It will create the virtual env named utils_venv in the current directory. python3 -m venv utils_venv # Step 3: run this code. It will activate the utils_venv environment source utils_venv/bin/activate # On Windows: venv\Scripts\activate # You are ready for installations! # If you want to deactivate the venv run: deactivate
-
Install the package and dependencies:
pip install git+https://github.com/NIH-NCPI/locutus_utilities.git
-
Run a command/action
utils_run -p <project_id> -o <option> -a <action>
-
-p, --project
- Description: GCP Project to edit.
- Required: Yes
-
-o, --option
- Description: Choose the operation to perform.
- Choices:
update_ontology_api
: Updates the ontology API in Firestore.update_seed_data
: Updates seed data in Firestore.delete_project_data
: Deletes all data from the Firestore database.reset_database
: Deletes all data, then reseeds the Firestore database.
- Required: Yes
-
-a, --action
- Description: Specify the action to take.
- Choices:
upload_from_csv
: Upload data from an existing CSV file to Firestore.update_csv
: Fetch data from APIs and update the CSV file only.fetch_and_upload
: Fetch data from APIs and upload it to Firestore.
- Default:
upload_from_csv
-
-u, --use_inclusion_list
- Description: Choose to include all ontologies or only a selection.
- Choices:
True
: Use the selected default ontologies.False
: Use all ontologies.
- Default:
False
If working on a new feature it is possible to install a package version within
the remote or local branch
```
# remote
pip install git+https://github.com/NIH-NCPI/locutus_utilities.git@{branch_name}
# local
pip install -e .
```