grepros 1.3.0
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
CsvSink Class Reference
Inheritance diagram for CsvSink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, **kwargs)
 
 close (self)
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 
 validate (self)
 
- Public Member Functions inherited from Sink
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 autodetect (cls, target)
 
 bind (self, source)
 
 configure (self, args=None, **kwargs)
 
 emit_meta (self)
 
 flush (self)
 
 is_highlighting (self)
 
 thread_excepthook (self, text, exc)
 

Public Attributes

 close
 
 valid
 
- Public Attributes inherited from Sink
 args
 
 source
 inputs.Source instance bound to this sink
 
 valid
 Result of validate()
 

Static Public Attributes

 DEFAULT_ARGS = dict(EMIT_FIELD=(), META=False, NOEMIT_FIELD=(), WRITE_OPTIONS={}, VERBOSE=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = (".csv", )
 Auto-detection file extensions.
 
- Static Public Attributes inherited from Sink
 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", )
 

Detailed Description

Writes messages to CSV files, each topic to a separate file.

Definition at line 29 of file csv.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
**  kwargs 
)
@param   args                 arguments as namespace or dictionary, case-insensitive;
                              or a single path as the base name of CSV files to write
@param   args.emit_field      message fields to emit in output if not all
@param   args.noemit_field    message fields to skip in output
@param   args.write           base name of CSV files to write,
                              will add topic name like "name.__my__topic.csv" for "/my/topic",
                              will add counter like "name.__my__topic.2.csv" if exists
@param   args.write_options   {"overwrite": whether to overwrite existing files
                                            (default false)}
@param   args.meta            whether to emit metainfo
@param   args.verbose         whether to emit debug information
@param   kwargs               any and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 38 of file csv.py.

Member Function Documentation

◆ close()

close (   self)
Closes output file(s), if any.

Reimplemented from Sink.

Definition at line 94 of file csv.py.

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Writes message to output file.

Reimplemented from Sink.

Definition at line 68 of file csv.py.

◆ validate()

validate (   self)
Returns whether arguments and overwrite option are valid, and file base is writable.

Reimplemented from Sink.

Definition at line 78 of file csv.py.

Member Data Documentation

◆ close

close

Definition at line 66 of file csv.py.

◆ DEFAULT_ARGS

DEFAULT_ARGS = dict(EMIT_FIELD=(), META=False, NOEMIT_FIELD=(), WRITE_OPTIONS={}, VERBOSE=False)
static

Constructor argument defaults.

Definition at line 36 of file csv.py.

◆ FILE_EXTENSIONS

tuple FILE_EXTENSIONS = (".csv", )
static

Auto-detection file extensions.

Definition at line 33 of file csv.py.

◆ valid

valid

Definition at line 89 of file csv.py.


The documentation for this class was generated from the following file: