Help Topics for exception

Sample CLI

gway awg view-cable-finder

Signature

(*, 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.

TODOs

# TODO: Add a image with the sponsor logo on the right side of the result page

cdv · credit

Sample CLI

gway cdv credit

References

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.

cdv · debit

Sample CLI

gway cdv debit

References

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 load-all

References

Signature

(pathlike: str) -> dict[str, dict[str, str]]

Docstring

Load CDV table with ID followed by colon-separated key=value fields.

Sample CLI

gway cdv validate

References

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 clip track-history

References

Signature

(interval: int = 5, *, stop_after=None, notify=True)

Docstring

Tracks clipboard history by polling at regular intervals. Args: interval (int): Seconds to wait between checks. Default is 5 seconds. stop_after (int | None): Optional maximum duration (in seconds) before stopping. notify (bool): Whether to show GUI notifications for new entries. Writes: Appends new clipboard entries to 'work/clip/history.txt', separated by ' ... '.

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.

Sample CLI

gway conway load-board

Signature

()

Docstring

Load the board from disk, or create one if missing.

Sample CLI

gway conway view-game-of-life

Signature

(*args, action=None, board=None, toggle_x=None, toggle_y=None, **kwargs)

Sample CLI

gway etron extract-records

References

Signature

(location, *, add_days=0, after=None, before=None, batch=None)

Docstring

Load data from EV IOCHARGER .json files to CSV format. > gway etron extract_records san-pedro > gway etron extract_records calzada-del-valle > gway etron extract_records porsche-centre This assumes the files are at work/etron/records/<location>.

Sample CLI

gway mail search

References

Signature

(subject_fragment, body_fragment=None)

Docstring

Search emails by subject and optionally body. Use "*" to match any subject.

mail · send

Sample CLI

gway mail send

References

Signature

(subject, body=None, to=None, threaded=None, **kwargs)

Docstring

Send an email with the specified subject and body, using defaults from env if available. Parameters: - subject: the email subject (string) - body: the plain-text body (string). Must be provided. - to: recipient address (string). Defaults to ADMIN_EMAIL from the environment. - threaded: if True, send the email asynchronously; if False, block and send; if None, auto-detect. - **kwargs: reserved for future use. Returns: str ("Email sent successfully to ...") or error message, unless threaded is True (returns immediately).

mtg · search

Sample CLI

gway mtg search

Signature

(query, *, show=True, limit=5, **kwargs)

Docstring

Search for Magic: The Gathering cards using Scryfall API. Parameters: query (str): The search query (name, text, type, etc.) show (bool): If True, print the card(s) info; else, return the results. **kwargs: Extra parameters for the Scryfall search API. Returns: list of dict: List of matching card data dicts if show=False. None: If show=True (prints results directly).

Sample CLI

gway odoo create-quote

References

Signature

(*, customer, template_id, validity=None, notes=None)

Docstring

Create a new quotation using a specified template and customer name. Parameters: customer (str): The name (or partial name) of the customer to link to the quote. template_id (int): The ID of the quotation template to use. validity (str, optional): The expiration date for the quote in 'YYYY-MM-DD' format. notes (str, optional): Internal notes or message to include in the quote. Returns: dict: The created quotation details.

Sample CLI

gway odoo execute-kw

References

Signature

(*args, model: str, method: str, **kwargs) -> dict

Docstring

A generic function to directly interface with Odoo's execute_kw method. Parameters: model (str): The Odoo model to interact with (e.g., 'sale.order'). method (str): The method to call on the model (e.g., 'read', 'write'). args (list): Positional arguments to pass to the method. kwargs (dict): Keyword arguments to pass to the method. Returns: dict: The result of the execute_kw call.

Sample CLI

gway odoo fetch-customers

References

Signature

(*, name=None, email=None, phone=None, country=None, latest_quotes=None, **kwargs)

Docstring

Fetch customers from Odoo with optional filters. Parameters: name (str, optional): Filter customers by their name or part of it. email (str, optional): Filter customers by their email address or part of it. phone (str, optional): Filter customers by their phone number or part of it. country (str, optional): Filter customers by their country name or part of it. **kwargs: Additional filters to be applied, passed as key-value pairs. Returns: dict: The fetched customers.

TODOs

# TODO: If latest_quotes is a number, also fetch the many latest quotes for this customer.

Sample CLI

gway odoo fetch-quotes

References

Signature

(*, state='draft', older_than=None, salesperson=None, customer=None, **kwargs)

Docstring

Fetch quotes/quotations from Odoo with optional filters. Parameters: state (str): Filter quotations by their state. Default is 'draft'. older_than (int, optional): Filter quotations older than a specific number of days. salesperson (str, optional): Filter quotations by the salesperson's name or part of it. customer (str, optional): Filter quotations by the customer's name or part of it. kwargs (list, optional): Additional domain filters for the query. Returns: dict: The fetched quotations.

Sample CLI

gway odoo fetch-templates

References

Signature

(*, name=None, active=True, **kwargs)

Docstring

Fetch available quotation templates from Odoo with optional filters. Parameters: name (str, optional): Filter templates by name or part of it. active (bool): Whether to include only active templates. Defaults to True. **kwargs: Additional filters as key-value pairs. Returns: dict: The fetched quotation templates.

Sample CLI

gway odoo find-quotes

References

Signature

(*, product, quantity: int = 1, state: str = 'draft', **kwargs)

Docstring

Find all sale quotes that contain a given product (by id or name substring) with at least the given quantity. Parameters: product (str or int): Product ID or partial name. quantity (int): Minimum quantity of the product in the quote. Default is 1. state (str): Odoo sale order state (default: 'draft' for quotations). **kwargs: Additional domain filters for sale.order. Returns: list: List of matching sale orders (quotes) with product line details.

Sample CLI

gway odoo setup-chatbot-app

References

Signature

(*, path='/chatbot', username='[ODOO_USERNAME]', alias='Operator', apps=None)

Docstring

Create a FastAPI app (or append to existing ones) serving a chatbot UI and logic.

Sample CLI

gway qr scan-img

Signature

(source)

Docstring

Scan the given image (file‑path or PIL.Image) for QR codes and return a list of decoded string values. Returns [] if nothing’s found.

Sample CLI

gway release build

References

Signature

(*, bump: bool = False, dist: bool = False, twine: bool = False, help_db: bool = True, projects:
bool = False, git: bool = False, all: bool = False, force: bool = False) -> None

Docstring

Build the project and optionally upload to PyPI. Args: bump (bool): Increment patch version if True. dist (bool): Build distribution package if True. twine (bool): Upload to PyPI if True. force (bool): Skip version-exists check on PyPI if True. git (bool): Require a clean git repo and commit/push after release if True. vscode (bool): Build the vscode extension.


Sample CLI

gway release changes

References

Signature

(*, files=None, staged=False, context=3, max_bytes=200000, clip=False)

Docstring

Returns a unified diff of all recent textual changes in the git repo. - Shows added/removed lines (ignores binary files). - Includes unstaged (working directory) by default. Use staged=True to see only staged. - 'files': Optionally filter by path(s) or file glob(s). - 'context': Number of context lines in the diff (default 3). - 'max_bytes': Truncate diff if too large (default 200,000).

Sample CLI

gway release loc

References

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.

Sample CLI

gway screen lookup-font

Signature

(*prefix)

Docstring

Look up fonts installed on a Windows system by partial name (prefix). >> gway font lookup Ari

Sample CLI

gway screen notify

References

Signature

(message, *, title='GWAY Notice', timeout: int = 10)

Docstring

Show a user interface notification with the specified title and message. Falls back to a visible console printout if GUI notification fails.

Sample CLI

gway screen reminder

References

Signature

(message, *, interval: float = 20.0, daemon=False, lines: int = 2)

Docstring

Starts a thread that periodically takes screenshots. If the screen hasn't changed between intervals, overlays a reminder message and waits for user interaction before resuming.

Sample CLI

gway screen shot

References

Signature

(*, name: str = None, mode: str = 'full') -> str

Docstring

Take a screenshot in the specified mode and save it under: gw.resource("work", "screenshots") The filename will be: <active_window_name>_<YYYYMMDD_HHMMSS>.png Returns: The full path to the saved screenshot file. Modes: - "full": entire screen - "active"/"window": active window only (Windows only; falls back to full)

Sample CLI

gway sql close-connection

References

Signature

(datafile=None, *, sql_engine='sqlite', all=False)

Docstring

Explicitly close one or all cached database connections. Shuts down writer thread if all connections closed.

Sample CLI

gway sql load-csv

References

Signature

(*, connection=None, folder='data', force=False)

Docstring

Recursively loads CSVs from a folder into SQLite tables. Table names are derived from folder/file paths.

Sample CLI

gway sql shutdown-writer

Signature

()

Docstring

Signal writer thread to exit and wait for it to finish.

Sample CLI

gway vbox open-remote

References

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

References

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.

vbox · purge

Sample CLI

gway vbox purge

References

Signature

(*, all=False)

Docstring

Manually purge expired vbox entries and remove their folders. Args: all (bool): If True, delete all folders, even non-empty ones and those not in _open_boxes.

Sample CLI

gway vbox view-downloads

References

Signature

(*hashes: tuple[str], vbid: str = None, modified_since=None, **kwargs)

Docstring

GET: Show list of files in the box (with hash), allow selection/downloads. If a single hash is provided, return that file. Multiple hashes are not supported yet. - Allows access via full vbid (short.long) or short-only (just the folder name). - If full vbid is used, shows link to upload more files. - If modified_since is passed (as iso or epoch seconds), only send file if newer, else 304.

TODOs

# TODO: Support multiple hashes by checking them one by one. If the first doesn't exist, # try the next and so forth. Give up when every hash fails to match. First matches is chosen first.


Sample CLI

gway ocpp.csms authorize-balance

Signature

(**record)

Docstring

Default OCPP RFID secondary validator: Only authorize if balance >= 1. The RFID needs to exist already for this to be called in the first place.

Sample CLI

gway ocpp.csms extract-meter

Signature

(tx)

Docstring

Return the latest Energy.Active.Import.Register (kWh) from MeterValues or meterStop.

Sample CLI

gway ocpp.csms power-consumed

Signature

(tx)

Docstring

Calculate power consumed in kWh from transaction's meter values (Energy.Active.Import.Register).


Sample CLI

gway ocpp.csms view-charger-status

References

Signature

(*, action=None, charger_id=None, **_)

Docstring

Card-based OCPP dashboard: summary of all charger connections.

Sample CLI

gway ocpp.evcs parse-repeat

Signature

(repeat)

Docstring

Handle repeat=True/'forever'/n logic.

Sample CLI

gway ocpp.evcs simulate

References

Signature

(*, host: str = '[WEBSITE_HOST|127.0.0.1]', ws_port: int = '[WEBSOCKET_PORT|9000]', rfid: str =
'FFFFFFFF', cp_path: str = 'CPX', duration: int = 60, repeat=False, threads: int = None, daemon:
bool = True)

Docstring

Flexible OCPP charger simulator. - daemon=False: blocking, always returns after all runs. - daemon=True: returns a coroutine for orchestration, user is responsible for awaiting/cancelling. - threads: None/1 for one session; >1 to simulate multiple charge points.

Sample CLI

gway ocpp.evcs simulate-cp

Signature

(cp_idx, host, ws_port, rfid, cp_path, duration, session_count)

Docstring

Simulate a single CP session (possibly many times if session_count>1).

Sample CLI

gway ocpp.sink setup-sink-app

References

Signature

(*, app=None)

Docstring

Basic OCPP passive sink for messages, acting as a dummy CSMS server. This won't pass compliance or provide authentication. It just accepts and logs all. Note: This version of the app was tested at the EVCS with real EVs.


Sample CLI

gway web.app setup

References

Signature

(*, app=None, project='web.site', path=None, home: str = None, views: str = 'view', apis: str =
'api', static='static', shared='shared', css='global', js='global', auth_required=False,
engine='bottle')

Docstring

Setup Bottle web application with symmetrical static/shared public folders. Only one project per app. CSS/JS params are used as the only static includes.

Sample CLI

gway web.app urlencode

Signature

(query, doseq=False, safe='', encoding=None, errors=None, quote_via=<function quote_plus at
0x00000256EF81D940>)

Docstring

Encode a dict or sequence of two-element tuples into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output will match the order of parameters in the input. The components of a query arg may each be either a string or a bytes type. The safe, encoding, and errors parameters are passed down to the function specified by quote_via (encoding and errors only if a component is a str).


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.

Sample CLI

gway web.error view-debug-error

References

Signature

(*, title='GWAY Debug Error', message='An error occurred.', err=None, status=500, default=None)

Docstring

Render a debug error view with detailed traceback and request info.



Sample CLI

gway web.server is-local

References

Signature

(request=None, host=None)

Docstring

Returns True if the active HTTP request originates from the same machine that the server is running on (i.e., local request). Supports both Bottle and FastAPI (ASGI/WSGI). Args: request: Optionally, the request object (Bottle, Starlette, or FastAPI Request). host: Optionally, the bound host (for override or testing). Returns: bool: True if request is from localhost, else False.

Sample CLI

gway web.server iterable

Signature

(y)

Docstring

Check whether or not an object can be iterated over. Parameters ---------- y : object Input object. Returns ------- b : bool Return ``True`` if the object has an iterator method or is a sequence and ``False`` otherwise. Examples -------- >>> import numpy as np >>> np.iterable([1, 2, 3]) True >>> np.iterable(2) False Notes ----- In most cases, the results of ``np.iterable(obj)`` are consistent with ``isinstance(obj, collections.abc.Iterable)``. One notable exception is the treatment of 0-dimensional arrays:: >>> from collections.abc import Iterable >>> a = np.array(1.0) # 0-dimensional numpy array >>> isinstance(a, Iterable) True >>> np.iterable(a) False

Sample CLI

gway web.server start-app

References

Signature

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

Docstring

Start an HTTP (WSGI) or ASGI server to host the given application. - If `app` is a FastAPI instance, runs with Uvicorn (optionally on ws_port if set). - If `app` is a WSGI app, 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; FastAPI uses ws_port if set).




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"

Sample CLI

gway resource

References

Signature

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

Docstring

Locate or create a resource by searching in: 1. Current working directory 2. GWAY_ROOT environment variable 3. User home directory If not found, returns the path in the CWD (which may not exist) unless check=True, in which case aborts. Arguments: - touch: if True, create the file (and parents) if it does not exist. - dir: if True, create the final path as a directory, not a file. - text: if True, return file contents as text, not a Path. - check: if True, abort if resource does not exist.

TODOs

# TODO: Consider if we should also be compatible with BASE_PATH and GWAY_PATH # 2. GWAY_ROOT env

Sample CLI

gway run-recipe

References

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 shell

Signature

()

Docstring

Launch an interactive Python shell with 'from gway import gw' preloaded.