deployment
Module diagram
classDiagram
class deployment {
}
class package_version_updater {
}
deployment
package_version_updater
PACKAGE_VERSION_DATABASE_ID
module-attribute
convert_data_into_exact_match_filters
converts dictionary data into a property form required by notion api. key of data and fields shoud match!
e.g) data = {"exp_name": "cls_base", "accuracy": 0.99} fields = {"exp_name": "title", "accuracy": "number"}
return:
{
"filter":
"and": [
{
"property": "exp_name",
"text": {"equals": "cls_base"}
},
{
"property": "accuracy",
"number": {"equals": 0.99}
}
]
}
Parameters:
-
data(Dict[str, Any]) –key: property name, value: property value
-
fields(FieldType) –key: property name, value: property type
Returns:
-
_type_–property required by notion api
Source code in ResearchToolkit/deployment/package_version_updater.py
query_page
Queries the Notion database for the provided data.
Parameters:
-
data(Dict[str, Any]) –Dictionary containing the data to be queried in the Notion database.
-
database_id(str, default:PACKAGE_VERSION_DATABASE_ID) –The ID of the Notion database.
Source code in ResearchToolkit/deployment/package_version_updater.py
create_or_load_page
Queries the Notion database for the provided data, and if not found, creates a new page in the Notion database with the provided data.
Parameters:
-
data(Dict[str, Any]) –Dictionary containing the data to be added to the Notion database.
Returns:
-
str–Optional[str]: The ID of the created page.
Source code in ResearchToolkit/deployment/package_version_updater.py
get_latest_version
get_latest_version(package_name: str, database_id: str = PACKAGE_VERSION_DATABASE_ID) -> Optional[str]
Queries the Notion database for the latest version of the package.
Parameters:
-
package_name(str) –The name of the package.
Returns:
-
Optional[str]–Optional[str]: The latest version of the package.