||1 week ago|
|hamstertools||1 week ago|
|.gitignore||8 months ago|
|README.md||1 week ago|
|setup.py||3 months ago|
Manipulate hamster-time-tracker data from the command-line, including:
- find duplicate activities
- list, move and delete categories, activities and facts
Merging, renaming and otherwise tidying-up the database used to be possible, but currently (as of version 220.127.116.11) doesn't work for me, so I wrote this script to fill in the gap until the shiny new version of hamster is ready.
$ pip install . $ hamster-tools categories --help Usage: hamster-tools categories [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: activities Show activities for categories specified by IDS delete Delete categories specified by IDS list List / search categories $ hamster-tools activities Usage: hamster-tools activities [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: delete Delete activities specified by IDS find-duplicates Show activities which are not unique in their categories list List / search activities list-facts Show facts for activities move Move activities to another category move-facts Move facts from one activity to another $ hamster-tools export Usage: hamster-tools export [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: kimai Export time tracking data in Kimai format
Importing into Kimai
hamster-tool activities list --csvto get a dump of all activities
- Review the export to check for any duplicates, typoes, etc.
- Use e.g.
hamster-tool activities move-facts ...to clean them up
python -m hamstertools kimai import --mapping-path mapping.kimai.csv --show-missing --after 2021-09-07 --category-search auto 3wordchantto find entries in your time tracking which don't yet have a mapping to Kimai. You might notice some extra tidying needed here.
python -m hamstertools kimai sync --mapping-path mapping.kimai.csv --just-errors --ignore-activities 3wordchant $(pass users/calix/logins/kimai.autonomic.zone/api)to find items in your mapping file which don't exist on Kimai
python -m hamstertools kimai import --mapping-path mapping.kimai.csv --after 2021-09-07 --category-search auto 3wordchant -o kimai_$(date +%F).csvto generate a CSV of your time entries
- Review your timesheet -- NB it might not be sorted in date order by default - to make sure it has the expected entries, and remove any entries already in Kimai.