Skip to content

Instantly share code, notes, and snippets.

@alerezaaa
Last active April 12, 2024 05:42
Show Gist options
  • Save alerezaaa/000d99919d4416519850ca3b581dce74 to your computer and use it in GitHub Desktop.
Save alerezaaa/000d99919d4416519850ca3b581dce74 to your computer and use it in GitHub Desktop.
Transfer time entries from Clockify to Toggl Track
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)
@alerezaaa
Copy link
Author

alerezaaa commented Jan 19, 2024

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

python3 converter.py path/to/clockify_export.csv path/to/output.csv

Notes

  1. I've changed settings in Clockify to show "Categories" instead of "Clients", so if you did NOT do the same, remove 'Category': 'Client', from column_mapping

  2. 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)

  3. 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 DELETE Tasks column entirely because task is not available for free accounts on Toggl Track! (funny though)

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment