update readme and add tags

This commit is contained in:
3wc 2021-11-29 15:24:51 +02:00
parent acc3153fba
commit 4c8dd9de4d
2 changed files with 7 additions and 3 deletions

View File

@ -52,4 +52,7 @@ hamster](https://github.com/projecthamster/hamster-lib) is ready.
1. Run `hamster-tool activities list --csv` to get a dump of all activities
2. Review the export to check for any duplicates, typoes, etc.
3. Use e.g. `hamster-tool activities move-facts ...` to clean them up
4.
4. Run `python -m hamstertools kimai import --mapping-path mapping.kimai.csv --show-missing --after 2021-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 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
5. Run `python -m hamstertools kimai import --mapping-path mapping.kimai.csv --after 2021-09-07 --category-search auto 3wordchant -o kimai_$(date +%F).csv` to generate a CSV of your time entries
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.

View File

@ -496,6 +496,7 @@ def sync(username, api_key, just_errors, ignore_activities, mapping_path=None):
just_errors or click.secho("Found activity '{0}'".format(activity_str), fg='green')
found_activities.append(activity_str)
@kimai.command('import')
@click.option('--mapping-path', help='Mapping file (default ~/.local/share/hamster/mapping.kimai.csv)')
@click.option('--output', help='Output file (default kimai.csv)')
@ -521,7 +522,7 @@ def _import(username, mapping_path=None, output=None, category_search=None, afte
next(mapping_reader)
mapping = {
'{0}:{1}'.format(row[0], row[1]): [row[2], row[3], row[4]]
'{0}:{1}'.format(row[0], row[1]): [row[2], row[3], row[4], row[5]]
for row in mapping_reader
}
@ -618,7 +619,7 @@ def _import(username, mapping_path=None, output=None, category_search=None, afte
mapping_[2],
fact[3] or '',
'0', # Exported
'', # Tags
mapping_[3],
'', # Hourly rate
'', # Fixed rate
])