Python API¶
Starter Manager¶
manager, for starters
-
class
jupyter_starters.manager.
StarterManager
(**kwargs)[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
-
property
starters
¶ augment notebook starters
TODO: caching
-
property
Starters¶
Cookiecutter¶
a starter that runs cookiecutter
try to load the pantry from the cookiecutter metadata
try to find some cookiecutters
convert a cookiecutter context to a JSON schema
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.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
¶
-
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 Inf would be serialized.Set reject_bytes=True to raise TypeError on bytes.
-
jupyter_starters.json_.
json_validator
(schema)[source]¶ implements that fastjsonschema.compile API with jsonschema
-
jupyter_starters.json_.
loads
()¶ Converts JSON as string to dict object structure.