Giter VIP home page Giter VIP logo

timew-csv's Introduction

Bash Timewarrior Extension

This bash script works as an extension to the commandline time-tracker Timewarrior. The timewarrior github repo can be found: https://github.com/GothenburgBitFactory/timewarrior

Requirements/Dependencies

  • timew
  • jq
  • soffice (LibreOffice - only required if you set XLSX_FILE="TRUE")

Usage

  1. Install timewarrior (go here for distro-specific options).
  2. Initialize timewarrior by running timew and entering yes when prompted to create the 'extensions' directory.
  3. Copy the csv.sh script to ~/.timewarrior/extensions/ and make executable (chmod +x csv.sh). Alternatively, clone the repo and create a symlink in the ~/.timewarrior/extensions/ directory back to wherever you cloned the script.
  4. After creating some entries, run timew report csv.sh [:week] [tags...] to generate a report.

Variables

Variable Description Default
REPORT_PATH The location to store the report created $HOME/.timewarrior/timew-reports
USER_NAME The name prefixing the report $USER
SEP The separator used in the CSV ";"
XLSX_FILE Creates an additional .xlsx file "FALSE"

Additional Notes

This one of my first projects. I created this script as an exercise. I wanted to see if I could create a bash version of a Python extension - this one: https://github.com/lauft/timew-report

Please submit issues and any feedback you have if you are so inclined. I would like to make this extension more general and less specific to how I use it.

Thanks!

Thank you to Tronde for your suggestions and ideas for improvement.

timew-csv's People

Contributors

radarsymphony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

timew-csv's Issues

Output of path to report contains one '/' to much

What have I done today?

$ git clone https://github.com/radarsymphony/timew-csv.git
$ mv timew-csv/csv.sh extensions/ # Edit csv.sh to set XLSX_FILE="FALSE"
$ tw report :week csv
/home/tronde/.timewarrior/timew-reports//tronde-2022-05-16-log.csv

What do I expect?

The script should output the correct path /home/tronde/.timewarrior/timew-reports/tronde-2022-05-16-log.csv.

Thank you for this awesome extension!

Anyway, thank you very much for this extension! I appreciate your work creating an easy to use script that exactly match my needs.

Annotations column not added if first row has no annotation

Summary

The original dynamic way of collecting the column headers with jq breaks if the first entry of the time frame passed to standard in doesn't have an 'annotations' entry.

Current fix is to hard-code headers passed as "keys" to jq. Still reviewing issue and learning more about jq to find a more flexible solution (maybe...)

Steps to Reproduce

  1. Create a time entry without adding an annotation
  2. Call this report selecting only that entry
  3. Review CSV - Should be missing annotations column

RFE: Set default to 'XLSX_FILE="FALSE"'

Generating a XLSX file in addition to the CSV seems to be redundant though it's a nice additional functionality for sure. But I guess the main purpose of your extension is to create CSV files.

Setting the default to XLSX_FILE="FALSE" would make the dependency soffice obsolete and prevents an error at the first run. ;-)

What do you think about it?

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.