diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e09338 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/hamster_tools.egg-info/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9fa84f3 --- /dev/null +++ b/README.md @@ -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 diff --git a/hamster-tools.py b/hamstertools/__init__.py similarity index 99% rename from hamster-tools.py rename to hamstertools/__init__.py index cce23fb..183809a 100755 --- a/hamster-tools.py +++ b/hamstertools/__init__.py @@ -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() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..89b7d40 --- /dev/null +++ b/setup.py @@ -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 + ''', +)