Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nushell-prophet/nu-history-tools

Nushell history tools!
https://github.com/nushell-prophet/nu-history-tools

cli history nushell

Last synced: 28 days ago
JSON representation

Nushell history tools!

Awesome Lists containing this project

README

        

nu-history-tools


Nushell๐Ÿš€ module for commands history analytics

A Nushell module to analyze the command frequencies in Nushell history, generate cool graphs, benchmark statistics with other users, and generate a file with statistics to share with the community.

Aggregated results, produced by the `aggregate-submissions` command can be found in the [csv file](https://github.com/nushell-prophet/nu-history-tools/tree/main/assets/script_results_examples/aggregated-submissions.csv)

The history of nushell commands by releases can be found in [this csv](https://github.com/nushell-prophet/nu-history-tools/blob/main/assets/crates_parsing/cmds_by_crates_and_tags.csv)

![nu-history-tools2](https://github.com/nushell-prophet/nu-history-tools/assets/4896754/5053ede0-d53a-46be-bd71-7f066eca7025)

## Installation

```nushell no-run
> git clone https://github.com/nushell-prophet/nu-history-tools; cd nu-history-tools; use nu-history-tools
```

## Analyze your stats and benchmark them with other users' submissions.

The output of `analyze-history` contains a lot of informational messages (as you can see in the next block).
These informational messages can be silenced using the `--quiet` flag.

```nushell
use nu-history-tools; let $res = nu-history-tools analyze-history; $res | first 10
```

Output:

```
*******************************************************************************
nu-commands-frequency-stats v0.2.1
*******************************************************************************

Your history is in sqlite format and will be used for analysis. Additionally,
you have history in txt format, which consists of 496 lines. It will be used
for analysis as well.

Your stats have been saved to
/Users/user/git/nu-history-tools/stats_submissions/v2+WriteYourNick.csv.
Please consider donating them to the original repository
https://github.com/nushell-prophet/nu-history-tools/tree/main/stats_submissions
.

*******************************************************************************
Aggregated stats of other users for benchmarks.
They will be displayed in the final table.
*******************************************************************************

freq_by_user (frequency norm by user) includes stats from all users. You can
pick some of them by providing the --pick_users flag: stats --pick_users or
aggregate-submissions --pick_users.

โ•ญโ”€#โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€userโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€command_entriesโ”€โ•ฎ
โ”‚ 0 โ”‚ maximuvarov โ”‚ 120938 โ”‚
โ”‚ 1 โ”‚ vinlet โ”‚ 33817 โ”‚
โ”‚ 2 โ”‚ fdncred โ”‚ 18538 โ”‚
โ”‚ 3 โ”‚ nu_scripts โ”‚ 11214 โ”‚
โ”‚ 4 โ”‚ kubouch โ”‚ 10170 โ”‚
โ”‚ 5 โ”‚ ErichDonGubler โ”‚ 10101 โ”‚
โ”‚ 6 โ”‚ chtenb โ”‚ 9376 โ”‚
โ”‚ 7 โ”‚ shinyzero0 โ”‚ 9247 โ”‚
โ”‚ 8 โ”‚ dazfuller โ”‚ 7354 โ”‚
โ”‚ 9 โ”‚ cptpiepmatz โ”‚ 4199 โ”‚
โ”‚ 10 โ”‚ zjp โ”‚ 2764 โ”‚
โ”‚ 11 โ”‚ sholderbach โ”‚ 2114 โ”‚
โ”‚ 12 โ”‚ horasal โ”‚ 1373 โ”‚
โ”‚ 13 โ”‚ nu_std โ”‚ 985 โ”‚
โ”‚ 14 โ”‚ pingiun โ”‚ 894 โ”‚
โ”‚ 15 โ”‚ nicokosi โ”‚ 255 โ”‚
โ•ฐโ”€#โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€userโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€command_entriesโ”€โ•ฏ
*******************************************************************************
Resulting table
*******************************************************************************
A note about some columns:
- freq - indicates the overall frequency of use of the given command for the
currently analyzed source
- freq_norm - represents the overall frequency normalized
- freq_norm_bar - shows the overall frequency normalized in a bar chart format
- timeline - displays the dynamics, indicating when the command was used
throughout your history
- importance - calculated as the geometric mean of the number of users who
used this command and the average normalized frequency
- freq_by_user (frequency norm by user) - each bar in the sparkline column
represents one user (order is shown in the table above).

โ•ญโ”€#โ”€โ”ฌโ”€โ”€nameโ”€โ”€โ”ฌโ”€โ”€categoryโ”€โ”€โ”ฌโ”€freqโ”€โ”ฌโ”€freq_normโ”€โ”ฌโ”€freq_norm_barโ”€โ”ฌโ”€โ”€timelineโ”€โ”€โ”€โ”ฌโ”€importanceโ”€โ”ฌโ”€importance_bโ”€โ”ฌโ”€โ”€โ”€freq_by_userโ”€โ”€โ”€โ•ฎ
โ”‚ 0 โ”‚ ls โ”‚ filesystem โ”‚ 7358 โ”‚ 1.00 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–…โ–ˆโ–†โ–†โ–…โ–†โ–†โ–‡โ–†โ–ƒโ– โ”‚ 1.00 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–‡โ–„โ–ˆโ–โ–ˆโ–ƒโ–โ–ˆโ–„โ–„โ–ˆโ–†โ–ˆโ–โ–†โ–‡ โ”‚
โ”‚ 1 โ”‚ get โ”‚ filters โ”‚ 7316 โ”‚ 0.99 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–†โ–ˆโ–†โ–…โ–…โ–ƒโ–ƒโ–ƒโ–ƒโ–ƒโ– โ”‚ 0.83 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–‡โ–ˆโ–…โ–‚โ–†โ–‚โ–โ–„โ–ƒโ–โ–‚โ–ƒโ–‚โ–ƒโ–‚โ–ˆ โ”‚
โ”‚ 2 โ”‚ open โ”‚ filesystem โ”‚ 6279 โ”‚ 0.85 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Œ โ”‚ โ–„โ–ˆโ–…โ–ƒโ–ƒโ–„โ–„โ–…โ–…โ–…โ– โ”‚ 0.79 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Œ โ”‚ โ–†โ–ˆโ–„โ–โ–„โ–‚โ–โ–„โ–ƒโ–†โ–‚โ–ƒโ–ƒโ–โ–‚โ–‡ โ”‚
โ”‚ 3 โ”‚ let โ”‚ core โ”‚ 4256 โ”‚ 0.58 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Š โ”‚ โ–†โ–ˆโ–…โ–‡โ–…โ–…โ–ƒโ–†โ–…โ–…โ– โ”‚ 0.64 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‹ โ”‚ โ–…โ–ƒโ–„โ–ˆโ–ƒโ–โ–โ–‚โ–โ–โ–‚โ–‚โ–‚โ–†โ–ƒโ– โ”‚
โ”‚ 4 โ”‚ each โ”‚ filters โ”‚ 4091 โ”‚ 0.56 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Œ โ”‚ โ–„โ–ˆโ–†โ–‡โ–†โ–…โ–„โ–‡โ–ˆโ–…โ– โ”‚ 0.57 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Š โ”‚ โ–…โ–ˆโ–ƒโ–‚โ–„โ–‚โ–โ–‚โ–โ–โ–‚โ–ƒโ–‚โ–‚โ–โ– โ”‚
โ”‚ 5 โ”‚ where โ”‚ filters โ”‚ 3648 โ”‚ 0.50 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–„โ–ˆโ–„โ–†โ–ˆโ–‡โ–†โ–‡โ–„โ–ˆโ– โ”‚ 0.51 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ– โ”‚ โ–‡โ–ˆโ–…โ–‚โ–…โ–‚โ–โ–ƒโ–ƒโ–‚โ–‚โ–…โ–ƒโ–ƒโ–โ– โ”‚
โ”‚ 6 โ”‚ upsert โ”‚ filters โ”‚ 2822 โ”‚ 0.38 โ”‚ โ–ˆโ–ˆโ–ˆโ–‰ โ”‚ โ–…โ–…โ–„โ–„โ–ˆโ–„โ–‚โ–โ–โ–โ– โ”‚ 0.17 โ”‚ โ–ˆโ–ˆ โ”‚ โ–ˆโ–…โ–ƒโ–‚โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ– โ”‚
โ”‚ 7 โ”‚ first โ”‚ filters โ”‚ 2404 โ”‚ 0.33 โ”‚ โ–ˆโ–ˆโ–ˆโ–Ž โ”‚ โ–„โ–ˆโ–…โ–ƒโ–…โ–ƒโ–ƒโ–ƒโ–ƒโ–‚โ– โ”‚ 0.27 โ”‚ โ–ˆโ–ˆโ–ˆโ–Ž โ”‚ โ–ˆโ–โ–„โ–‚โ–โ–‚โ–โ–โ–‚โ–„โ–ƒโ–ƒโ–โ–โ–โ– โ”‚
โ”‚ 8 โ”‚ polars โ”‚ dataframe โ”‚ 2303 โ”‚ 0.31 โ”‚ โ–ˆโ–ˆโ–ˆโ– โ”‚ โ–โ–โ–โ–โ–โ–โ–โ–ˆโ–„โ–โ– โ”‚ 0.05 โ”‚ โ–Œ โ”‚ โ–ˆโ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ–โ– โ”‚
โ”‚ 9 โ”‚ lines โ”‚ filters โ”‚ 2041 โ”‚ 0.28 โ”‚ โ–ˆโ–ˆโ–Š โ”‚ โ–‚โ–„โ–„โ–ƒโ–„โ–ƒโ–…โ–„โ–ƒโ–ˆโ– โ”‚ 0.45 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ– โ”‚ โ–ˆโ–ˆโ–†โ–‚โ–†โ–ˆโ–โ–‡โ–โ–…โ–‡โ–†โ–ƒโ–โ–โ– โ”‚
โ•ฐโ”€#โ”€โ”ดโ”€โ”€nameโ”€โ”€โ”ดโ”€โ”€categoryโ”€โ”€โ”ดโ”€freqโ”€โ”ดโ”€freq_normโ”€โ”ดโ”€freq_norm_barโ”€โ”ดโ”€โ”€timelineโ”€โ”€โ”€โ”ดโ”€importanceโ”€โ”ดโ”€importance_bโ”€โ”ดโ”€โ”€โ”€freq_by_userโ”€โ”€โ”€โ•ฏ
```

## Analyze submissions separately

```nushell
> use nu-history-tools; let $res2 = nu-history-tools aggregate-submissions --quiet; $res2 | first 5
โ•ญโ”€#โ”€โ”ฌโ”€nameโ”€โ”ฌโ”€โ”€categoryโ”€โ”€โ”ฌโ”€freq_overallโ”€โ”ฌโ”€users_countโ”€โ”ฌโ”€f_n_per_userโ”€โ”ฌโ”€โ”€โ”€freq_by_userโ”€โ”€โ”€โ”ฌโ”€importanceโ”€โ”ฌโ”€importance_bโ”€โ•ฎ
โ”‚ 0 โ”‚ ls โ”‚ filesystem โ”‚ 15045 โ”‚ 14 โ”‚ 0.62 โ”‚ โ–‡โ–„โ–ˆโ–โ–ˆโ–ƒโ–โ–ˆโ–„โ–„โ–ˆโ–†โ–ˆโ–โ–†โ–‡ โ”‚ 1.00 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚
โ”‚ 1 โ”‚ cd โ”‚ filesystem โ”‚ 8492 โ”‚ 15 โ”‚ 0.43 โ”‚ โ–‚โ–ƒโ–„โ–โ–‡โ–ƒโ–‚โ–โ–ˆโ–ˆโ–‡โ–„โ–„โ–โ–ˆโ– โ”‚ 0.87 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ– โ”‚
โ”‚ 2 โ”‚ get โ”‚ filters โ”‚ 13710 โ”‚ 16 โ”‚ 0.37 โ”‚ โ–‡โ–ˆโ–…โ–‚โ–†โ–‚โ–โ–„โ–ƒโ–โ–‚โ–ƒโ–‚โ–ƒโ–‚โ–ˆ โ”‚ 0.83 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚
โ”‚ 3 โ”‚ open โ”‚ filesystem โ”‚ 12561 โ”‚ 15 โ”‚ 0.36 โ”‚ โ–†โ–ˆโ–„โ–โ–„โ–‚โ–โ–„โ–ƒโ–†โ–‚โ–ƒโ–ƒโ–โ–‚โ–‡ โ”‚ 0.79 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Œ โ”‚
โ”‚ 4 โ”‚ help โ”‚ core โ”‚ 3397 โ”‚ 14 โ”‚ 0.29 โ”‚ โ–‚โ–‚โ–…โ–โ–ƒโ–โ–โ–‚โ–‚โ–‚โ–ƒโ–ˆโ–โ–โ–‡โ–ˆ โ”‚ 0.69 โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Ž โ”‚
โ•ฐโ”€#โ”€โ”ดโ”€nameโ”€โ”ดโ”€โ”€categoryโ”€โ”€โ”ดโ”€freq_overallโ”€โ”ดโ”€users_countโ”€โ”ดโ”€f_n_per_userโ”€โ”ดโ”€โ”€โ”€freq_by_userโ”€โ”€โ”€โ”ดโ”€importanceโ”€โ”ดโ”€importance_bโ”€โ•ฏ
```