Help Topics for builtin

Project

release

Function

build_help_db

Sample CLI

gway release build-help-db

References

['_builtins', '_builtins.items', 'load_project', 'sql', 'sql.open_connection', 'warning']

Signature

()

Project

builtin

Function

abort

Sample CLI

gway abort

References

['critical']

Signature

(message: str, *, exit_code: int = 1) -> int

Docstring

Abort with error message.

Project

builtin

Function

envs

Sample CLI

gway envs

Signature

(filter: str = None) -> dict

Docstring

Return all environment variables in a dictionary.

Project

builtin

Function

hello_world

Sample CLI

gway hello-world

Signature

(name: str = 'World', *, greeting: str = 'Hello')

Docstring

Smoke test function.

Project

builtin

Function

help

Sample CLI

gway help

References

['info', 'release', 'release.build_help_db', 'resource', 'sql', 'sql.open_connection', 'warning']

Signature

(*args, full=False)

Project

builtin

Function

infer_type

Sample CLI

gway infer-type

Signature

(value, default=None, **types)

Docstring

Try casting `value` to each provided type. If a cast succeeds, returns the corresponding key (name). If none succeed, returns default. Example: gw.infer_type("42", INTEGER=int, REAL=float) # => "INTEGER" gw.infer_type("hello", INTEGER=int, default="TEXT") # => "TEXT"

Project

builtin

Function

resource

Sample CLI

gway resource

References

['abort', 'base_path']

Signature

(*parts, touch=False, check=False, text=False)

Docstring

Construct a path relative to the base, or the Gateway root if not specified. Assumes last part is a file and creates parent directories along the way. Skips base and root if the first element in parts is already an absolute path. Args: *parts: Path components, like ("subdir", "file.txt"). touch (bool): If True, creates the file if it doesn't exist. check (bool): If True, aborts if the file doesn't exist and touch is False. text (bool): If True, returns the text contents of the file instead of the path. Returns: pathlib.Path | str: The constructed path, or file contents if text=True.

Project

builtin

Function

run

Sample CLI

gway run

References

['run_recipe']

Signature

(*script: str, **context)

Project

builtin

Function

run_recipe

Sample CLI

gway run-recipe

References

['debug', 'resource']

Signature

(*script: str, **context)

Docstring

Run commands parsed from a .gwr file, falling back to the 'recipes/' resource bundle. Recipes are gway scripts composed of one command per line with optional comments.

Project

builtin

Function

sample_cli_args

Sample CLI

gway sample-cli-args

Signature

(func)

Docstring

Generate a sample CLI string for a function.

Project

builtin

Function

sigils

Sample CLI

gway sigils

Signature

(*args: str)

Docstring

List the valid sigils found in any of the given args.

Project

builtin

Function

test

Sample CLI

gway test

References

['info']

Signature

(root: str = 'tests', filter=None)

Docstring

Execute all automatically detected test suites.

Project

builtin

Function

to_html

Sample CLI

gway to-html

Signature

(obj, **kwargs)

Docstring

Convert an arbitrary Python object to structured HTML. Args: obj: The object to convert. **kwargs: Optional keyword arguments for customization: - class_prefix: Prefix for HTML class names. - max_depth: Maximum recursion depth. - skip_none: Skip None values. - pretty: Insert newlines/indentation. Returns: A string of HTML representing the object.

Project

builtin

Function

to_list

Sample CLI

gway to-list

Signature

(obj, flat=False)

Docstring

Convert, and optionally flatten, any object into a list with a set of intuitive rules. - If `obj` is a string with spaces, commas, colons, or semicolons, split it. - If `obj` is a dict or a view (e.g., bottle view dict), return ["key=value", ...]. - If `obj` is a list or tuple, return it as a list. - If `obj` is an iterable, convert to list. - Otherwise, return [obj].

Project

builtin

Function

unwrap

Sample CLI

gway unwrap

Signature

(obj: Any, expected: Optional[Type] = None) -> Any

Docstring

Function unwrapper that digs through __wrapped__, iterables, and closures.

Project

builtin

Function

version

Sample CLI

gway version

References

['critical', 'resource']

Signature

(check=None) -> str

Docstring

Return the version of the package. If `check` is provided, ensure the version meets or exceeds the required `major.minor.patch` string. Raise AssertionError if requirement is not met.