Commit 3b4b6f0 1 parent b8f256f commit 3b4b6f0 Copy full SHA for 3b4b6f0
File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Load ActivityWatch data into a dataframe, and export as CSV.
3
3
"""
4
-
5
4
from datetime import datetime , timedelta , timezone
6
5
6
+ import iso8601
7
7
import pandas as pd
8
-
9
8
from aw_client import ActivityWatchClient
10
- from aw_client .queries import canonicalEvents , DesktopQueryParams
11
9
from aw_client .classes import default_classes
10
+ from aw_client .queries import DesktopQueryParams , canonicalEvents
12
11
13
12
14
13
def build_query () -> str :
@@ -47,7 +46,7 @@ def main() -> None:
47
46
e ["$category" ] = " > " .join (e ["$category" ])
48
47
49
48
df = pd .json_normalize (events )
50
- df ["timestamp" ] = pd .to_datetime (df ["timestamp" ], infer_datetime_format = True )
49
+ df ["timestamp" ] = pd .to_datetime (df ["timestamp" ]. apply ( iso8601 . parse_date ) )
51
50
df .set_index ("timestamp" , inplace = True )
52
51
53
52
print (df )
You can’t perform that action at this time.
0 commit comments