vcorelib package#

Subpackages#

Submodules#

vcorelib.names module#

Common name manipulations.

vcorelib.names.import_str_and_item(module_path: str) tuple[str, str][source]#

Treat the last entry in a ‘.’ delimited string as the item to import from the module in the string preceding it.

A simple name searching method.

vcorelib.names.obj_class_to_snake(class_obj: Any) str[source]#

Convert a CamelCase named class to a snake_case String.

vcorelib.names.to_snake(name: str, lower_dashes: bool = True) str[source]#

Convert a CamelCase String to snake_case.

vcorelib.python module#

A module for working with paths to python interpreters and virtual environments.

class vcorelib.python.StrToBool(result: bool, valid: bool)[source]#

Bases: NamedTuple

A container for results when converting strings to boolean.

static check(data: str) bool[source]#

Check a string for a boolean ‘true’ value.

static parse(data: str) StrToBool[source]#

Parse a string to boolean.

result: bool#

Alias for field number 0

valid: bool#

Alias for field number 1

vcorelib.python.python_entry(version: str = None) str[source]#

Attempt to get a Python entry-point as a string.

vcorelib.python.python_version() str[source]#

Get the version of Python to use.

vcorelib.python.venv_bin(cwd: Path | str | None, program: str = None, version: str = None) Path[source]#

Get the path to a virtual environment’s script directory.

vcorelib.python.venv_dir(cwd: Path | str | None, version: str = None) Path[source]#

Get the path for a virtual environment to use.

vcorelib.python.venv_name(version: str = None) str[source]#

Get the name for a virtual environment to use.

Module contents#

Useful defaults and other package metadata.