pyline package¶
Submodules¶
pyline.pyline module¶
- class pyline.pyline.PylineResult[source]¶
Bases: pyline.pyline.Result
- class pyline.pyline.Result¶
Bases: tuple
Result(n, result)
- __getnewargs__()¶
Return self as a plain tuple. Used by copy and pickle.
- __getstate__()¶
Exclude the OrderedDict from pickling
- __repr__()¶
Return a nicely formatted representation string
- n¶
Alias for field number 0
- result¶
Alias for field number 1
- class pyline.pyline.ResultWriter(_output, *args, **kwargs)[source]¶
Bases: object
- OUTPUT_FILETYPES = {'csv': ',', 'checkbox': True, 'json': True, 'html': True, 'tsv': '\t', 'txt': True}¶
- filetype = None¶
- class pyline.pyline.ResultWriter_checkbox(_output, *args, **kwargs)[source]¶
Bases: pyline.pyline.ResultWriter
- filetype = 'checkbox'¶
- class pyline.pyline.ResultWriter_csv(_output, *args, **kwargs)[source]¶
Bases: pyline.pyline.ResultWriter
- filetype = 'csv'¶
- class pyline.pyline.ResultWriter_html(_output, *args, **kwargs)[source]¶
Bases: pyline.pyline.ResultWriter
- filetype = 'html'¶
- class pyline.pyline.ResultWriter_json(_output, *args, **kwargs)[source]¶
Bases: pyline.pyline.ResultWriter
- filetype = 'json'¶
- write_numbered(obj)¶
- class pyline.pyline.ResultWriter_txt(_output, *args, **kwargs)[source]¶
Bases: pyline.pyline.ResultWriter
- filetype = 'txt'¶
- pyline.pyline.itemgetter_default(args, default=None)[source]¶
Return a callable object that fetches the given item(s) from its operand, or the specified default value.
Similar to operator.itemgetter except returns default when the index does not exist
- pyline.pyline.pyline(iterable, cmd=None, modules=, []regex=None, regex_options=None, path_tools=False, idelim=None, odelim='\t', **kwargs)[source]¶
Pyline: process an iterable
Parameters: - iterable (iterable) – iterable of strings (e.g. sys.stdin or a file)
- cmd (str) – python command string
- modules ([str]) – list of modules to import
- regex (str) – regex pattern to match (with groups)
- regex_options (TODO) – Regex options: I L M S X U (see pydoc re)
- path_tools (bool) – try to cast each line to a file
- idelim (str) – input delimiter
- odelim (str) – output delimiter
Returns: iterable of PylineResult namedtuples