Git Product home page Git Product logo

workedon's Introduction

workedon

image Python versions Tests status Coverage License Downloads

Work tracking from your shell.

demo

Why build this

I believe tracking your work is an important way of measuring productivity and is a habit that is very helpful to develop. But the thing about habits is - if they aren’t easy and accessible, you will eventually stop doing them - just like going to a gym that is 40 minutes away :) I tried different methods to log my work and failed. Google Docs, iCloud Notes, Notepad++, Sticky Notes, etc. I really wanted a way of tracking with very little effort so I could make this a habit. It's pretty obvious that we all spend most of our day on the terminal. Wouldn’t it be nice if I wrote a feature, committed it and then logged what I did right then and there without a second thought? What if I could also search this based on date so I could look at, for example, how productive I was in the past week?

workedon is another attempt of mine to make work logging a habit and improve my productivity.

How it works

This tool is useful in two ways - for logging work and fetching logged work. The implementation is very simple. Work is logged in the form of workedon <text> @ <date>or just workedon <text> (which uses the current date/time). There is a custom parser that reads the content, splits it at the @ to a work and a date component and then uses the awesome dateparser library to parse human-readable dates into datetime objects. This is then saved in a SQLite database (File location varies based on OS). Logged work can be fetched using multiple options that accept similar human-readable date/times. The same parser is used again to parse into datetime objects which are used to query the database. The output uses the current shell's pager to display a paged list similar to git log (your output may slightly vary based on your shell).

Installation

pip install workedon

Requirements

  • Python 3.7+

Features

  • Log work from your shell in plain text with human-readable dates/times.
    • The date/time is optional. The default is the current date/time.
    • The @ character is used to separate the text from the date/time.
  • Fetch logged work with human-readable dates/times.
  • Familiar Git-like interface.
  • Filter, sort, delete, format and display logged work on your shell.
  • Set date/time format of the output through settings.

Settings

Whenever workedon is run for the first time, a settings file named wonfile.py is generated at the user's configuration directory, which varies based on OS. To find out, run:

workedon --print-settings-path

Settings are strings used to configure the behavior of workedon. The currently available settings are:

  • DATE_FORMAT : Sets the date format of the output.
    • Must be a valid Python strftime string.
    • Option: --date-format <value>
    • Environment variable: WORKEDON_DATE_FORMAT
  • TIME_FORMAT : Sets the time format of the output.
    • Must be a valid Python strftime string.
    • Option: --time-format <value>
    • Environment variable: WORKEDON_TIME_FORMAT
  • DATETIME_FORMAT : Sets the date and time format of the output.
    • Must be a valid Python strftime string.
    • Setting this overrides DATE_FORMAT and TIME_FORMAT.
    • Option: --datetime-format <value>
    • Environment variable: WORKEDON_DATETIME_FORMAT
  • TIME_ZONE : Sets the time zone of the output.
    • Must be a valid timezone string.
    • Default is the auto-detected timezone using the tzlocal library.
    • Option: --time-zone <value>
    • Environment variable: WORKEDON_TIME_ZONE

Order of priority is Option > Environment variable > Setting.

To find your current settings, run:

workedon --print-settings

Check the default settings here.

Usage

$ workedon --help
Usage: workedon [OPTIONS] COMMAND [ARGS]...

  Work tracking from your shell.

  Example usages:
  1. Logging work:
  workedon painting the garage
  workedon studying for the SAT @ June 23 2010
  workedon pissing my wife off @ 2pm yesterday

  2. Fetching work:
  workedon what
  workedon what --from "2pm yesterday" --to "9am today"
  workedon what --today
  workedon what --past-month

Options:
  -v, --version  Show the version and exit.
  -h, --help     Show this message and exit.

Commands:
  workedon*  Specify what you worked on, with optional date/time.
  what       Fetch and display logged work.

$ workedon what --help
Usage: what [OPTIONS]

  Fetch and display logged work.

  If no options are provided, work
  from the past week is returned.

Options:
  -r, --reverse           Reverse order while sorting.
  -n, --count INTEGER     Number of entries to return.
  -s, --last              Fetch the last thing you worked on
  -i, --id TEXT           id to fetch with.
  -f, --from TEXT         Start date-time to filter with.
  -t, --to TEXT           End date-time to filter with.
  --since TEXT            Fetch work done since a specified date-time in the
                          past.
  -d, --past-day          Fetch work done in the past 24 hours.
  -w, --past-week         Fetch work done in the past week.
  -m, --past-month        Fetch work done in the past month.
  -y, --past-year         Fetch work done in the past year.
  -e, --yesterday         Fetch work done yesterday.
  -o, --today             Fetch work done today.
  --on TEXT               Fetch work done on a particular date/day.
  --at TEXT               Fetch work done at a particular time on a particular
                          date/day.
  --delete                Delete fetched work.
  -g, --no-page           Don't page the output.
  -l, --text-only         Output the work log text only.
  --date-format TEXT      Sets the date format of the output. Must be a valid
                          Python strftime string.
  --time-format TEXT      Sets the time format of the output. Must be a valid
                          Python strftime string.
  --datetime-format TEXT  Sets the datetime format of the output. Must be a
                          valid Python strftime string.
  --time-zone TEXT        Sets the timezone of the output. Must be a valid
                          timezone string.
  --help                  Show this message and exit.

Limitations

  • Your input is limited by your shell. Certain characters like the single quote ' behave differently. Put your content within double quotes to get around special characters.

    For example:

    workedon "repairing my wife's phone"
    
  • The date parser which is used may misinterpret some irregular phrases of date/time, but mostly does great.

  • There are some reserved keywords that are used as subcommands and cannot be used as the first word of your log's content:

    • workedon
    • what

    You can use double quotes here as well to get around this.

    For example, this will not work:

    workedon what my wife asked me to do @ 3pm 3 days ago
    

    This is fine:

    workedon "what my wife asked me to do" @ 3pm 3 days ago
    

Credits

  • dateparser, for an amazing date parser. This project would not be possible without it.
  • peewee, for a nice and tiny ORM to interact with SQLite.
  • Click, for making writing CLI tools a complete pleasure.
  • jrnl, fck and Simon Willison for some inspiration.

workedon's People

Contributors

dependabot[bot] avatar viseshrp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

workedon's Issues

Feature request adding TODO items for later

I would love to be able to add reminders to be completed later. That being later today, or tomorrow. I think a rolling list of TODOs would be fine, but optionally having the capability of assigning them to e.g.: tomorrow could be useful too.

Let me maybe give an example, I start my workday by checking emails $workedon catching up on emails, then I see a new code review from co-worker $workedon later complete PR #2 to note this. Once I'm done with the emails I check my TODO list with something like $workedon what, or TODOs could live in their own spot with $workedon later what. I see the list and instead of typing out the whole ticket again I'm thinking there would be some shortcut to transition a TODO to a working on, like $workedon later 1 (assuming they were numbered).

Thanks for the consideration and the project!

Feature Request: Tags and Durations

Issue

  • workedon version: 0.6.3
  • Python version: 3.10.8
  • Operating System: MacOS

Description

Two potentially useful features could be adding a tag and a time duration. I'd love to use tags to identify which of many different projects I'm working on. Duration would be nice for a quick look at how many hours I have contributed to it.

E.g.,

workedon "Supported XX colleague with developing unit tests" @ 9am today -d 2 hours -t "support"

So that I could do

workedon what -t support

And get a read-out of all of the sub-tasks for this tag and how long they took.

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.