fino2py.times package
Submodules
fino2py.times.convert_fino_time module
- fino2py.times.convert_fino_time.convert_fino_time(fino_time: str) time[source]
Converts the string times produced by the Finometer to datime objects in the ‘%H:%M:%S.%f’ format.
Parameters:
- fino_timestr
The Finometer time in the format ‘%H:%M:%S.%f’
Returns:
- datetime.time
The time as a datetime.time object.
fino2py.times.convert_partial_time module
- fino2py.times.convert_partial_time.convert_partial_time(partial_time: str) time[source]
Convert the partial time in the format ‘09:02’ to a datetime.time object with 0 seconds.
Parameters:
- partial_timestr
The partial time in the format ‘09:02’
Returns:
- datetime.time
The time as a datetime.time object with 0 seconds.
fino2py.times.convert_timestamp_time module
- fino2py.times.convert_timestamp_time.convert_timestamp_time(timestamp_time: str) str[source]
Convert the timestamp string in the format ‘09:02:12’ to ‘%H:%M:%S’ datetime format.
Parameters:
- timestamp_timestr
The timestamp time in the format ‘09:02:12’
Returns:
- str
The time in the ‘%H:%M:%S’ format.
fino2py.times.import_protocol_times module
- fino2py.times.import_protocol_times.import_protocol_times(times_file_path: Path, add_seconds: bool = False, flatten_seconds: bool = False, save_csv: bool = False) pandas.DataFrame[source]
This function imports the protocol times from a .csv or excel file file and returns a cleaned pandas dataframe with the protocol times for each participant.
- Parameters:
times_file_path (pathlib.Path or str) – The path to the .csv/.xlsx file containing the protocol times.
add_seconds (bool, optional) – If True, seconds will be added to the time values (if missing).
flatten_seconds (bool, optional) – If True, seconds will be set to 00 for all time values.
save_csv (bool, optional) – If True, the imported data will be saved as a .csv file in the same folder as the .csv file.
- Raises:
TypeError: – If times_file_path is not a pathlib.Path object.
ValueError: – If times_file_path does not exist or is not a file. If times_file_path does not have a .csv extension. If add_seconds and flatten_seconds are both True. If the function is unable to add seconds to time values or set seconds to 00.
- Returns:
A cleaned pandas dataframe with the protocol times for each participant.
- Return type:
pandas.DataFrame