Skip to main content

"Plot charts from arbtt-stats to terminal"

Project description

arbtt-chart

Textual chart for arbtt, the automatic, rule-based time tracker.

PyPI Python Version badge PyPI Version badge License badge

Similar to arbtt-graph, just in plain monospace text.

demo

(The above screenshot is generated using my liskin-arbtt-stats which provides a few handy commands and combines data from multiple X sessions and Strava.)

Raw arbtt-stats output for the same time period looks something like this:

arbtt-stats

Getting started

  1. Install arbtt and make sure arbtt-capture runs in your graphical login session.

  2. Configure arbtt rules in ~/.arbtt/categorize.cfg. See Configuring the arbtt categorizer, Effective Use of Arbtt, and sample categorize.cfg for arbtt-graph.

  3. Install arbtt-chart.

  4. Try arbtt-stats --output-format=csv --each-category | arbtt-chart or arbtt-stats --output-format=csv --category=Graph | arbtt-chart

Installation

Using pipx:

pipx ensurepath
pipx install git+https://github.com/liskin/arbtt-chart

To keep a local git clone around:

git clone https://github.com/liskin/arbtt-chart
make -C arbtt-chart pipx

Alternatively, if you don't need the isolated virtualenv that pipx provides, feel free to just:

pip install git+https://github.com/liskin/arbtt-chart

Or, since the only dependency is pandas, you can just sudo apt install python3-pandas and run arbtt_chart.py directly. :-)

Usage

$ arbtt-chart --help
usage: arbtt-chart [-h] [--no-stacked] [--subtags] [--totals-re RE]

Plot charts from arbtt-stats to terminal. Expects `arbtt-stats --output-
format=csv --category=…` or `arbtt-stats --output-format=csv --each-category`
output on stdin.

options:
  -h, --help      show this help message and exit
  --no-stacked    don't stack bar chart
  --subtags       recognize subtags (separated by '-') and sort them together
  --totals-re RE  totals row regexp, default: ^\(total time\)$

Examples

single category

$ arbtt-stats --filter='$date >= 2021-03-0220:00 && $date < 2021-03-0303:00' \
>             --min-percentage=2 --category=Activity --output-format=csv \
> | arbtt-chart
Activity                                                                        
════════                                                                        
Proj-arbttⁱ          03:11:40  ███████████▓██████████▓██████████▓██▏········÷···
Chat                 00:30:20  ···········÷··········÷··········÷··█████▊···÷···
(8 entries omitted)  00:15:40  ···········÷··········÷··········÷·······▕██▊÷···
Web-Social           00:08:20  ···········÷··········÷··········÷··········▐▓▏··
Web-otherⁱ           00:06:40  ···········÷··········÷··········÷···········÷█▍·
Web-HN               00:06:20  ···········÷··········÷··········÷···········÷·▐▊
(unmatched time)     00:01:20  ···········÷··········÷··········÷···········÷··▕
                                                                                
(total time)         04:20:20  ███████████▓██████████▓██████████▓███████████▓███

single category, subtags

$ arbtt-stats --filter='$date >= 2021-03-0220:00 && $date < 2021-03-0303:00' \
>             --min-percentage=2 --category=Activity --output-format=csv \
> | arbtt-chart --subtags
Activity                                                                        
════════                                                                        
Proj                arbttⁱ  03:11:40  █████████▓█████████▓█████████▓█·······÷···
Chat                        00:30:20  ·········÷·········÷·········÷▕████▊··÷···
Web                 Social  00:08:20  ·········÷·········÷·········÷·····▕█▏÷···
                    otherⁱ  00:06:40  ·········÷·········÷·········÷·······█▏···
                    HN      00:06:20  ·········÷·········÷·········÷········▓▏··
(8 entries omitted)         00:15:40  ·········÷·········÷·········÷········÷██▋
(unmatched time)            00:01:20  ·········÷·········÷·········÷········÷··▕
                                                                                
(total time)                04:20:20  █████████▓█████████▓█████████▓████████▓███

multiple categories

$ arbtt-stats --filter='$date >= 2021-03-0220:00 && $date < 2021-03-0303:00' \
>             --min-percentage=2 --each-category --output-format=csv \
> | arbtt-chart
Activity                                                                        
════════                                                                        
Proj-arbttⁱ          03:11:40  ███████████▓██████████▓██████████▓██▏········÷···
Chat                 00:30:20  ···········÷··········÷··········÷··█████▊···÷···
(8 entries omitted)  00:15:40  ···········÷··········÷··········÷·······▕██▊÷···
Web-Social           00:08:20  ···········÷··········÷··········÷··········▐▓▏··
Web-otherⁱ           00:06:40  ···········÷··········÷··········÷···········÷█▍·
Web-HN               00:06:20  ···········÷··········÷··········÷···········÷·▐▊
(unmatched time)     00:01:20  ···········÷··········÷··········÷···········÷··▕
                                                                                
