create_instance¶
-
nbreport.processing.
create_instance
(report_repo, instance_id=None, template_variables=None, instance_path=None, overwrite=False, github_username=None, github_token=None, server=None)¶ Create a report instance.
Parameters: - report_repo :
nbreport.repo.ReportRepo
Report repository.
- instance_id :
str
, optional The instance identifier. Leave as
None
to reserve a new instance with the server.- template_variables :
dict
, optional If provided, these key-value pairs are used to render the templated notebook. If
None
, the templated notebook is not rendered. If an emptydict
, the templated notebook is renderd but entirely with defaults defined incookiecutter.json
.- instance_path :
str
orpathlib.Path
, optional If provided, this is the directory of the report instance. Otherwise, a directory will be automatically created in the current working directory, formatted as
{{handle}}-{{id}}
.- overwrite :
bool
, optional If
True
, and a directory of the same name asinstance_path
exists, that directory is overwritten with the new instance.- github_username :
str
, optional GitHub username. Only required if
instance_id
is None.- github_token :
str
, optional Personal access token for the GitHub user. Only required if
instance_id
is None.- server :
str
, optional Hostname of the api.lsst.codes, or equivalent, service. Only required if
instance_id
is None.
Returns: - instance :
nbreport.instance.ReportInstance
A
ReportInstance
corresponding to an instance directory on the local filesystem.
- report_repo :