import_project_from_json

Create a new dbnl Project from a JSON object

dbnl.import_project_from_json(
    *,
    params: dict[str, Any],
) -> Project:

Parameters

Arguments
Description

params

JSON object representing the Project, generally based on a Project exported via export_project_as_json. Example:

Returns

Type
Description

The newly created dbnl Project.

Examples

import dbnl
dbnl.login()


proj1 = dbnl.get_or_create_project(name="test_proj1")
export_json = dbnl.export_project_as_json(project=proj1)
export_json["project"]["name"] = "test_proj2"
proj2 = dbnl.import_project_from_json(params=export_json)

assert proj2.name == "test_proj2"

Was this helpful?