Skip to main content

Track the worked time.

Project description

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

CircleCI

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)

Configuration

clocking use configurations to apply automatically determine information when insert data into database; these configurations to creates in command line through config section.

# 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:

# Delete configuration
$> clocking config --delete-id 1
# Clean all configurations
$> clocking config --reset

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

paypal

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.

Adopt the future

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.

Treeware

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clocking-0.0.7.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

clocking-0.0.7-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file clocking-0.0.7.tar.gz.

File metadata

  • Download URL: clocking-0.0.7.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for clocking-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b757a520d443aef57f0feba3854492b0c85b9f1647c72305ac4c599d5271776a
MD5 5e0573267bc2abbdf639b8207126213e
BLAKE2b-256 40d305a0f130e058d48f723c110ef53097751ed521ba1e037bf6b36c09fade81

See more details on using hashes here.

File details

Details for the file clocking-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: clocking-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for clocking-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1742ccd79403be7b48b3fa7fa90aa60f3309b39ab0ee15c8f159f33f6de53d5a
MD5 23b410efce459600161e5be029fa4584
BLAKE2b-256 e897fd55e7c216257fbef656a90c0ace3ed634b5156b4e102edd5b67b9fe9b76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page