hamster-tools/README.md

60 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

2021-09-07 21:51:01 +00:00
# hamster-tools
2020-09-21 18:17:59 +00:00
Manipulate [hamster-time-tracker](https://github.com/projecthamster/) data
from the command-line, including:
- find duplicate activities
- list, move and delete categories, activities and facts
2022-11-12 03:26:38 +00:00
Merging, renaming and otherwise tidying-up the database used to be possible in
the Hamster GUI, but currently (as of version 2.0.0.16) doesn't work for me, so
I wrote this script to fill in the gap until the [shiny new version of
2020-09-21 18:17:59 +00:00
hamster](https://github.com/projecthamster/hamster-lib) is ready.
2020-09-30 18:53:39 +00:00
$ pip install .
2020-09-21 18:17:59 +00:00
2020-09-30 18:49:55 +00:00
$ hamster-tools categories --help
2020-09-30 18:53:39 +00:00
Usage: hamster-tools categories [OPTIONS] COMMAND [ARGS]...
2020-09-21 18:17:59 +00:00
2020-09-30 18:49:55 +00:00
Options:
2020-09-30 18:53:39 +00:00
--help Show this message and exit.
2020-09-21 18:17:59 +00:00
2020-09-30 18:49:55 +00:00
Commands:
2020-09-30 18:53:39 +00:00
activities Show activities for categories specified by IDS
delete Delete categories specified by IDS
list List / search categories
2022-11-12 03:26:38 +00:00
tidy Delete empty categories
2020-09-21 18:17:59 +00:00
2022-11-12 03:26:38 +00:00
$ hamster-tools activities --help
2020-09-30 18:53:39 +00:00
Usage: hamster-tools activities [OPTIONS] COMMAND [ARGS]...
2020-09-21 18:17:59 +00:00
2020-09-30 18:49:55 +00:00
Options:
2020-09-30 18:53:39 +00:00
--help Show this message and exit.
2020-09-21 18:17:59 +00:00
2020-09-30 18:49:55 +00:00
Commands:
2020-09-30 18:53:39 +00:00
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
2021-09-07 21:51:01 +00:00
## Importing into Kimai
2023-01-13 00:34:51 +00:00
1. Run `python -m hamstertools activities list --csv` to get a dump of all activities
2021-09-07 21:51:01 +00:00
2. Review the export to check for any duplicates, typoes, etc.
2023-01-13 00:34:51 +00:00
3. Use e.g. `python -m hamstertools activities move-facts ...` to clean them up
2023-07-08 12:13:07 +00:00
4. Run `python -m hamstertools kimai import --mapping-path data/mapping.2023.kimai.csv --show-missing --after 2023-09-07 --category-search auto 3wordchant` to find entries in your time tracking which don't yet have a mapping to Kimai. You might notice some extra tidying needed here.
5. Run `python -m hamstertools kimai sync --mapping-path data/mapping.2023.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
5. Run `python -m hamstertools kimai import --mapping-path data/mapping.2023.kimai.csv --after 2023-09-07 --category-search auto 3wordchant --output data/kimai_$(date +%F).csv` to generate a CSV of your time entries
2021-11-29 13:24:51 +00:00
6. 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.