nbautoexport.clean
find_files_to_clean(directory, config)
Given path to a notebooks directory watched by nbautoexport, find all files that are not expected exports by current nbautoexport configuration and existing notebooks, or other expected Jupyter or nbautoexport files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory |
Path |
notebooks directory to find files to clean up |
required |
Returns:
Type | Description |
---|---|
List[pathlib.Path] |
List[Path]: list of files to clean up |
Source code in nbautoexport/clean.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_expected_exports(notebooks, config)
Given an iterable of Jupyter notebooks, return list of paths of files that nbautoexport would be expected to export to given this configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
notebooks |
Iterable[nbautoexport.utils.JupyterNotebook] |
iterable of notebooks |
required |
Returns:
Type | Description |
---|---|
List[pathlib.Path] |
List[Path]: list of expected nbautoexport output files, relative to notebook files |
Source code in nbautoexport/clean.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
get_extension(notebook, export_format)
Given a notebook and export format, return expected export file extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
notebook |
JupyterNotebook |
notebook to determine extension for |
required |
export_format |
ExportFormat |
export format name |
required |
Returns:
Type | Description |
---|---|
str |
str: file extension, e.g., '.py' |
Source code in nbautoexport/clean.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
notebook_exports_generator(notebook, export_format, organize_by)
[summary]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
notebook |
JupyterNotebook |
notebook to get export paths for |
required |
export_format |
ExportFormat |
export format |
required |
organize_by |
OrganizeBy |
type of subfolder approach |
required |
Returns:
Type | Description |
---|---|
Iterable[pathlib.Path] |
Iterable[Path]: expected export paths given notebook and configuration options |
Source code in nbautoexport/clean.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|