A Cascade of Notebooks

epc

basic dict-based config with optional encrypted string for sensitive data

Contents:

basic dict-based config with optional encrypted string for sensitive data

epc.cmd_from_template(template: str, conf_args: dict, print_cmd=False, run_cmd=False)str

uses api_templates[template](conf) to get an executable command using stored conf: conf=decode(c[epc])[key_name]

epc.config_dict(cxtern: dict)dict

local variables via optional Colab form into config

epc.decode(encrypted_string: str, label: str = '')dict

decodes an AES passphrase-encrypted JSON string into a dict

epc.do_setup(config: dict)dict

convenience method, combines config_dict(c) (uses path_logic(c)), Google Drive mount (if True), and n make_request() from c[resources]; will run os.system(cmd) on any c[setup_commands]

epc.encode(decoded: dict, label: str = '')str

convert dict to JSON and AES encode with a passphrase

epc.exclamation(args: list)

takes str or list, approximation of !command syntax for .py exports

epc.get_epcw(label='')

the most basic pass input “system”, set get_epcw=your_preference()

epc.get_input_prompt(key_name: str, name: str, field: str, is_masked: bool, default)str

text prompt for input() based on context

epc.get_letter_options(options: dict)str

turns a list, of, options into a [l]ist, [o]f, [o]ptions

epc.get_logger(logger_name: str, logger_level: int = 10)

named loggers for notebooks

epc.get_token(key_name: str)str

primitve token fetch

epc.get_user_config_input(name: str, decoded: dict)dict

uses global api_fields[name] to loop over fields and get input() for vals

epc.make_request(key_name: str, additional_args: Optional[dict] = None, template: str = '')str

wrapper around cmd_from_template to catch and add missing data; recovery from missing key_name via update_epc()

epc.path_free(resource: str, config: Optional[dict] = None)bool

basic isdir/isfile checking, will use global c if config not passed, also useful with do_setup if encrypted key_name is a path relative to projects_dir

epc.path_logic(xconf: dict)dict

sets up paths in config; system environment vars > xconf > defaults active_project precidence: xconf > first xconf[‘resources’] > path_templates

epc.redact_output(text: str, fields: dict)str

replace output from hidden_fields list with <REDACTED>

epc.update_epc(epc=None)dict

work with epc; accepts None, dict, or an encrypted string :returns decrypted dict

Indices and tables