(total time)         04:20:20  ███████████▓██████████▓██████████▓███████████▓███
                                                                                
Desktop                                                                         
═══════                                                                         
4_arbtt              02:21:40  ███████████▓██████████▓███▊······÷···········÷···
6_arbtt_web          00:50:20  ···········÷··········÷···▐██████▓██·········÷···
1_irc                00:34:00  ···········÷··········÷··········÷··██████▌··÷···
2_web                00:34:00  ···········÷··········÷··········÷········▐██▓███
(1 entries omitted)  00:00:20  ···········÷··········÷··········÷···········÷··▕
                                                                                
(total time)         04:20:20  ███████████▓██████████▓██████████▓███████████▓███
                                                                                
Program                                                                         
═══════                                                                         
urxvt                02:38:00  ███████████▓██████████▓██████▊···÷···········÷···
google-chrome        01:21:40  ···········÷··········÷······▐███▓██████████▉÷···
app_element_io       00:14:40  ···········÷··········÷··········÷···········▓█▉·
(3 entries omitted)  00:06:00  ···········÷··········÷··········÷···········÷·▕█
                                                                                
(total time)         04:20:20  ███████████▓██████████▓██████████▓███████████▓███

custom inputs

$ arbtt-chart --totals-re='^\(' <<END
> Tag,Time
> Act:Work,02:30:00
> Act:Social,01:20:00
> Act:Mail,00:20:00
> Act:Movie,01:30:00
> (screen),05:40:00
> 
> Tag,Time
> Act:Sport,3600
> Act:Commute,1800
> (outside),5400
> END
Act                                                                             
═══                                                                             
Work       02:30:00  ████████▓███████▓███▋···÷·······÷········÷·······÷·······÷·
Movie      01:30:00  ········÷·······÷···▐███▓███████▉········÷·······÷·······÷·
Social     01:20:00  ········÷·······÷·······÷·······▕████████▓█▊·····÷·······÷·
Sport      01:00:00  ········÷·······÷·······÷·······÷········÷·▕█████▓██·····÷·
Commute    00:30:00  ········÷·······÷·······÷·······÷········÷·······÷··████▏÷·
Mail       00:20:00  ········÷·······÷·······÷·······÷········÷·······÷······█▓▊
                                                                                
(screen)   05:40:00  ████████▓███████▓███████▓███████▓████████▓████▊··÷·······÷·
(outside)  01:30:00  ████████▓███▍···÷·······÷·······÷········÷·······÷·······÷·

custom inputs, multiple tables at same scale

$ arbtt-chart <<END
> Tag,Time
> Screen:Work,02:30:00
> Screen:Social,01:20:00
> Screen:Mail,00:20:00
> Screen:Movie,01:30:00
> (total time),05:40:00
> 
> Tag,Time
> Outside:Sport,3600
> Outside:Commute,1800
> (total time),5400
> END
Screen                                                                          
══════                                                                          
Work          02:30:00  █████████▓█████████▓████▊····÷·········÷·········÷······
Movie         01:30:00  ·········÷·········÷····▐████▓█████████▍·········÷······
Social        01:20:00  ·········÷·········÷·········÷·········▐█████████▓██▊···
Mail          00:20:00  ·········÷·········÷·········÷·········÷·········÷··▐██▉
                                                                                
(total time)  05:40:00  █████████▓█████████▓█████████▓█████████▓█████████▓██████
                                                                                
Outside                                                                         
═══════                                                                         
Sport         01:00:00  █████████▓·········÷·········÷·········÷·········÷······
Commute       00:30:00  ·········▕████▊····÷·········÷·········÷·········÷······
                                                                                
(total time)  01:30:00  █████████▓████▉····÷·········÷·········÷·········÷······

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arbtt-chart-1.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

arbtt_chart-1.0.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file arbtt-chart-1.0.2.tar.gz.

File metadata

  • Download URL: arbtt-chart-1.0.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for arbtt-chart-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c0a7cdd1801095ea3a2f7409b7e099410cafb15668537bba5a19476910f9f964
MD5 6989237418d80416d0f253ae180fef22
BLAKE2b-256 1519bfbca0110be0a38a612253e6ada0499ffcaf538646111da818540de4dc31

See more details on using hashes here.

File details

Details for the file arbtt_chart-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: arbtt_chart-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for arbtt_chart-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 730e1a9307a918de13ba8d1d71f02670c739a2b6044a4bbafa1c4610d49c2753
MD5 c1ce2aca0f004c3c0cb8ebbd08f50530
BLAKE2b-256 1edf2da2dea79279fe4a96d2a5d8b52efb058056b7c6dc936496516e72bb2e16

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page