cliriculum.utils

cliriculum.utils.get_resources_nodes(root, tree, resrcs: List, skip_dirs: Iterable = {'__pycache__'}) List[PosixPath]

Get resources nodes recursively.

Parameters:
  • root (root Traversable) – Directory containing the module Generally obtained with: root=resources.files(package_name).parent package_name, being the package installed on your system

  • tree (Traversable)

  • resrcs – Resources should be empty list for first call. Expands on each recursive call.

  • skip_dirs (Iterable) – Directories in which resources should not be fetched. Default = {‘__pycache__’}

Returns:

List of nodes which are resources

Return type:

List[PosixPath]

Example

>>> a = resources.files("cliriculum.data")
>>> get_resources_nodes(a.parent.parent, a)
cliriculum.utils.copy_resources(directory: str, resource_root: str = 'cliriculum.data')

Copy resources to specified directory

Parameters:
  • directory (str Where to store the directory.) – The directory should exist.

  • resource_root (str) – The resource_root directory specified in module type

  • notation

  • "cliriculum.data" (default)

cliriculum.utils.copy_files(srcs: Iterable[str | Path], dst: Path | str) None

Copy files to destination keeping path basename.

Parameters:
  • srcs (Iterable[Union[str, Path]])

  • dst (Union[Path, str])

cliriculum.utils.auto_filename(name: str, job_title: str, company: str, camel_case: bool) str

Create filename string under the form:

<name>-resume-<job title>-<company>.pdf if camel_case is False. Or <Name>-Resume-<Job title>-<Company>.pdf if camel_case is True.

Note that spaces contained in name will be replace by “_”

Example

No space in name:

>>> from cliriculum.utils import auto_filename
>>> auto_filename(name="Cliriculum", job_title="Resume Maker", "company"="No Company")
    'cliriculum-resume_maker-company'

Space in name:

>>> auto_filename(name="Cliriculum Tool", job_title="Resume Maker", "company"="No Company")
    'cliriculum_tool-resume_maker-company'

Camel case in name:

>>> auto_filename(name="Cliriculum Tool", job_title="Resume Maker", "company"="No Company", camel_case=True)
    'Cliriculum_Tool-Resume-Maker-Company'