Skip to main content

Tool to generate daily input for Task Juggler

Project description

TJ Feeder

This package generates a daily input for TaskJuggler from a CSV file (comma as separator) with headers: time_spent (XYmin or X.Yh), issue_name (name of task), and issue_description (optional description of task).

Installation

The project is available on PyPI's page TJ_Feeder. To install it, run:

pip install tj_feeder

Set up

First, you need to set up the starting hour of your shift, the shift duration in hours, and the display mode for task durations (minutes or hours).

You will need a holidays file containing specifying holiday dates in the format yyyy-mm-dd (e.g. "2021-25-12"). Make sure to have only one date per line. To set the path to this file, run the command:

tj_feed define --holidays-file [path_to_file]

To set the starting hour of your shift, run the command:

tj_feed define --starting-hour [integer]

To set the shift duration, run the command:

tj_feed define --shift-hours [integer]

To set month starting workday ranging from 1 to 31 (i.e. the first workday accounted for the month's invoice), run the command:

tj_feed define --month-start-workday [integer]

To set the display mode for minutes (in case you want the display mode for hours, you can set this to False), run the command:

tj_feed define --use-minutes [True|False]

Generating Daily Feed

Create your CSV file following the format yyyy-mm-dd.csv (e.g. 2021-09-30.csv) and fill it like this:

time_spent,issue_name,issue_description
<time_spent_in_minutes_or_hours>,<issue1_name>,<issue1_description>
<time_spent_in_minutes_or_hours>,<issue2_name>,<issue2_description>
<time_spent_in_minutes_or_hours>,<issue3_name>,<issue3_description>
  • Make sure to use the same headers;
  • The time spent can be in two formats: XYmin or X.Yh (e.g. 45min or 0.75h);
  • Make sure the issue names match with the tasks defined by your team manager;
  • The issue description is optional;
  • Use commas only to separate the values.

E.g.:

time_spent,issue_name,issue_description
30min,communication_9,Meetings
0.5h,management_6,Weekly review
7.0h,my_proj_13,Module implementation

Once you have your csv file ready. You can run the following command:

tj_feed feed <your_file.csv>

E.g.

tj_feed feed ../test/2021-09-30.csv
booking communication_9                2021-09-10-09:00 +0.5h                # Meetings
booking management_6                   2021-09-10-09:30 +0.5h                # Weekly review
booking my_proj_13                     2021-09-10-10:00 +7.0h                # Module implementation

In case, the time spent is higher than the shift duration the overtime flag will be set automatically.

E.g. (assuming a shift of 8 hours long)

tj_feed feed ../test/2021-09-30.csv
booking communication_9                2021-09-30-09:00 +0.5h                # Meetings
booking management_6                   2021-09-30-09:30 +0.5h                # Weekly review
booking my_proj_13                     2021-09-30-10:00 +7.5h   {overtime 1} # Module implementation

Batch processing

It's also possible to create and feed multiple CSV files in one go.

Creating all month's CSV files

To create all necessary CSV files with headers and considering holidays (see: Set up) and weekends, run the following command:

tj_feed create_month_dir --root-directory <path to directory> --year <integer> --month <integer>

E.g. running this command "tj_feed create_month_dir --root-directory my_bookings/ --year 2022 --month 1", will result in the following structure:

root_directory/
|__ 2022-01/
    |__ 2022-01-03.csv
    |__ 2022-01-04.csv
    ...
    |__ 2022-01-31.csv

Feed all month's CSV files

To generate a feed using the month directory created by "tj_feed create_month_dir" command, you can use the "tj_feed feed_month_dir" command.

tj_feed feed_month_dir --month-directory <path to directory>

The feed will have one extra line break to separate bookings per day and three extra line breaks to separate bookings per week.

E.g. running the command "tj_feed feed_month_dir --month-directory my_bookings/2022-01", will have an output similar to this:

{bookings for 2022-01-03}

{bookings for 2022-01-04}

{bookings for 2022-01-05}

{bookings for 2022-01-06}

{bookings for 2022-01-07}



{bookings for 2022-01-10}

{bookings for 2022-01-11}

{bookings for 2022-01-12}

...

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

tj_feeder-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tj_feeder-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file tj_feeder-0.1.0.tar.gz.

File metadata

  • Download URL: tj_feeder-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for tj_feeder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d77ded26d6df7cd658479113b71cd1e2ff044962d1580d1ee18f462282bd185e
MD5 39231afe0f85fdb63ec79d4adb083d8a
BLAKE2b-256 87eb7258745844e6d4c635179bf3cd2cccff103001443983ecb8e9a4ecb1a0d1

See more details on using hashes here.

File details

Details for the file tj_feeder-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tj_feeder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for tj_feeder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a4c05e3b02e2bf6b00a614bb4011f42e755c13e48b66a39f70fe107f5a19bf
MD5 efc6422011a3c6722e88ea2312861d0a
BLAKE2b-256 73e5359b003b3b160baf8051fa4e19a0a7d1e56e469eb405ef722c257877b863

See more details on using hashes here.

Supported by

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