Skip to content

Commit 3ea66b0

Browse files
committed
feat(toggl): save resulting data as CSV
1 parent 19a0165 commit 3ea66b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

notebooks/toggl-to-harvest.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"import os\n",
1212
"from pathlib import Path\n",
1313
"import pandas as pd\n",
14+
"import re\n",
1415
"\n",
1516
"\n",
1617
"DATA_DIR = Path(\"./data\")\n",
@@ -173,6 +174,17 @@
173174
"source[\"Hours\"] = (source[\"Duration\"].dt.total_seconds()/3600).round(2)\n",
174175
"source.dtypes"
175176
]
177+
},
178+
{
179+
"cell_type": "code",
180+
"execution_count": null,
181+
"metadata": {},
182+
"outputs": [],
183+
"source": [
184+
"output_path = DATA_DIR / re.sub(r\"[Tt]oggl\", \"harvest\", DATA_SOURCE.name)\n",
185+
"output_columns = [\"Date\", \"Client\", \"Project\", \"Task\", \"Notes\", \"Hours\", \"First Name\", \"Last Name\"]\n",
186+
"source.to_csv(output_path, index=False, columns=output_columns)"
187+
]
176188
}
177189
],
178190
"metadata": {

0 commit comments

Comments
 (0)