Code Monkey home page Code Monkey logo

parti-time's Introduction

parti-time -- track and partition your time in plain text

parti-time is a tool for partitioning timelines and tracking your time in plain text.

Partitioning implies:

  • no undeclared gaps
  • no double booking
  • 1 single timeline
  • strict order

Otherwise keeping a partitioned timeline is similar to classical time-tracking. People use it to remember and document how long they've been working on which projects and occupations.

parti-time enables users to

  • keep their timeline in plain text
  • create reports about their working hours

Feature roadmap

Status quo:

  • tl file based reporting
  • editor support for tl files in emacs and vi
  • Google Sheet append

2024-Q2:

  • tl lenses: Separate storage from tl editor view
  • tt-like command line operations

post 2024-Q2:

  • Web App
  • Tightly scoped access tokens for untrusted customer devices

v2: tl, the timeline DSL

tl has been designed to be

  • concise
  • precise
  • human-editable with ease
  • human-readable
  • simple to parse
  • visually clean

Here is a sample day's declaration as timeline:

2019-08-12
0545 Customer X 2019-08
     Some Task
0700 Metamorphant
     Proof-Reading Metamorphant Blog
0745 Customer X 2019-08
     Development of Blarz, Interesting other stuff
1130 Private
     Lunch Break
1200 Customer X 2019-08
     Architecture Whiteboard Session, Incident Blubb
1545 Private
     Reading Awesome Clojure
1615 Customer X 2019-08
     Decision draft Project Y
1730 Private

In src/itest/resources/examples/v2_tl/TimeTracker.sample.tl you find a complete 2-day tl sample.

Getting Started with parti-time's CLI frontend

Download and install

Get project summary

For all CLI commands tl files, tt files and yaml files can be used interchangeably. You specify the format using the --input-format option. The default format is tl.

pt projects --input-format yaml src/itest/resources/examples/v1_yaml/TimeTracker.sample.yml

"Customer X 2019-08" 19.25
"Customer Z 2019-08" 1.0
"Metamorphant" 1.5
"Private" 14.5

Reports a summary of hours booked per project. Unsorted. This is used for basic cross-checks.

Get invoice report

pt invoice-report src/itest/resources/examples/v2_tl/TimeTracker.sample.tl "Customer X 2019-08"

2019-08-12,05:45,17:30,01:45,10:00,"Some Task, Development of Blarz, Interesting other stuff, Architecture Whiteboard Session, Incident Blubb, Decision draft Project Y"
2019-08-13,05:45,16:15,01:15,09:15,"Roadmap planning, Legacy Stack Analysis, Visualisation of Dependencies, Monitoring stack, Log shipping Integration"

pt invoice-report creates a CSV report with a daily summary of booked times on a selected project. The report satisfies the usual german Gesetz über die Durchführung von Maßnahmen des Arbeitsschutzes zur Verbesserung der Sicherheit und des Gesundheitsschutzes der Beschäftigten bei der Arbeit (Arbeitsschutzgesetz - ArbSchG) conditions. This is typically demanded for consulting projects with a labor leasing time & material contract model (cf. Gesetz zur Regelung der Arbeitnehmerüberlassung).

