Last active
April 12, 2024 05:42
-
-
Save alerezaaa/000d99919d4416519850ca3b581dce74 to your computer and use it in GitHub Desktop.
Transfer time entries from Clockify to Toggl Track
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from sys import argv | |
input_csv_path = argv[1] | |
df = pd.read_csv(input_csv_path) | |
## Create column mapping dictionary | |
column_mapping = {'Category': 'Client', ## <- if you have not changed settings in Clockify, remove this entry | |
'Duration (h)': 'Duration', | |
'Start Date': 'Start date', | |
'Start Time': 'Start time', | |
'End Date': 'End date', | |
'End Time': 'End time', | |
'Billable Amount (USD)': 'Amount (USD)' | |
} | |
## Rename columns | |
df.rename(columns=column_mapping, inplace=True) | |
## Remove columns based on their names | |
columns_to_remove = ['Group', 'Billable Rate (USD)', 'Duration (decimal)'] | |
df.drop(columns=columns_to_remove, inplace=True, errors='ignore') | |
## Write to a new CSV file | |
output_csv_path = argv[2] | |
df.to_csv(output_csv_path, index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Transfer time entries from Clockify to Toggl Track using Export/Import
Using this code, You can transfer your time entries from Clockify to Toggl Track using Export and Import functionality of these tools
Usage
Notes
I've changed settings in Clockify to show "Categories" instead of "Clients", so if you did NOT do the same, remove
'Category': 'Client',
fromcolumn_mapping
My display format in Clockify set to "YYYY-MM-DD", change yours to this or you will encounter an error while importing to Toggl Track (Toggl Track format in my setting, set to "DD/MM/YYYY" which is not important as I tested)
If you on Toggl Track FREE plan, open
output.csv
(using Numbers on Mac or Excel on Windows or any similar app on Linux 😉) and DELETETasks
column entirely because task is not available for free accounts on Toggl Track! (funny though)Good luck