Help Topics for t

Project

clock

Function

to_download

Sample CLI

gway clock to-download

Signature

(filesize)

Docstring

Prompt: Create a python function that takes a file size such as 100 MB or 1.76 GB (pick a wide array of units) and then calculates the possible time to download it within 4 ranges. You choose the ranges logarithmically. Then, perform a quick check against google to let the user know what their current range is.

Project

deck

Function

deal

Sample CLI

gway deck deal

Signature

(number, name='latest')

Project

deck

Function

shuffle

Sample CLI

gway deck shuffle

Signature

(name, *, marks='seen held', **kwargs)

Project

odoo

Function

Form

Sample CLI

gway odoo Form

Signature

(default: Annotated[Any, Doc('\n            Default value if the parameter field is not set.\n
')] = PydanticUndefined, *, default_factory: Annotated[Optional[Callable[[], Any]], Doc("\n
A callable to generate the default value.\n\n            This doesn't affect `Path` parameters as
the value is always required.\n            The parameter is available only for compatibility.\n
")] = PydanticUndefined, media_type: typing.Annotated[str, Doc("\n            The media type of this
parameter field. Changing it would affect the\n            generated OpenAPI, but currently it
doesn't affect the parsing of the data.\n            ")] = 'application/x-www-form-urlencoded',
alias: Annotated[Optional[str], Doc("\n            An alternative name for the parameter field.\n\n
This will be used to extract the data and for the generated OpenAPI.\n            It is particularly
useful when you can't use the name you want because it\n            is a Python reserved keyword or
similar.\n            ")] = None, alias_priority: Annotated[Optional[int], Doc('\n
Priority of the alias. This affects whether an alias generator is used.\n            ')] =
PydanticUndefined, validation_alias: Annotated[Optional[str], Doc("\n            'Whitelist'
validation step. The parameter field will be the single one\n            allowed by the alias or set
of aliases defined.\n            ")] = None, serialization_alias: Annotated[Optional[str], Doc("\n
'Blacklist' validation step. The vanilla parameter field will be the\n            single one of the
alias' or set of aliases' fields and all the other\n            fields will be ignored at
serialization time.\n            ")] = None, title: Annotated[Optional[str], Doc('\n
Human-readable title.\n            ')] = None, description: Annotated[Optional[str], Doc('\n
Human-readable description.\n            ')] = None, gt: Annotated[Optional[float], Doc('\n
Greater than. If set, value must be greater than this. Only applicable to\n            numbers.\n
')] = None, ge: Annotated[Optional[float], Doc('\n            Greater than or equal. If set, value
must be greater than or equal to\n            this. Only applicable to numbers.\n            ')] =
None, lt: Annotated[Optional[float], Doc('\n            Less than. If set, value must be less than
this. Only applicable to numbers.\n            ')] = None, le: Annotated[Optional[float], Doc('\n
Less than or equal. If set, value must be less than or equal to this.\n            Only applicable
to numbers.\n            ')] = None, min_length: Annotated[Optional[int], Doc('\n            Minimum
length for strings.\n            ')] = None, max_length: Annotated[Optional[int], Doc('\n
Maximum length for strings.\n            ')] = None, pattern: Annotated[Optional[str], Doc('\n
RegEx pattern for strings.\n            ')] = None, regex: Annotated[Optional[str], Doc('\n
RegEx pattern for strings.\n            '), ] = None, discriminator: Annotated[Optional[str], Doc('\n            Parameter
field name for discriminating the type in a tagged union.\n            ')] = None, strict:
Annotated[Optional[bool], Doc('\n            If `True`, strict validation is applied to the field.\n
')] = PydanticUndefined, multiple_of: Annotated[Optional[float], Doc('\n            Value must be a
multiple of this. Only applicable to numbers.\n            ')] = PydanticUndefined, allow_inf_nan:
Annotated[Optional[bool], Doc('\n            Allow `inf`, `-inf`, `nan`. Only applicable to
numbers.\n            ')] = PydanticUndefined, max_digits: Annotated[Optional[int], Doc('\n
Maximum number of allow digits for strings.\n            ')] = PydanticUndefined, decimal_places:
Annotated[Optional[int], Doc('\n            Maximum number of decimal places allowed for numbers.\n
')] = PydanticUndefined, examples: Annotated[Optional[List[Any]], Doc('\n            Example values
for this field.\n            ')] = None, example: Annotated[Optional[Any],
] = PydanticUndefined, openapi_examples:
Annotated[Optional[Dict[str, fastapi.openapi.models.Example]], Doc("\n            OpenAPI-specific
examples.\n\n            It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n\n
Swagger UI (that provides the `/docs` interface) has better support for the\n            OpenAPI-
specific examples than the JSON Schema `examples`, that's the main\n            use case for
this.\n\n            Read more about it in the\n            [FastAPI docs for Declare Request
Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/#using-the-
openapi_examples-parameter).\n            ")] = None, deprecated:
Annotated[Union[typing_extensions.deprecated, str, bool, NoneType], Doc('\n            Mark this
parameter field as deprecated.\n\n            It will affect the generated OpenAPI (e.g. visible at
`/docs`).\n            ')] = None, include_in_schema: typing.Annotated[bool, Doc("\n            To
include (or not) this parameter field in the generated OpenAPI.\n            You probably don't need
it, but it's available.\n\n            This affects the generated OpenAPI (e.g. visible at
`/docs`).\n            ")] = True, json_schema_extra: Annotated[Optional[Dict[str, Any]], Doc('\n
Any additional JSON schema data.\n            ')] = None, **extra: Annotated[Any, Doc('\n
Include extra fields used by the JSON Schema.\n            '), ]) -> Any

TODOs

# TODO: update when deprecating Pydantic v1, import these types # validation_alias: str | AliasPath | AliasChoices | None

Project

release

Function

loc

Sample CLI

gway release loc

References

['resource']

Signature

(*paths)

Docstring

Counts Python lines of code in the given directories, ignoring hidden files and directories. Defaults to everything in the current GWAY release.

Project

web.server

Function

start_app

Sample CLI

gway web.server start-app

References

['info', 'warning', 'web', 'web.app', 'web.app.setup', 'web.server', 'web.server.start']

Signature

(*, host='[WEBSITE_HOST|127.0.0.1]', port='[WEBSITE_PORT|8888]', debug=False, proxy=None, app=None,
daemon=False, threaded=True, is_worker=False)

Docstring

Start an HTTP (WSGI) or ASGI server to host the given application. - If `app` is a FastAPI instance, runs with Uvicorn. - If `app` is a WSGI app (Bottle, Paste URLMap, or generic WSGI callables), uses Paste+ws4py or Bottle. - If `app` is a zero-arg factory, it will be invoked (supporting sync or async factories). - If `app` is a list of apps, each will be run in its own thread (each on an incremented port).

Project

web.site

Function

view_awg_finder

Sample CLI

gway web.site view-awg-finder

References

['awg', 'awg.find_cable']

Signature

(*args, meters=None, amps='40', volts='220', material='cu', max_lines='3', phases='1', conduit=None,
neutral='0', **kwargs)

Docstring

Page builder for AWG cable finder with HTML form and result.

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.