Python API#
Starter Manager#
Manager, for starters.
- jupyter_starters.manager.DEFAULT_ENV_CLS = 'jinja2.sandbox.SandboxedEnvironment'#
the importable name of a class
- class jupyter_starters.manager.StarterManager(**kwargs: Any)[source]#
Handlers starting starters.
- property contents_manager#
Use the contents manager from parent.
- property kernel_manager#
Use the kernel manager from parent.
- property running#
Report names of all starters that could be stopped.
- async save_one_file(src, dest)[source]#
Generate and save a content model for a single file/directory.
- property starters#
Augment notebook starters.
TODO: caching
Starters#
Notebook#
Use a notebook as a starter.
- async jupyter_starters.py_starters.notebook.copy_files(tmp_nb, path, manager)[source]#
Handle retrieving the files from the temporary directory.
- async jupyter_starters.py_starters.notebook.ensure_notebook(starter, path, body, tmpdir, manager)[source]#
Ensure a notebook exists in a temporary directory.
- async jupyter_starters.py_starters.notebook.get_kernel_and_tmpdir(name, starter, manager)[source]#
Use the manager to get a kernel and working directory.
- jupyter_starters.py_starters.notebook.kernel_for_path(src)[source]#
get the kernel.
TODO: do better on account of freaky names
- async jupyter_starters.py_starters.notebook.notebook_starter(name, starter, path, body, manager)[source]#
(re)runs a notebook until its schema is correct.
- jupyter_starters.py_starters.notebook.response_from_nbjson(nbjson)[source]#
Get the starter response.
- jupyter_starters.py_starters.notebook.response_from_notebook(src)[source]#
Load a path and return the metadata.
Miscellaneous#
Types#
Some types and constants.
Traits#
Some more traits.
these are not typechecked yet, because of the impedance between traitlets, JSON Schema, and mypy.
- class jupyter_starters.trait_types.Schema(validator, *args, **kwargs)[source]#
any…
but validated by a
jupyter_starters.json_.json_validator()
- __init__(validator, *args, **kwargs)[source]#
Declare a traitlet.
If allow_none is True, None is a valid value in addition to any values that are normally valid. The default is up to the subclass. For most trait types, the default value for
allow_none
is False.If read_only is True, attempts to directly modify a trait attribute raises a TraitError.
Extra metadata can be associated with the traitlet using the .tag() convenience method or by using the traitlet instance’s .metadata dictionary.
Validators#
Some third-party preferred alternatives to stdlib/status quo for parsing and validating JSON.
- jupyter_starters.json_.JsonSchemaException#
alias of
ValidationError
- jupyter_starters.json_.dumps()#
Converts arbitrary object recursively into JSON. Use ensure_ascii=false to output UTF-8. Set encode_html_chars=True to encode < > & as unicode escape sequences. Set escape_forward_slashes=False to prevent escaping / characters.Set allow_nan=False to raise an exception when NaN or Infinity would be serialized.Set reject_bytes=True to raise TypeError on bytes.
- jupyter_starters.json_.json_validator(schema: Dict[str, Any]) Callable[[Dict[str, Any]], Any] [source]#
Implements that fastjsonschema.compile API with jsonschema.
- jupyter_starters.json_.loads()#
Converts JSON as string to dict object structure.