Sample CLI
gway awg find-cable
References
['debug', 'info', 'sql', 'sql.open_connection']
Signature
(*, meters: Union[int, str, NoneType] = None, amps: Union[int, str] = '40', volts: Union[int, str] =
'220', material: Literal['cu', 'al', '?'] = 'cu', max_lines: Union[int, str] = '1', phases:
Literal['1', '3', 1, 3] = '1', conduit: Union[str, bool, NoneType] = None, neutral: Union[int, str]
= '1')
Docstring
Calculate the type of cable needed for an electrical system.
Sample CLI
gway awg find-conduit
References
['sql', 'sql.open_connection']
Signature
(awg, cables, *, conduit='emt')
Docstring
Calculate the kind of conduit required for a set of cables.
Sample CLI
gway release build-help-db
References
['_builtins', '_builtins.items', 'load_project', 'sql', 'sql.open_connection', 'warning']
Sample CLI
gway sql close-connection
References
['info', 'warning']
Signature
(datafile=None, *, sql_engine='sqlite', all=False)
Docstring
Explicitly close one or all cached database connections.
Sample CLI
gway sql execute
References
['info', 'resource']
Signature
(*sql, connection=None, script=None, into=None)
Docstring
Execute SQL code or a script resource. If both are given, run script first.
Returns dict with 'data' (rows, if any) and 'sql' (last statement run).
TODOs
# TODO: Implement "into" as a function or the name of a function we can get with
# gw[into] if so, for each row we execute in a select, we pass the extracted data as
# kwargs by name to the function, then replace row with the result.
Sample CLI
gway sql load-csv
References
['debug', 'info', 'resource', 'warning']
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 open-connection
References
['debug', 'info', 'resource', 'warning']
Signature
(datafile=None, *, sql_engine='sqlite', autoload=False, force=False, row_factory=False, **dbopts)
Docstring
Initialize or reuse a database connection.
Caches connections by sql_engine, file path, and thread ID (if required).
References
['info', 'release', 'release.build_help_db', 'resource', 'sql', 'sql.open_connection', 'warning']
Signature
(*args, full=False)