Rules typically involve

  • Start time on that day is visible (has to be >11h after the last day's end time)
  • End time on that day is visible
  • Total sum of pauses is visible (has to be >30m per day for adults)
  • Total work time is visible (has to be <10h per day)

The list of occupations is meant as a reminder for the involved parties about the work involved.

Get timesheet

pt timesheet src/itest/resources/examples/v2_tl/TimeTracker.sample.tl

2019-08-12,05:45,07:00,,Some Task,Customer X 2019-08
2019-08-12,07:00,07:45,,Proof-Reading Metamorphant Blog,Metamorphant
2019-08-12,07:45,11:30,,"Development of Blarz, Interesting other stuff",Customer X 2019-08
2019-08-12,11:30,12:00,,Lunch Break,Private
2019-08-12,12:00,15:45,,"Architecture Whiteboard Session, Incident Blubb",Customer X 2019-08
2019-08-12,15:45,16:15,,Reading Awesome Clojure,Private
2019-08-12,16:15,17:30,,Decision draft Project Y,Customer X 2019-08
2019-08-12,17:30,05:45,,,Private
2019-08-13,05:45,07:00,,Roadmap planning,Customer X 2019-08
2019-08-13,07:00,07:45,,Reading Wonderful Clojure,Private
2019-08-13,07:45,11:30,,"Legacy Stack Analysis, Visualisation of Dependencies",Customer X 2019-08
2019-08-13,11:30,12:00,,Lunch Break,Private
2019-08-13,12:00,16:15,,"Monitoring stack, Log shipping Integration",Customer X 2019-08
2019-08-13,16:15,17:00,,Phone call with customer Z,Metamorphant
2019-08-13,17:00,18:00,,"Automated DEV host setup, Build pipelines",Customer Z 2019-08

The timesheet feature generates a report that follows the usual format of classical timesheets, i.e. is time-slice oriented.

Development

Prerequisites

  • Install Oracle GraalVM >= 22+36.1
  • Setup an environment variable GRAALVM_HOME pointing to your graalvm installation (e.g. in your ~/.bashrc), e.g.
export GRAALVM_HOME="${HOME}/graalvm-jdk-22+36.1"

Run tests

lein test

Build a native-image

lein native-image

Create native-image reachability metadata

Create a sample Google spreadsheet and get its spreadsheet ID.

lein uberjar
${GRAALVM_HOME}/bin/java -agentlib:native-image-agent=config-merge-dir=src/main/resources/META-INF/native-image -jar target/parti-time-*-SNAPSHOT-standalone.jar download --google-sheet-id "1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8pxBll4hps"
${GRAALVM_HOME}/bin/java -agentlib:native-image-agent=config-merge-dir=src/main/resources/META-INF/native-image -jar target/parti-time-*-SNAPSHOT-standalone.jar append --google-sheet-id "1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8pxBll4hps" --input-parti-file src/itest/resources/examples/v2_tl/TimeTracker.sample.tl

Create a native-image and remove the Clojure libraries that appear in the error messages.

lein native-image

Known limitations

Predefined reports

As of now, there are only predefined reports. They are not nice and beautiful, either.

We consider this a major limitation and envision something like a report query language to create arbitrary reports in a crosstab-like fashion.

No timezones

As of now, all times are limited to local times of a single timezone. There is no handling of different timezones, switching timezones etc. No time travel, as well.

Media coverage

parti-time has been featured in

Legacy features

v1: The legacy YAML format

In src/itest/resources/examples/v1_yaml/TimeTracker.sample.yml you find a 2-day sample v1 time partitioning. You won't need it, except if you have legacy files that you want to convert to a new format.

v1 YAML timelines are deprecated and will be removed in future versions. Use pt convert to migrate.

parti-time's People

Contributors

johannesfknauf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rfhlmn

parti-time's Issues

Record future plans

Sometimes you already know about a future event (vacation, holidays, planned appointments, ...). You want to already record it in your timeline, so you won't forget it later.

At the same time, you don't want to record it as final. Reality may turn out differently than your plan.

Hence, I'd like to have a feature to record a planned event up-front and confirm it once it really happened (or adjust it, if it happened in a different way than my original plan -- e.g. a meeting took 15m longer).

Improve output for time-ordering violations

Currently, the output in case of a time-ordering violation reads

An error occured:
End time predates start time. Times must be strictly ordered.

Expected improvement: The user should receive a hint (line number, content sample, ...) that guides her to the right location in the DSL file.

Google Sheets integration

In order to publish my times for other stakeholders (billing, compliance), I want to be able to upload my times (except private times) to Google Sheets.

In the first increment, it's fine if the source system of record resides with the local tl-files and only uploading is supported. In a future increment, I'd like to also download and reconcile times (= bidirectional explicit sync).

Handling multiple input files

Hi @JohannesFKnauf

I absolutely love this project of yours, thanks for making it publicly available!
As I personally like to split things into multiple files before becoming too large, I am trying to make it possible to generate timesheets using multiple input files at once.

I was wondering whether there is a simple way to implement this here, though it works with a bash wrapper and I unfortunately do not have any prior knowledge in Clojore nor any other LISP-like language.

Just a suggestion, don't bother to answer if you're too busy.


Suggestion 1

Detect the format (yaml vs. tl) using the first line of the file.
This would allow the use of

parti-time timesheet <( cat 2024-*.tl )

Suggestion 2

Allow the user to pass multiple files

parti-time timesheet 2023-12-*.tl 2024-01-03.tl 2024-01-04.tl 

External solution

The current workflow is

  • concatenating those *.tl files together, putting an empty line in between
  • writing this to a temporary file
  • providing the path to the temporary file to parti-time
  • removing the temporary file

Thanks a lot
hoschi

invoice-report: Show each occupation only once per day

Right now, the invoice-report just lists all occupations as a ,-separated list. So, if you worked on a topic in multiple time-windows, the topic will appear twice, thrice, or even more often.

I want to list every topic only once, but in the order of appearance. I.e. only the first occurence should be reported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.