richcat-dev / richcat

rich cat command working on Python
https://richcat-dev.github.io/richcat/
MIT License
6 stars 1 forks source link

Python package codecov Codacy Badge Downloads

richcat

Features

Syntax hilighting

image

Support viewer

Markdown CSV Jupyter Notebook
image image image

Automatic paging

By default, richcat pipes its own output to a pager. If you wouldn't rather pager, use --style=nopager option.

image

Support Python import

Import on Python console:

image

Import on Jupyter Lab:

image

Installation

pip install richcat

Usage

Display a file contents on the terminal.

example:

richcat table.csv

Use -t option, you can choose highlight.

example:

richcat table.csv -t text

Use --style=header option if you use the header in a CSV file.

example:

richcat table.csv --style=header
--style=noheader (default) --style=header
image image

If you want to use richcat in Python, you can use the following example.

example:

>>> from richcat import richcat
>>> richcat("table.csv")

Options

The options that can be specified in richcat are as follows:

option explanation example
-h, --help Show help in English.
-V, --version Show version.
-t, --filetype <STRING> Specify file type. --filetype python
-w, --width <INT or FLOAT> Set print width.
If width>1, set print width direct.
If width<1, set print width percent.'
--width 80, --width 0.5
-c, --color-system <STRING> Choose color system.
['standard', '256', 'truecolor', 'windows']
--style <STRING> Set styles.
['[no]header', '[no]pager']
--style=header,nopager

Development

If you want to develop richcat, please follow the steps below.

  1. Build the development environment.
$ git clone git@github.com:richcat-dev/richcat.git
$ docker-compose build
  1. Start the development environment.
$ docker-compose up -d
  1. Go inside the launched Docker container to develop.
$ docker exec -it <CONTAINER_ID> /bin/bash

You can view the API document of richcat under development at the following URL.

You can update richcat API documentation with the following command.

$ cd ~
$ make sphinx-apidoc

Contributors