npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

redmine-time-manager

v0.2.3

Published

Redmine Time Manager

Downloads

3

Readme

Redmine Time Manager

Cli tool for redmine time managment

Main idea:

  • You prepare configuration for transformation your csv for redmine time entries api format only once
  • Regularly call this script for transfering your time entries and saving it in redmine

Examples

Transformation from Microsoft Excel or LibreOffice Calc or GoogleDocs Spreadsheets:

Your configuration (config.json) may be as:

{
  "csv": {
    "delimiter": "\t",
    "columns": true,
    "encoding": "utf8",
    "quote": false
  },
  "rules": {
    "columns": {
      "issue": "Issue",
      "activity": "Action",
      "comment": "Description",
      "time": "Time"
    }
  },
  "time_type": "time",
  "date_source": "argument",
  "date_format": "yyyy-MM-dd",
  "issue_regexp": "\\d+",
  "redmine": {
    "url": "http://[email protected]",
    "user_id": 123,
    "default_issue": 456,
    "activities": {
      "Code": 1,
      "Code Review": 2,
      "Test": 3
    },
    "default_activity_code": 1
  }
}

Next for GNU/Linux with Xorg, you can select table, tap CTRL+C for coping in system clipboard, and call command:

xsel -o | redmine-time-manager save --config=config.json --date=2022-02-01 --rewrite

Or for other system you can save into csv file (for example my-daily-time.csv), and call command:

redmine-time-manager save --config=config.json --from-file=my-daily-time.csv --date=2022-02-01

Transformation from Hamster Time Tracker:

Your configuration (config.json) may be as:

{
  "csv": {
    "delimiter": "\t",
    "columns": true,
    "encoding": "utf8",
    "quote": false
  },
  "rules": {
    "columns": {
      "issue": "занятие",
      "activity": "метки",
      "comment": "описание",
      "time": "длительность в минутах",
      "date": "время начала",
      "category": "категория"
    }
  },
  "time_type": "minutes",
  "date_source": "column",
  "date_format": "yyyy-MM-dd HH:mm",
  "issue_regexp": "\\d+",
  "query": "select * from ? where category = 'Work'",
  "redmine": {
    "url": "http://[email protected]",
    "user_id": 123,
    "default_issue": 456,
    "activities": {
      "Code": 1,
      "Code Review": 2,
      "Test": 3
    },
    "default_activity_code": 1
  }
}

Hamster Time Tracker supported export reports to tsv format (csv by tab delimiters), and you can call command:

redmine-time-manager save --config=config.json --from-file=my-daily-time.tsv

Description of config params

  • csv - for this section see https://csv.js.org/parse/options/
  • rules.columns - mapping rules for column names, must defined aliases for time, issue, activity, date, comment
  • time_type - time format, may be "hours"/"minutes"/"time"
  • date_source - source of date, may be "column"/"argument"
  • issue_regexp - regexp of issue number, mostly - "\\d+"
  • date_format - format of date, for example yyyy-MM-dd
  • redmine - params for redmine
    • url
    • user_id - your user id
    • default_issue - default issue number
    • activities - mapping rules of activity_id aliases in your Redmine instance

Additional:

  • query - filter of date like sql syntax
    for example: select * from ? where category = 'Work'

TOC

Usage

$ npm install -g redmine-time-manager
$ redmine-time-manager COMMAND
running command...
$ redmine-time-manager (--version)
redmine-time-manager/0.2.2 linux-x64 node-v21.0.0
$ redmine-time-manager --help [COMMAND]
USAGE
  $ redmine-time-manager COMMAND
...

Commands

redmine-time-manager help [COMMAND]

Display help for redmine-time-manager.

USAGE
  $ redmine-time-manager help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for redmine-time-manager.

See code: @oclif/plugin-help

redmine-time-manager save

Save time entries to redmine. Full documentation in README.

USAGE
  $ redmine-time-manager save -c <value> [--from-file <value>] [--date <value>] [--dry] [--rewrite]

FLAGS
  -c, --config=<value>  (required) [default: redmine-time-manager-config.json] Json config
  --date=<value>        Date. Must defined when config.date_source = "argument"
  --dry                 For testing calls. Delete and write operations will be disabled.
  --from-file=<value>   Csv file. If undefined, will use stdin
  --rewrite             Redmine data at choosed date will be rewrited.

DESCRIPTION
  Save time entries to redmine. Full documentation in README.

EXAMPLES
  $ redmine-time-manager save --config=config.json --date=2000-01-01 --rewrite --from-file=my-work-time.csv    # reading from csv file

  $ xsel -o | redmine-time-manager save --config=config.json --date=2000-01-01 --rewrite    # reading csv from stdin from Xorg clipboard

See code: dist/commands/save.ts