time-sheet 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a7d11fda14a1cad65a8395b72a860a5e9323a18addd2f4c2ac89d99db8d7362
4
- data.tar.gz: da26acdd9662217aa62cd3baa97516547ab1a597a69fbf36b4e1c550d06358fd
3
+ metadata.gz: dbb94daa084b68389e2fc8f28fc599bd87fd5d9016c876b7b0ba04fa508bd298
4
+ data.tar.gz: 21e136b14b65c75ce3210b314a650778015093cbab530af1ceb10ff244534c0a
5
5
  SHA512:
6
- metadata.gz: 295d61fc82e58c566f5573343b7e9a88bf0e10e3c22529ff8d237cc9a751520423e7e31396f54b0708d1c6d1c9965ef5244c7466cb0c943ea6f900e1409fa3a5
7
- data.tar.gz: 4badb442e103db1da1c37f7c2dea78d8506409a60d5ae3dbf78aa10f736aa5d7fb456f4503d91a6f5cad782272c2a7fe84eac590c9754d98234d525fd612acc8
6
+ metadata.gz: ebcad92e2658984db81e9f1e9edd2dc616aa342e838254c86b3e6717dd065d171d69d4d7a63ebf03744cc1670ab74637426d86aa32d9180f82d466c22e934676
7
+ data.tar.gz: e19d852e99883432284fe5953bdf684e0056bb6e814f024c42d1a5272abaf95dfd1ae56e061eb94ee3a8dc4620c9dde7f424a167e3c4df6f17350a57fd930a51
data/README.md CHANGED
@@ -15,6 +15,47 @@ The gem bundles an executable which includes a help command, just run
15
15
  `time-sheet.rb --help`. As an example spreadsheet, have a look at
16
16
  [the sheet we use for tests](https://github.com/moritzschepp/time-sheet/raw/master/spec/data/time_log.xls).
17
17
 
18
+ ### Processing data with other tools
19
+
20
+ You can simply let the tool output a full list of time entries that are easy to
21
+ process with other tools. For example a python script `process.py` like this
22
+
23
+ ~~~python
24
+ import sys
25
+ from io import StringIO
26
+ import datetime
27
+ import pandas as pd
28
+
29
+ data = sys.stdin.readlines()
30
+ data = StringIO("\n".join(data))
31
+ df = pd.read_csv(data,
32
+ sep='|',
33
+ names=['date', 'start', 'end', 'minutes', 'project', 'activity', 'description'],
34
+ converters={
35
+ 'date': lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(),
36
+ 'start': lambda x: datetime.datetime.strptime(x, '%H:%M').time(),
37
+ 'end': lambda x: datetime.datetime.strptime(x, '%H:%M').time()
38
+ }
39
+ )
40
+
41
+ # ... your processing
42
+ ~~~
43
+
44
+ could be used to read the data into a pandas dataframe like this:
45
+
46
+ ~~~bash
47
+ time-sheet.rb --trim | ./process.py
48
+ ~~~
49
+
50
+ Attention: unfortunately, the python debugger `pdb` (as well as `ipdb`) doesn't
51
+ work out of the box with scripts that make use of data via STDIN. If you want to
52
+ use it, you have to
53
+
54
+ ~~~python
55
+ sys.stdin = open('/dev/tty')
56
+ ipdb.set_trace()
57
+ ~~~
58
+
18
59
  ## Contributing
19
60
 
20
61
  Bug reports and pull requests are welcome on GitHub at https://github.com/moritzschepp/time-sheet
@@ -48,6 +48,8 @@ class TimeSheet::TablePrinter
48
48
  else
49
49
  last_column ? value : value.ljust(width)
50
50
  end
51
+
52
+ options[:trim] ? str.strip : str
51
53
  end
52
54
 
53
55
  def size(value)
@@ -1,3 +1,3 @@
1
1
  module TimeSheet
2
- VERSION = "0.5.5"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time-sheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moritz Schepp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-10 00:00:00.000000000 Z
11
+ date: 2019-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spreadsheet