boilercore.paths
#
Paths and modules.
Module Contents#
Classes#
Represents a git submodule. |
Functions#
Get the directory of a package given the top-level module. |
|
Get an unqualified module name. |
|
Get a fully-qualified module name. |
|
Get datetime like ISO 8601 but with flexible delimeters and missing century. |
|
Map stage module names to their paths. |
|
Get module name relative to another module. |
|
Walk modules from a given submodule path and the top level library directory. |
|
Walk the map of modules to their paths. |
|
Get the qualified name of a module file relative to a package file. |
|
Walk the paths of a Python package. |
|
Get the regex pattern string for file suffixes. |
|
Get the regex pattern string for a file suffix. |
|
Walk a directory returning regex or glob matches. |
|
Resolve and normalize a path to a POSIX string path with forward slashes. |
|
Check whether notebook is modified. |
|
Get pending changes. |
|
Get the special template and typings submodules, as well as the rest. |
Data#
API#
- boilercore.paths.get_package_dir(
- package: types.ModuleType,
Get the directory of a package given the top-level module.
- boilercore.paths.get_module_name(
- module: types.ModuleType | importlib.machinery.ModuleSpec | pathlib.Path | str,
Get an unqualified module name.
Example:
get_module_name(__spec__ or __file__)
.
- boilercore.paths.get_qualified_module_name(
- module: types.ModuleType | importlib.machinery.ModuleSpec,
Get a fully-qualified module name.
Example:
get_module_name(__spec__ or __file__)
.
- boilercore.paths.dt_fromisolike( ) datetime.datetime #
Get datetime like ISO 8601 but with flexible delimeters and missing century.
- boilercore.paths.GROUP#
‘Template(…)’
- boilercore.paths.SUBSTITUTIONS#
None
- boilercore.paths.ISOLIKE_PATTERN#
‘substitute(…)’
- boilercore.paths.ISOLIKE#
‘compile(…)’
- boilercore.paths.DEFAULT_SUFFIXES#
[‘.py’]
- boilercore.paths.map_stages(
- package: pathlib.Path,
- suffixes=DEFAULT_SUFFIXES,
Map stage module names to their paths.
- boilercore.paths.walk_modules(
- package: pathlib.Path,
- suffixes: list[str] = DEFAULT_SUFFIXES,
Walk modules from a given submodule path and the top level library directory.
- boilercore.paths.walk_module_map(
- package: pathlib.Path,
- suffixes: list[str] = DEFAULT_SUFFIXES,
Walk the map of modules to their paths.
- boilercore.paths.get_qualified_module_name_from_paths(
- module: pathlib.Path,
- package: pathlib.Path,
Get the qualified name of a module file relative to a package file.
- boilercore.paths.walk_module_paths(
- package: pathlib.Path,
- suffixes: list[str] = DEFAULT_SUFFIXES,
Walk the paths of a Python package.
- boilercore.paths.get_suffix_re(
- suffix: str,
Get the regex pattern string for a file suffix.
- boilercore.paths.walk_matches(
- path: pathlib.Path,
- glob: str | None = None,
- regex: str | None = None,
- root_regex: str | None = None,
- flags=NOFLAG,
Walk a directory returning regex or glob matches.
- boilercore.paths.fold(
- path: pathlib.Path,
- resolve: bool = True,
Resolve and normalize a path to a POSIX string path with forward slashes.
- boilercore.paths.modified(
- nb: pathlib.Path | str,
Check whether notebook is modified.
- boilercore.paths.get_changes() list[pathlib.Path] #
Get pending changes.
- class boilercore.paths.Submodule#
Represents a git submodule.
- path: pathlib.Path#
‘Path(…)’
Submodule path.
- __post_init__()#
Handle byte strings reported by some submodule sources, like dulwich.
- boilercore.paths.get_submodules() list[boilercore.paths.Submodule] #
Get the special template and typings submodules, as well as the rest.