kme files¶
createKme()¶
-
canlib.kvmlib.
createKme
(path, filetype=<FileType.KME50: 3>)[source]¶ Create a KME file on the host computer
Parameters: - path (
str
) – The full filepath for the .KME file (e.g."data/mylog.kme50"
). - filetype (
canlib.kvmlib.FileType
) – The KME file type
Returns: New in version 1.7.
- path (
openKme()¶
-
canlib.kvmlib.
openKme
(path, filetype=<FileType.KME50: 3>)[source]¶ Open a KME file on the host computer
Parameters: - path (
str
) – The full filepath for the .KME file (e.g."data/mylog.kme50"
). - filetype (
canlib.kvmlib.FileType
) – The KME file type
Returns: New in version 1.7.
- path (
Kme¶
-
class
canlib.kvmlib.
Kme
(handle)[source]¶ A kme file
A class representing a KME file. The main use is twofold:
Either we create a KME file using
canlib.kvmlib.createKme
and would like to write events usingcanlib.kvmlib.Kme.write_event
:with kvmlib.createKme('out/data.kme50') as kme: ... kme.write_event(my_logevent)
Or we read events from an existing KME file:
with kvmlib.openKme('in/data.kme50') as kme: event = kme.read_event() ... print(event)
Note that only KME files of type KME50 may currently be written to.
New in version 1.7.
-
estimate_events
[source]¶ Estimate how many events the KME file contains
- Returns:
int
: Approximate number of events in KME file.
New in version 1.7.
Deprecated since version 1.11.
-
event_count_estimation
()[source]¶ Returns an approximation of the number of events contained in the KME file.
- Returns:
int
: Approximate number of events in KME file.
New in version 1.11.
-
kme_file_type()¶
-
canlib.kvmlib.
kme_file_type
(path)[source]¶ Scan KME file and report version
Open and read the file
path
and try to decode what version of KME it contains. Returns type as kvmFILE_xxx.Parameters: path ( str
) – The full filepath for the .KME file (e.g."data/mylog.kme"
).Returns: canlib.kvmlib.FileType
– The KME file typeNew in version 1.7.