hsg.utils
Writers
hsg.utils.writers
CsvWriter(headers)
Bases: Writer
TSV writer (tab-delimited CSV to stdout).
Source code in hsg/utils/writers.py
26 27 28 | |
JsonWriter(keys)
Bases: Writer
JSON-lines writer (one JSON object per row, or a JSON array for writerows).
Source code in hsg/utils/writers.py
42 43 | |
TabulateWriter(headers)
Bases: Writer
Pretty-printed table writer using the tabulate library.
Source code in hsg/utils/writers.py
57 58 | |
Writer
ABC for output writers (CSV, JSON, tabulate).
writerow(rowdata)
abstractmethod
Write a single row.
Source code in hsg/utils/writers.py
14 15 16 | |
writerows(data)
abstractmethod
Write multiple rows with headers.
Source code in hsg/utils/writers.py
18 19 20 | |
validate_fields(ctx, param, fields)
Click callback that validates requested output field names against the known set.
Source code in hsg/utils/writers.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
I/O
hsg.utils.io
get_input(text, file)
Gets input from argument, then stdin, then clipboard.
Source code in hsg/utils/io.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
Constants
hsg.utils.constants
Logging
hsg.logging_setup
configure_logging(level='warning')
Configure root logger with the given level name.
Source code in hsg/logging_setup.py
11 12 13 14 15 16 | |
get_logger(name)
Return a logger for the given module name.
Source code in hsg/logging_setup.py
19 20 21 | |