Reorganise

This commit is contained in:
3wc 2020-09-21 20:17:59 +02:00
parent d03ab17079
commit 1fd66175a2
4 changed files with 73 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/hamster_tools.egg-info/

40
README.md Normal file
View File

@ -0,0 +1,40 @@
hamster-tools
------------
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
Merging, renaming and otherwise tidying-up the database used to be possible, 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
hamster](https://github.com/projecthamster/hamster-lib) is ready.
$ pip install ..
$ hamster-tools categories --help
Usage: hamstertools 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: hamstertools 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

View File

@ -182,6 +182,7 @@ def delete_activities(ids):
click.secho('Deleted {0} activities'.format(len(ids)), fg='green')
@activities.command()
@click.argument('category_id')
@click.argument('ids', nargs=-1)
@ -319,5 +320,10 @@ def find_duplicates():
click.secho('@{0[0]}: {0[1]} » @{0[2]}: {0[3]} ({0[4]})'.format(r), fg='blue')
@cli.command()
def hamster():
click.echo('🐹')
if __name__ == "__main__":
cli()

26
setup.py Normal file
View File

@ -0,0 +1,26 @@
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="hamster-tools", # Replace with your own username
version="0.0.1",
author="Carl van Tonder",
author_email="carl@supervacuo.com",
description="Manage hamster-time-tracker data",
long_description=long_description,
long_description_content_type="text/markdown",
url="",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
entry_points='''
[console_scripts]
hamster-tools=hamstertools:cli
''',
)