Sample CLI
gway release build-help-db
References
['_builtins', '_builtins.items', 'load_project', 'sql', 'sql.open_connection', 'warning']
Signature
(message: str, *, exit_code: int = 1) -> int
Docstring
Abort with error message.
Signature
(filter: str = None) -> dict
Docstring
Return all environment variables in a dictionary.
Sample CLI
gway hello-world
Signature
(name: str = 'World', *, greeting: str = 'Hello')
Docstring
Smoke test function.
References
['info', 'release', 'release.build_help_db', 'resource', 'sql', 'sql.open_connection', 'warning']
Signature
(*args, full=False)
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"
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.
Signature
(*script: str, **context)
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.
Sample CLI
gway sample-cli-args
Docstring
Generate a sample CLI string for a function.
Docstring
List the valid sigils found in any of the given args.
Signature
(root: str = 'tests', filter=None)
Docstring
Execute all automatically detected test suites.
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.
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].
Signature
(obj: Any, expected: Optional[Type] = None) -> Any
Docstring
Function unwrapper that digs through __wrapped__, iterables, and closures.
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.