Reader class overview
Bases: ABC
An abstract base for all Reader types, each subclass of this implements
reader functionality for a particular dataset type.
Each subclass must define the attribute referred to by
Source code in dsprofile/lib/reader.py
__init_subclass__(**kwargs)
Derived types are validated to ensure they provide the attr
identified by
Source code in dsprofile/lib/reader.py
build_subparser(sp)
abstractmethod
classmethod
Receives an argparse subparser argument
handle_args(args)
abstractmethod
classmethod
Translates its argparse
- A list (or other
Sequence) of positional arguments - A dict with str keys containing keyword arguments
These are subsequently passed to the type's constructor to create an instance.
Source code in dsprofile/lib/reader.py
process()
abstractmethod
Processes the dataset and returns a type-specific dict containing the resulting metadata profile.
Utilities
make_reader(args)
- Receives an argparse
argument containing command-line arguments - Identifies the subtype required using the
attr which must match an entry in the reader_type_map - Translates the argparse arguments into the specific form required by the constructor for the type identified in (2) above
- Returns an instance of that type constructed using these arguments