clocking
clocking
is a command line utility to help you manage your worked hours, vacation, projects or whatever you need to consider tracking time.
This project is WIP!
Testing
To test package before use it, follow this:
pip install -U pytest
git clone https://github.com/MatteoGuadrini/clocking.git
cd clocking
pytest tests
Usage
clocking
was born to be a python library that offers a command line utility.
As a command line
Use the command line to track and take daily hours worked on projects or not.
$ clocking -h
usage: clocking [-h] [-v] [-V] [-d FILE] {config,cfg,c,set,st,s,delete,del,d,print,prt,p} ...
tracking or monitoring worked hours
positional arguments:
{config,cfg,c,set,st,s,delete,del,d,print,prt,p}
commands to run
config (cfg, c) default's configuration
set (st, s) setting values
delete (del, d) remove values
print (prt, p) print values
options:
-h, --help show this help message and exit
-v, --verbose enable verbosity (default: False)
-V, --version print version
-d FILE, --database FILE
select database file (default: None)
As a python module
All useful functions to create scripts or software to track time on projects or days worked, are found in the core module: clocking.core
I create a simple script that tracks hours worked daily.
from sys import argv
from clocking.core import *
mydb = 'mydb.db'
user = 'myuser'
# Create configuration if not was created
if not get_current_configuration(mydb, user):
# Update version
update_version(mydb)
# Create default configuration
create_configuration_table(mydb)
add_configuration(mydb,
active=True,
user=user,
location='Italy Office',
empty_value='not work!',
daily_hours=8.0,
working_days="Mon Tue Wed Thu Fri",
extraordinary=0.5,
permit_hours=1.0,
disease='disease',
holiday='holiday',
currency='€',
hour_reward=7.5,
extraordinary_reward=8.5,
food_ticket=0,
other_hours=0,
other_reward=8.0
)
enable_configuration(mydb, row_id=1)
# Prepare table for insert hours
create_working_hours_table(mydb, user)
# Insert daily hours...
insert_working_hours(mydb, user, argv[1])
# ...and print it!
print_working_table(get_working_hours(mydb, user))
Open source
clocking is an open source project. Any contribute, It's welcome.
A great thanks.
For donations, press this
For me
For Telethon
The Telethon Foundation is a non-profit organization recognized by the Ministry of University and Scientific and Technological Research. They were born in 1990 to respond to the appeal of patients suffering from rare diseases. Come today, we are organized to dare to listen to them and answers, every day of the year.
Treeware
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
Acknowledgments
Thanks to Mark Lutz for writing the Learning Python and Programming Python books that make up my python foundation.
Thanks to Kenneth Reitz and Tanya Schlusser for writing the The Hitchhiker’s Guide to Python books.
Thanks to Dane Hillard for writing the Practices of the Python Pro books.
Special thanks go to my wife, who understood the hours of absence for this development. Thanks to my children, for the daily inspiration they give me and to make me realize, that life must be simple.
Thanks Python!