# `clocking`
`clocking` is a command line utility to help you manage your worked hours, vacation, projects or whatever you need to
consider tracking time.
## Testing
[![CircleCI](https://circleci.com/gh/MatteoGuadrini/clocking.svg?style=svg)](https://circleci.com/gh/MatteoGuadrini/clocking)
To test package before use it, follow this:
```commandline
pip install -U pytest
git clone https://github.com/MatteoGuadrini/clocking.git
cd clocking
pytest tests
```
## Installing
To install package, follow below.
With `pip`:
```commandline
pip install clocking
```
With `git`:
```commandline
git clone https://github.com/MatteoGuadrini/clocking.git
cd clocking
pip install .
```
## Usage
`clocking` was born to be a python library that offers a command line utility.
For more information, see the official documentation on [ReadTheDocs](https://clocking.readthedocs.io/en/latest/).
### As a command line
Use the command line to track and take daily hours worked on projects or not.
```console
$ clocking -h
usage: clocking [-h] {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
```
### Configuration
`clocking` uses configurations to apply automatically determine information when insert data into database; these
configurations to creates in command line through `config` section.
```console
# Create configuration
$> clocking config --daily-hours 8 --hour-reward 10 --extraordinary-reward 12 --location "Milan Office" --currency €
# Print configuration
$> clocking config --print
...
# Enable/load configuration
$> clocking config --select-id 1
# Or all in one
$> clocking config --daily-hours 8 --hour-reward 10 --extraordinary-reward 12 --location "Milan Office" --currency € --select-id 1 --print
```
Use `config` action also to delete or clean configurations:
```console
# Delete configuration
$> clocking config --delete-id 1
# Clean all configurations
$> clocking config --reset
```
### Setting
`clocking` uses set mode to insert data into own database; insert data in command line through `set` section.
```console
# Set current working day
$> clocking set --hours 8
# Set other working day
$> clocking set --hours 9.5 --date '11/25/2022'
# Set disease
$> clocking set --disease
# Set holiday
$> clocking set --holiday
# Set custom value
$> clocking set --custom 'Today I not work! I play guitar!'
# Set custom day value: this month, this year but first day
$> clocking set --hours 8 --day 1
# Set custom month value: this day, this year but month november
$> clocking set --hours 8 --month 11
# Set custom year value: this day, this month but year 2022
$> clocking set --hours 8 --year 2021
# Set extraordinary hours
$> clocking set --hours 8 --extraordinary 1
# Set permit hours
$> clocking set --hours 7 --permit 1
# Set other hours
$> clocking set --hours 8 --other 0.5
# Set location
$> clocking set --hours 8 --location 'Milan Office, p.za Duomo'
# Set description
$> clocking set --hours 8 --description 'Project: #1'
# Set all
$> clocking set --hours 8 --day 5 --month 5 --year 2019 --location 'Milan Office' \
--description 'Study Programming Python' --extraordinary 1 --other 1
# Reset a day, without prompt
$> clocking set --date '10/09/2023' --reset --force
# Delete a day, without prompt
$> clocking set --date '10/09/2023' --remove --force
```
### Deleting
`clocking` uses delete mode to delete data from own database; delete data in command line through `delete` section.
```console
# Delete working first day of month
$> clocking delete --day 1
Delete day.
To continue? [y/N]
# Delete working first day of month, without prompt
$> clocking delete --day 1 --force
# Delete precise date, without prompt
$> clocking delete --date 2/2/2021 --force
# Delete whole month (current year), without prompt
$> clocking delete --month 11 --force
# Delete whole year 2022, without prompt
$> clocking delete --year 2022 --force
# Delete whole user data, without prompt
$> clocking delete --clear --force
```
### Printing
`clocking` uses print mode to print data from own database; print data in command line through `print` section.
```console
# Print day
$> clocking print --date '01/25/2022'
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
$> clocking print --day 25 --month 1 --year 2022
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print whole month
$> clocking print --year 2022 --month 1
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220124 | 2022 | 1 | 24 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print whole year
$> clocking print --year 2022
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220103 | 2022 | 1 | 3 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |
| 20220124 | 2022 | 1 | 24 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print holiday in whole year
$> clocking print --holiday --year 2022
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220104 | 2022 | 1 | 4 | Not worked | None | Home! | 0.0 | 0.0 | 0.0 | 1 | 0 |
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print disease in whole month
$> clocking print --disease --month 1
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220105 | 2022 | 1 | 5 | Not worked | Disease | Home! | 0.0 | 0.0 | 0.0 | 0 | 1 |
+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print disease in whole year
$> clocking print --disease --year 2022
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220111 | 2022 | 1 | 11 | 7.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
# Print in other format: csv, json, html
$> clocking print --date '01/25/2022' --csv
date_id,year,month,day,hours,description,location,extraordinary,permit_hours,other_hours,holiday,disease
20220125,2022,1,25,8.0,,Milan,1.0,0.0,0.0,0,0
$> clocking print --date '01/25/2022' --json
[
[
"date_id",
"year",
"month",
"day",
"hours",
"description",
"location",
"extraordinary",
"permit_hours",
"other_hours",
"holiday",
"disease"
],
{
"date_id": 20220125,
"day": 25,
"description": null,
"disease": "0",
"extraordinary": 1.0,
"holiday": "0",
"hours": 8.0,
"location": "Milan",
"month": 1,
"other_hours": 0.0,
"permit_hours": 0.0,
"year": 2022
}
]
$> clocking print --date '01/25/2022' --html
<table>
<thead>
<tr>
<th>date_id</th>
<th>year</th>
<th>month</th>
<th>day</th>
<th>hours</th>
<th>description</th>
<th>location</th>
<th>extraordinary</th>
<th>permit_hours</th>
<th>other_hours</th>
<th>holiday</th>
<th>disease</th>
</tr>
</thead>
<tbody>
<tr>
<td>20220125</td>
<td>2022</td>
<td>1</td>
<td>25</td>
<td>8.0</td>
<td>None</td>
<td>Milan</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
# Print with rewards
$> clocking print --date '01/25/2022' --rewards
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease | rewards |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 | 81.0€ |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+
# Export data
$> clocking print --date '01/25/2022' --export my_hours.txt
$> cat my_hours.txt
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |
+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+
```
### 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.
```python
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)
# 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
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/guos)
For [Telethon](http://www.telethon.it/)
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.
[Adopt the future](https://www.ioadottoilfuturo.it/)
## Treeware
This package is [Treeware](https://treeware.earth). If you use it in production,
then we ask that you [**buy the world a tree**](https://plant.treeware.earth/matteoguadrini/clocking) to thank us for
our work.
By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
[![Treeware](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Treeware&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://treeware.earth)
## 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!
Raw data
{
"_id": null,
"home_page": null,
"name": "clocking",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Matteo Guadrini <matteo.guadrini@hotmail.it>",
"keywords": "track, worked, time, stamp, mark",
"author": null,
"author_email": "Matteo Guadrini <matteo.guadrini@hotmail.it>",
"download_url": "https://files.pythonhosted.org/packages/85/30/f370e00687b51b10bc223164923278e49beff04f5f8bc47131b3444a2dad/clocking-0.1.2.tar.gz",
"platform": null,
"description": "# `clocking`\n\n`clocking` is a command line utility to help you manage your worked hours, vacation, projects or whatever you need to\nconsider tracking time.\n\n## Testing\n\n[![CircleCI](https://circleci.com/gh/MatteoGuadrini/clocking.svg?style=svg)](https://circleci.com/gh/MatteoGuadrini/clocking)\n\nTo test package before use it, follow this:\n\n```commandline\npip install -U pytest\ngit clone https://github.com/MatteoGuadrini/clocking.git\ncd clocking\npytest tests \n```\n\n## Installing\n\nTo install package, follow below.\n\nWith `pip`:\n\n```commandline\npip install clocking\n```\n\nWith `git`:\n\n```commandline\ngit clone https://github.com/MatteoGuadrini/clocking.git\ncd clocking\npip install .\n```\n\n## Usage\n\n`clocking` was born to be a python library that offers a command line utility.\nFor more information, see the official documentation on [ReadTheDocs](https://clocking.readthedocs.io/en/latest/).\n\n### As a command line\n\nUse the command line to track and take daily hours worked on projects or not.\n\n```console\n$ clocking -h\nusage: clocking [-h] {config,cfg,c,set,st,s,delete,del,d,print,prt,p} ...\n\ntracking or monitoring worked hours\n\npositional arguments:\n {config,cfg,c,set,st,s,delete,del,d,print,prt,p}\n commands to run\n config (cfg, c) default's configuration\n set (st, s) setting values\n delete (del, d) remove values\n print (prt, p) print values\n\noptions:\n -h, --help show this help message and exit\n```\n\n### Configuration\n\n`clocking` uses configurations to apply automatically determine information when insert data into database; these\nconfigurations to creates in command line through `config` section.\n\n```console\n# Create configuration\n$> clocking config --daily-hours 8 --hour-reward 10 --extraordinary-reward 12 --location \"Milan Office\" --currency \u20ac\n# Print configuration\n$> clocking config --print\n...\n# Enable/load configuration\n$> clocking config --select-id 1\n# Or all in one\n$> clocking config --daily-hours 8 --hour-reward 10 --extraordinary-reward 12 --location \"Milan Office\" --currency \u20ac --select-id 1 --print\n```\n\nUse `config` action also to delete or clean configurations:\n\n```console\n# Delete configuration\n$> clocking config --delete-id 1\n# Clean all configurations\n$> clocking config --reset\n```\n\n### Setting\n\n`clocking` uses set mode to insert data into own database; insert data in command line through `set` section.\n\n```console\n# Set current working day\n$> clocking set --hours 8\n# Set other working day\n$> clocking set --hours 9.5 --date '11/25/2022'\n# Set disease\n$> clocking set --disease\n# Set holiday\n$> clocking set --holiday\n# Set custom value\n$> clocking set --custom 'Today I not work! I play guitar!'\n# Set custom day value: this month, this year but first day\n$> clocking set --hours 8 --day 1\n# Set custom month value: this day, this year but month november\n$> clocking set --hours 8 --month 11\n# Set custom year value: this day, this month but year 2022\n$> clocking set --hours 8 --year 2021\n# Set extraordinary hours\n$> clocking set --hours 8 --extraordinary 1\n# Set permit hours\n$> clocking set --hours 7 --permit 1\n# Set other hours\n$> clocking set --hours 8 --other 0.5\n# Set location\n$> clocking set --hours 8 --location 'Milan Office, p.za Duomo'\n# Set description\n$> clocking set --hours 8 --description 'Project: #1'\n# Set all\n$> clocking set --hours 8 --day 5 --month 5 --year 2019 --location 'Milan Office' \\\n --description 'Study Programming Python' --extraordinary 1 --other 1\n# Reset a day, without prompt\n$> clocking set --date '10/09/2023' --reset --force\n# Delete a day, without prompt\n$> clocking set --date '10/09/2023' --remove --force\n```\n\n### Deleting\n\n`clocking` uses delete mode to delete data from own database; delete data in command line through `delete` section.\n\n```console\n# Delete working first day of month\n$> clocking delete --day 1\nDelete day.\nTo continue? [y/N]\n# Delete working first day of month, without prompt\n$> clocking delete --day 1 --force\n# Delete precise date, without prompt\n$> clocking delete --date 2/2/2021 --force\n# Delete whole month (current year), without prompt\n$> clocking delete --month 11 --force\n# Delete whole year 2022, without prompt\n$> clocking delete --year 2022 --force\n# Delete whole user data, without prompt\n$> clocking delete --clear --force\n```\n\n### Printing\n\n`clocking` uses print mode to print data from own database; print data in command line through `print` section.\n\n```console\n# Print day\n$> clocking print --date '01/25/2022'\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n$> clocking print --day 25 --month 1 --year 2022\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print whole month\n$> clocking print --year 2022 --month 1\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220124 | 2022 | 1 | 24 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print whole year\n$> clocking print --year 2022\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220103 | 2022 | 1 | 3 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |\n| 20220124 | 2022 | 1 | 24 | 8.0 | None | Milan | 0.0 | 0.0 | 0.0 | 0 | 0 |\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print holiday in whole year\n$> clocking print --holiday --year 2022\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220104 | 2022 | 1 | 4 | Not worked | None | Home! | 0.0 | 0.0 | 0.0 | 1 | 0 |\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print disease in whole month\n$> clocking print --disease --month 1\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220105 | 2022 | 1 | 5 | Not worked | Disease | Home! | 0.0 | 0.0 | 0.0 | 0 | 1 |\n+----------+------+-------+-----+------------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print disease in whole year\n$> clocking print --disease --year 2022\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220111 | 2022 | 1 | 11 | 7.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n# Print in other format: csv, json, html\n$> clocking print --date '01/25/2022' --csv\ndate_id,year,month,day,hours,description,location,extraordinary,permit_hours,other_hours,holiday,disease\n20220125,2022,1,25,8.0,,Milan,1.0,0.0,0.0,0,0\n$> clocking print --date '01/25/2022' --json\n[\n [\n \"date_id\",\n \"year\",\n \"month\",\n \"day\",\n \"hours\",\n \"description\",\n \"location\",\n \"extraordinary\",\n \"permit_hours\",\n \"other_hours\",\n \"holiday\",\n \"disease\"\n ],\n {\n \"date_id\": 20220125,\n \"day\": 25,\n \"description\": null,\n \"disease\": \"0\",\n \"extraordinary\": 1.0,\n \"holiday\": \"0\",\n \"hours\": 8.0,\n \"location\": \"Milan\",\n \"month\": 1,\n \"other_hours\": 0.0,\n \"permit_hours\": 0.0,\n \"year\": 2022\n }\n]\n$> clocking print --date '01/25/2022' --html\n<table>\n <thead>\n <tr>\n <th>date_id</th>\n <th>year</th>\n <th>month</th>\n <th>day</th>\n <th>hours</th>\n <th>description</th>\n <th>location</th>\n <th>extraordinary</th>\n <th>permit_hours</th>\n <th>other_hours</th>\n <th>holiday</th>\n <th>disease</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>20220125</td>\n <td>2022</td>\n <td>1</td>\n <td>25</td>\n <td>8.0</td>\n <td>None</td>\n <td>Milan</td>\n <td>1.0</td>\n <td>0.0</td>\n <td>0.0</td>\n <td>0</td>\n <td>0</td>\n </tr>\n </tbody>\n</table>\n# Print with rewards\n$> clocking print --date '01/25/2022' --rewards\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease | rewards |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 | 81.0\u20ac |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+---------+\n# Export data\n$> clocking print --date '01/25/2022' --export my_hours.txt\n$> cat my_hours.txt\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| date_id | year | month | day | hours | description | location | extraordinary | permit_hours | other_hours | holiday | disease |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n| 20220125 | 2022 | 1 | 25 | 8.0 | None | Milan | 1.0 | 0.0 | 0.0 | 0 | 0 |\n+----------+------+-------+-----+-------+-------------+----------+---------------+--------------+-------------+---------+---------+\n```\n\n### As a python module\n\nAll useful functions to create scripts or software to track time on projects or days worked, are found in the core\nmodule: `clocking.core`\n\nI create a simple script that tracks hours worked daily.\n\n```python\nfrom sys import argv\nfrom clocking.core import *\n\nmydb = 'mydb.db'\nuser = 'myuser'\n\n# Create configuration if not was created\nif not get_current_configuration(mydb, user):\n # Update version\n update_version(mydb)\n # Create default configuration\n create_configuration_table(mydb)\n add_configuration(mydb,\n active=True,\n user=user,\n location='Italy Office',\n empty_value='not work!',\n daily_hours=8.0,\n working_days=\"Mon Tue Wed Thu Fri\",\n extraordinary=0.5,\n permit_hours=1.0,\n disease='disease',\n holiday='holiday',\n currency='\u20ac',\n hour_reward=7.5,\n extraordinary_reward=8.5,\n food_ticket=0,\n other_hours=0,\n other_reward=8.0\n )\n enable_configuration(mydb, row_id=1)\n\n# Insert daily hours...\ninsert_working_hours(mydb, user, argv[1])\n\n# ...and print it!\nprint_working_table(get_working_hours(mydb, user))\n```\n\n## Open source\n\n_clocking_ is an open source project. Any contribute, It's welcome.\n\n**A great thanks**.\n\nFor donations, press this\n\nFor me\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/guos)\n\nFor [Telethon](http://www.telethon.it/)\n\nThe Telethon Foundation is a non-profit organization recognized by the Ministry of University and Scientific and\nTechnological Research.\nThey were born in 1990 to respond to the appeal of patients suffering from rare diseases.\nCome today, we are organized to dare to listen to them and answers, every day of the year.\n\n[Adopt the future](https://www.ioadottoilfuturo.it/)\n\n## Treeware\n\nThis package is [Treeware](https://treeware.earth). If you use it in production,\nthen we ask that you [**buy the world a tree**](https://plant.treeware.earth/matteoguadrini/clocking) to thank us for\nour work.\nBy contributing to the Treeware forest you\u2019ll be creating employment for local families and restoring wildlife habitats.\n\n[![Treeware](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Treeware&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://treeware.earth)\n\n## Acknowledgments\n\nThanks to Mark Lutz for writing the _Learning Python_ and _Programming Python_ books that make up my python foundation.\n\nThanks to Kenneth Reitz and Tanya Schlusser for writing the _The Hitchhiker\u2019s Guide to Python_ books.\n\nThanks to Dane Hillard for writing the _Practices of the Python Pro_ books.\n\nSpecial thanks go to my wife, who understood the hours of absence for this development.\nThanks to my children, for the daily inspiration they give me and to make me realize, that life must be simple.\n\nThanks Python!\n",
"bugtrack_url": null,
"license": "GNU General Public License v3.0",
"summary": "Track the worked time.",
"version": "0.1.2",
"project_urls": {
"changelog": "https://github.com/MatteoGuadrini/clocking/blob/master/CHANGES.md",
"documentation": "https://clocking.readthedocs.io/en/latest/",
"homepage": "https://github.com/MatteoGuadrini/clocking",
"repository": "https://github.com/MatteoGuadrini/clocking.git"
},
"split_keywords": [
"track",
" worked",
" time",
" stamp",
" mark"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8b98ee4144d5264d2b0262ac6eecbd1f5b6fd06dd249bfc2e45debfd6ef67b33",
"md5": "c1a276f0aba6c4683ec398bbbab01e60",
"sha256": "081ceedada87dbe76ec64e874ddce7e6e0fd8be31e9df6323e9a0dba2bb64068"
},
"downloads": -1,
"filename": "clocking-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1a276f0aba6c4683ec398bbbab01e60",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 31470,
"upload_time": "2024-04-26T10:45:18",
"upload_time_iso_8601": "2024-04-26T10:45:18.621112Z",
"url": "https://files.pythonhosted.org/packages/8b/98/ee4144d5264d2b0262ac6eecbd1f5b6fd06dd249bfc2e45debfd6ef67b33/clocking-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8530f370e00687b51b10bc223164923278e49beff04f5f8bc47131b3444a2dad",
"md5": "2cb9b5dbfa89835c968f3269770dbca5",
"sha256": "77382d99e82a72f2078c24c6f6cd0b9af9f212e02539be5035b7e6b2812f44e7"
},
"downloads": -1,
"filename": "clocking-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "2cb9b5dbfa89835c968f3269770dbca5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 39997,
"upload_time": "2024-04-26T10:45:20",
"upload_time_iso_8601": "2024-04-26T10:45:20.765394Z",
"url": "https://files.pythonhosted.org/packages/85/30/f370e00687b51b10bc223164923278e49beff04f5f8bc47131b3444a2dad/clocking-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-26 10:45:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MatteoGuadrini",
"github_project": "clocking",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "clocking"
}