Signature
(table_path: str, old_entry: str, new_entry: str, **kwargs) -> bool
Docstring
Copy a record from old_entry to new_entry, optionally updating fields.
Sample CLI
gway cdv credit
Signature
(table_path: str, entry: str, *, field: str = 'balance', **kwargs) -> bool
Docstring
Add 1 (or amount from kwargs) to the given field for a record.
Signature
(table_path: str, entry: str, *, field: str = 'balance', **kwargs) -> bool
Docstring
Subtract 1 (or amount from kwargs) from the given field for a record.
Sample CLI
gway cdv delete
Signature
(table_path: str, entry_id: str)
Docstring
Remove a record by ID from the CDV table.
Sample CLI
gway cdv load-all
Signature
(pathlike: str) -> dict[str, dict[str, str]]
Docstring
Load CDV table with ID followed by colon-separated key=value fields.
Signature
(table_path: str, old_entry: str, new_entry: str, **kwargs) -> bool
Docstring
Move a record from old_entry to new_entry, optionally updating fields.
Signature
(string, safe='/', encoding=None, errors=None)
Docstring
quote('abc def') -> 'abc%20def'
Each part of a URL, e.g. the path info, the query, etc., has a
different set of reserved characters that must be quoted. The
quote function offers a cautious (not minimal) way to quote a
string for most of these parts.
RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists
the following (un)reserved characters.
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
reserved = gen-delims / sub-delims
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
Each of the reserved characters is reserved in some component of a URL,
but not necessarily in all of them.
The quote function %-escapes all characters that are neither in the
unreserved chars ("always safe") nor the additional chars set via the
safe arg.
The default for the safe arg is '/'. The character is reserved, but in
typical usage the quote function is being called on a path where the
existing slash characters are to be preserved.
Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
Now, "~" is included in the set of unreserved characters.
string and safe may be either str or bytes objects. encoding and errors
must not be specified if string is a bytes object.
The optional encoding and errors parameters specify how to deal with
non-ASCII characters, as accepted by the str.encode method.
By default, encoding='utf-8' (characters are encoded with UTF-8), and
errors='strict' (unsupported characters raise a UnicodeEncodeError).
Sample CLI
gway cdv read-rows
Signature
(pathlike: str) -> list[list[str]]
Docstring
Read a CDV as a list of rows: [id, k1, v1, ...].
Sample CLI
gway cdv save-all
Signature
(pathlike: str, all_records: dict[str, dict[str, str]])
Docstring
Replace all records in the CDV file at pathlike with the given dict.
Sample CLI
gway cdv unquote
Signature
(string, encoding='utf-8', errors='replace')
Docstring
Replace %xx escapes by their single-character equivalent. The optional
encoding and errors parameters specify how to decode percent-encoded
sequences into Unicode characters, as accepted by the bytes.decode()
method.
By default, percent-encoded sequences are decoded with UTF-8, and invalid
sequences are replaced by a placeholder character.
unquote('abc%20def') -> 'abc def'.
Sample CLI
gway cdv update
Signature
(table_path: str, entry_id: str, **fields)
Docstring
Append or update a record in the CDV table, preserving unspecified fields.
Sample CLI
gway cdv validate
Signature
(table_path: str, entry: str, *, validator=None) -> bool
Docstring
Validate a CDV entry by ID directly from file.
Always reloads the file from disk to avoid stale data.
Sample CLI
gway cdv view-colon-validator
TODOs
# TODO: If text is None, return an html fragment with a form in which the user
# can paste a CDV file into a large textarea and submit for validation as 'text'.
# If text is received, test amd validate it and let the user know if there are any issues
# found that would impede the file to be processed as a valid CDV.
Sample CLI
gway cdv write-rows
Signature
(pathlike: str, rows: list[list[str]])
Docstring
Write a list of rows: [id, k1, v1, ...] as a CDV file.
Sample CLI
gway vbox open-remote
Signature
(server_url: str = '[SERVER_URL]', *, path: str = 'vbox', email: str = '[ADMIN_EMAIL]')
Docstring
Create a vbox on a remote system, retrieve the upload link from email, and store it locally.
- server_url: Base URL of the remote server (e.g., 'https://example.com')
- path: Path on remote server where vbox upload is handled (default 'vbox')
- email: Email address to receive the upload link (should be accessible by local mail.search)
Returns: dict of stored record fields, or None if unsuccessful.
Sample CLI
gway vbox poll-remote
Signature
(server_url: str = '[SERVER_URL]', *, target='work/vbox/remote', interval=3600)
Docstring
Poll the remote vbox for files and download new/updated ones to the local target directory.
- server_url: Remote GWAY instance base URL
- target: Local directory to save downloaded files
- interval: Seconds between polls (runs forever unless interval=None)
Skips files already downloaded by using the modified_since parameter.
Sample CLI
gway ocpp.csms setup-app
References
cdv,
cdv.validate,
debug,
error,
exception,
info,
mail,
mail.send,
resolve,
resource,
unwrap_one,
warn Signature
(*, app=None, allowlist=None, denylist=None, location=None, authorize=<function authorize_balance at
0x00000256F2C3F1A0>, email=None)
Sample CLI
gway web.auth config-basic
Signature
(*, allow='work/basic_auth.cdv', engine='auto', optional=False)
Docstring
Register a basic authentication challenge using username/password pairs from a CDV.
Username is the key, password is the value under 'b64' (base64-encoded).
- If optional=True, failure does not block unless strict=True.
Sample CLI
gway web.auth create-user
Signature
(username, password, *, allow='work/basic_auth.cdv', overwrite=False, **fields)
Docstring
Create (or update if overwrite=True) a user in the CDV file for basic auth.
Stores password as b64 field (base64 encoded).
You can pass extra fields as kwargs.
Sample CLI
gway web.cookies update-mask-on-cookie-change
Docstring
Called when any cookie is set or removed, to update the mask record (if any) in masks.cdv.
Sample CLI
gway web.cookies view-my-mask
Signature
(*, claim=None, set_mask=None)
Docstring
View and manage mask linking for cookies.
- GET: Shows current mask and allows claim or update.
- POST (claim/set_mask): Claim a mask and save/load cookies to/from masks.cdv.
If user claims an existing mask AND already has a mask cookie,
ALL existing cookies (except cookies_accepted) are wiped before restoring the claimed mask.
No wipe is performed when creating a new mask.