mrpt.system
Package Contents
- class mrpt.system.CTicTac
C++ API: class mrpt::system::CTicTac
- Tac() float
Stop the stopwatch and return the elapsed time in seconds
- Tic() None
Start or restart the stopwatch
- class mrpt.system.CTimeLogger(enabled: bool = True, name: str = '', keep_whole_history: bool = False)
C++ API: class mrpt::system::CTimeLogger
- clear(deep_clear: bool = False) None
- disable() None
- dumpAllStats(column_width: int = 80) None
- enable(enabled: bool = True) None
- enableKeepWholeHistory(enable: bool = True) None
- enter(section_name: str) None
Start a named section (time measurement)
- getLastTime(section_name: str) float
Return last execution time of a section
- getMeanTime(section_name: str) float
Return mean execution time of a section
- getName() str
- getStatsAsText(column_width: int = 80) str
- isEnabled() bool
- isEnabledKeepWholeHistory() bool
- leave(section_name: str) float
End a named section and return elapsed time in seconds
- saveToCSVFile(csv_file: str) None
- saveToMFile(m_file: str) None
- setName(name: str) None
- class mrpt.system.CTimeLoggerEntry(logger: CTimeLogger, section_name: str)
C++ API: struct mrpt::system::CTimeLoggerEntry
- stop() None
- class mrpt.system.CTimeLoggerSaveAtDtor(logger: CTimeLogger)
- class mrpt.system.TTimeParts
C++ API: struct mrpt::system::TTimeParts
Broken-down date/time representation (UTC or local)
- day: int
- day_of_week: int
- hour: int
- minute: int
- month: int
- second: float
- year: int
- mrpt.system.buildTimestampFromParts(parts: TTimeParts) datetime.timedelta
Build a TTimeStamp (UTC) from a TTimeParts struct
- mrpt.system.buildTimestampFromPartsLocalTime(parts: TTimeParts) datetime.timedelta
Build a TTimeStamp (local time) from a TTimeParts struct
- mrpt.system.compute_CRC16(data: list[int], gen_pol: int = 32773) int
- mrpt.system.compute_CRC16(data: bytes, gen_pol: int = 32773) int
Compute CRC16 checksum from raw bytes
- mrpt.system.compute_CRC32(data: list[int], gen_pol: int = 3988292384) int
- mrpt.system.compute_CRC32(data: bytes, gen_pol: int = 3988292384) int
Compute CRC32 checksum from raw bytes
- mrpt.system.createDirectory(dirName: str) bool
Creates a directory. Returns true on success
- mrpt.system.dateTimeLocalToString(t: datetime.timedelta) str
Converts a timestamp to a human-readable local date-time string
- mrpt.system.dateTimeToString(t: datetime.timedelta) str
Converts a timestamp to a human-readable UTC date-time string
- mrpt.system.dateToString(t: datetime.timedelta) str
Converts a timestamp to a date-only string (UTC)
- mrpt.system.decodeBase64(input: str) bytes
Decode a Base64 string into raw bytes
- mrpt.system.deleteFile(fileName: str) bool
Deletes a file. Returns true on success
- mrpt.system.directoryExists(dirName: str) bool
Returns true if the directory exists
- mrpt.system.encodeBase64(input: bytes) str
Encode a bytes-like object into a Base64 string
- mrpt.system.extractFileDirectory(filePath: str) str
Extracts the directory part of a full file path
- mrpt.system.extractFileExtension(filePath: str, ignore_gz: bool = False) str
Extracts the file extension (without the dot)
- mrpt.system.extractFileName(filePath: str) str
Extracts just the filename from a full path (no extension, no directory)
- mrpt.system.fileExists(fileName: str) bool
Returns true if the file exists on disk
- mrpt.system.fileNameChangeExtension(filename: str, newExtension: str) str
Returns the filename with the extension changed
- mrpt.system.fileNameStripInvalidChars(filename: str, replace_with: str = '_') str
Replaces characters not valid for a filename with a replacement char
- mrpt.system.filePathSeparatorsToNative(filePath: str) str
Converts path separators to the native format
- mrpt.system.formatTimeInterval(timeSeconds: float) str
Formats a time interval (seconds) as a human-readable string (e.g. ‘1h 23m 45s’)
- mrpt.system.getFileSize(fileName: str) int
Returns the size of a file in bytes
- mrpt.system.getTempFileName() str
Returns the name of a proposed temporary file
- mrpt.system.getcwd() str
Returns the current working directory
- mrpt.system.global_profiler_enter(func_name: str) None
- mrpt.system.global_profiler_getref() CTimeLogger
- mrpt.system.global_profiler_leave(func_name: str) None
- mrpt.system.intervalFormat(seconds: float) str
Format a time interval in seconds to a string
- mrpt.system.pathJoin(parts: list[str]) str
Joins path components, mirroring Python’s os.path.join semantics
- mrpt.system.renameFile(oldFileName: str, newFileName: str) bool
Renames a file. Returns true on success
- mrpt.system.timeDifference(t_first: datetime.timedelta, t_later: datetime.timedelta) float
Returns the difference in seconds (t_later - t_first)
- mrpt.system.timeLocalToString(t: datetime.timedelta, secondFractionDigits: int = 6) str
Converts a timestamp to a local time-only string
- mrpt.system.timeToString(t: datetime.timedelta) str
Converts a timestamp to a time-only string (UTC)
- mrpt.system.timestampAdd(t: datetime.timedelta, num_seconds: float) datetime.timedelta
Adds a number of seconds to a timestamp
- mrpt.system.timestampToParts(t: datetime.timedelta, localTime: bool = False) TTimeParts
Decomposes a TTimeStamp into a TTimeParts struct (UTC by default)
- mrpt.system.toAbsolutePath(path: str, resolveToCanonical: bool = False) str
Converts a relative path to absolute, optionally resolving symlinks
- mrpt.system.unitsFormat(val: float, nDecimalDigits: int = 2, middle_space: bool = True) str
Format a value with SI metric unit prefixes (e.g., 1e3 -> ‘1.00 K’)