geopathfinder package¶
Submodules¶
geopathfinder.file_naming module¶
-
class
geopathfinder.file_naming.
SmartFilename
(fields, fields_def, ext=None, pad='-', delimiter='_', convert=False)[source]¶ Bases:
object
SmartFilename class handles file names with pre-defined field names and field length.
-
classmethod
from_filename
(filename_str, fields_def, pad='-', delimiter='_', convert=False)[source]¶ Converts a filename given as a string into a SmartFilename class object.
Parameters: - filename_str (str) – Filename without any paths (e.g., “M20170725_test.tif”).
- fields_def (OrderedDict) –
- Name of fields (keys) in right order and length (values). It must contain:
- ”len”: int
- Length of filename part (must be given).
- ”start”: int, optional
- Start index of filename part (default is 0).
- ”delim”: str, optional
- Delimiter between this and the following filename part (default is the one from the parent class).
- ”pad”: str,
- Padding for filename part (default is the one from the parent class).
- pad (str, optional) – Padding symbol (default: ‘-‘).
- delimiter (str, optional) – Delimiter (default: ‘_’)
- convert (bool, optional) – If true, decoding is applied to parts of the filename, where such an operation is available (default is False).
Returns: Class representing a filename.
Return type:
-
classmethod
-
class
geopathfinder.file_naming.
SmartFilenamePart
(arg, start=0, length=None, delimiter='_', pad='-', decoder=None, encoder=None)[source]¶ Bases:
object
Represents a part of filename.
-
decoded
¶ Converts filename part to a decoded (object) representation.
Returns: Decoded (object) representation of a filename part. Return type: object
-