Giter VIP home page Giter VIP logo

nctok's Introduction

nctok

A program for interactive navigating through weighted hierarchical structured data and analyzing them. (weighted means that each item have its own value - number)

This is a nice tool for analyzing and researching datasets, and simplicity of input format makes it easy to write your own scripts that produces data you want to analyze fast, right in shell (like something in files, git meta data (number of commits per each file), etc. For more see examples).

Demo

File space usage:

Git commits per file, linux kernel 6.8 repo:

Features

  • interactive navigation
  • items sorted by their recursive weight-sums
  • accepts any data from stdin, so you can easily make your owns (see examples)
  • interface:
    • preview window (can be toggled)
    • human-readable big numbers formatting (can be toggled)

Usage

... | nctok

Where ... should produce output in format:

<number> <path/to/item>
<number> <path/to/another_item>

For concrete usecases see examples.

Keys/control

  • j/k - go down/up in list
  • l/h - go deep down/up (inside/out)
  • g - go to top (very first item)
  • G - go to bottom (latest item)
  • w - toggle preview window
  • a - toggle human-readable numbers formatting
  • q - quit

Configuration

$ nctok --help
...
Options:
      --reverse  Invert sort order
Parser:
      --number-delimiter <NUMBER_DELIMITER>
          Delimiter between items number value and path [default: " "]
      --path-separator <PATH_SEPARATOR>
          Separator in items path [default: /]
Interface:
      --preview
          Show preview window for entry under cursor (can also toggle with 'w' key)
      --no-human-readable
          Disable formatting big numbers in human-readable (can also toggle with 'a' key)

Installation

With cargo (from crates.io)

cargo install nctok

From sources

cargo install --path .

Inspiration

  • ncdu - (ncurses) disk usage analyzer. This is main source of inspiration. I took exactly their idea and made unified interface for analyzing any data with the same (and a bit better) interface.
  • vifm - terminal file manager. I took preview window from it.
  • tokei - lines-of-code counter. Well, at very first I wanted tokei+ncdu experience, so this project was born.

nctok's People

Contributors

unkwusr avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.