Color text streams with a polished command line interface

Overview

colout(1) -- Color Up Arbitrary Command Output

Synopsis

colout [-h] [-r RESOURCE]

colout [-g] [-c] [-l min,max] [-a] [-t] [-T DIR] [-P DIR] [-d COLORMAP] [-s] [-e CHAR] [-E CHAR] [--debug] PATTERN [COLOR(S) [STYLE(S)]]

Description

colout read lines of text stream on the standard input and output characters matching a given regular expression PATTERN in given COLOR and STYLE.

If groups are specified in the regular expression pattern, only them are taken into account, else the whole matching pattern is colored.

You can specify several colors or styles when using groups by separating them with commas. If you indicate more colors than groups, the last ones will be ignored. If you ask for fewer colors, the last one will be duplicated across remaining groups.

Available colors are: blue, black, yellow, cyan, green, magenta, white, red, rainbow, random, Random, Spectrum, spectrum, scale, Scale, hash, Hash, none, an RGB hexadecimal triplet (#11aaff, for example) or any number between 0 and 255.

Available styles are: normal, bold, faint, italic, underline, blink, rapid_blink, reverse, conceal or random (some styles may have no effect, depending on your terminal).

In some case, you can indicate a foreground and a background color, by indicating boths colors separated by a period(for example: red.blue). You can also use this system to combine two styles (for example, for a bold style that also blinks: bold.blink).

rainbow will cycle over a the default colormap at each matching pattern. Rainbow will do the same over the default colormap for the 256-colors mode (this requires a terminal that supports the 256 color escape sequences).

Random will color each matching pattern with a random color among the default colormap (the 255 available in the ANSI table, by default). random will do the same in 8 colors mode.

spectrum and Spectrum are like rainbows, but with more colors (8 and 36 colors).

scale (8 colors) and Scale (256 colors) will parse the numbers characters in the matching text as a decimal number and apply the default colormap according to its position on the scale defined by the -l option (see below, "0,100" by default).

hash (8 colors) and Hash (256 colors) will take a fingerprint of the matching text and apply the default colormap according to it. This ensure that matching texts appearing several times will always get the same color.

Before interpreting the matched string as a number, colout will remove any character not supposed to be used to write down numbers. This permits to apply this special color on a large group, while interpreting only its numerical part.

You can use the name of a syntax-coloring "lexer" as a color (for example: "Cpp", "ruby", "xml+django", etc.).

If GIMP palettes files (*.gpl) are available, you can also use their names as a colormap (see the -P switch below).

Note that the RGB colors (either the hex triplets or the palettes's colors) will be converted to their nearest ANSI 256 color mode equivalents.

When not specified, a COLOR defaults to red and a STYLE defaults to bold.

colout comes with some predefined themes to rapidly color well-known outputs (see the -t switch below).

colout can be used as an interface to pygments (see also the --source switch below).

To have a list of all colors, styles, special colormaps, themes, palettes and lexers, use the -r switch (see below).

colout is released under the GNU Public License v3.

Installation

The reccomended method is using pipsi

pipsi install colout

Another method is to use pip to install the package for the local user:

pip install --user colout

There is also a PPA for Ubuntu 16.04 (Xenial)/18.04 (Bionic)

sudo add-apt-repository ppa:csaba-kertesz/random
sudo apt-get update
sudo apt-get/aptitude install colout

Options

  • -h, --help: Show a help message and exit

  • -g, --groups: For color maps (like "rainbow"), iterate over matching groups in the pattern instead of over patterns.

  • -c, --colormap: Use the given list of comma-separated colors as a colormap (cycle the colors at each match).

  • -l min,max, --scale min,max: When using the 'scale' colormap, parse matches as decimal numbers (taking your locale into account) or as arithmetic expression (like "1+2/0.9*3") and apply the rainbow colormap linearly between the given min,max (0,100, by default).

  • -a, --all: Color the whole input at once instead of line per line (really useful for coloring a source code file with strings on multiple lines).

  • -t, --theme: Interpret PATTERN as a predefined theme (perm, cmake, g++, etc.).

  • -T DIR, --themes-dir DIR: Search for additional themes (colout_*.py files) in this directory.

  • -P DIR, --palettes-dir DIR: Search for additional palettes (*.gpl files) in this directory.

  • -d COLORMAP, --default COLORMAP: When using special colormaps (random, scale or hash), use this COLORMAP instead of the default one. This can be either one of the available colormaps or a comma-separated list of colors. WARNING: be sure to specify a default colormap that is compatible with the special colormap's mode, or else the colors may not appear the same. Also, external palettes are converted from RGB to 256-ANSI and will thus not work if you use them as default colormaps for a 8-colors mode special color.

  • -r TYPE(S), --resources TYPE(S): Print the names of available resources. Use a comma-separated list of resources names (styles, colors, special, themes, palettes, colormaps or lexers), use 'all' to print everything.

  • -s, --source: Interpret PATTERN as source code readable by the Pygments library. If the first letter of PATTERN is upper case, use the 256 color mode, if it is lower case, use the 8 colors mode. In 256 color mode, interpret COLOR as a Pygments style (e.g. "default").

  • -e CHAR, --sep-list CHAR: Use this character as a separator for list of colors/resources/numbers (instead of comma).

  • -E CHAR, --sep-pair CHAR: Use this character as a separator for foreground/background pairs (instead of period).

  • --debug: Debug mode: print what's going on internally, if you want to check what features are available.

Regular expressions

A regular expression (or regex) is a pattern that describes a set of strings that matches it.

colout understands regex as specified in the re python module. Given that colout is generally called by the command line, you may have to escape special characters that would be recognize by your shell.

Dependencies

Necessary Python modules:

  • pygments for the source code syntax coloring
  • babel for a locale-aware number parsing

Limitations

Don't use nested groups or colout will duplicate the corresponding input text with each matching colors.

Using a default colormap that is incompatible with the special colormap's mode (i.e. number of colors) will end badly.

Color pairs ("foreground.background") work in 8-colors mode for simple coloring, but may fail with --colormap.

Examples

Simple

  • Color in bold red every occurrence of the word color in colout sources: cat colout.py | colout color red bold

  • Color in bold violet home directories in /etc/passwd: colout '/home/[a-z]+' 135 < /etc/passwd

  • Color in yellow user/groups id, in bold green name and in bold red home directories in /etc/passwd: colout ':x:([0-9]+:[0-9]+):([^:]+).*(/home/[a-z]+)' yellow,green,red normal,bold < /etc/passwd

  • Color in yellow file permissions with read rights for everyone: ls -l | colout '.(r.-){3}' yellow normal

  • Color in green read permission, in bold red write and execution ones: ls -l | colout '(r)(w*)(x*)' green,red normal,bold

  • Color in green comments in colout sources: colout '.*(#.*)$' green normal < colout.py

  • Color in bold green every numbers and in bold red the words error in make output: make 2>&1 | colout '[0-9]+' green normal | colout error

Somewhat useful

  • Use a different color for each line of the auth log grep user /var/log/auth.log | colout "^.*$" rainbow

  • Color each line of a file with a different color among a 256 color gradient from cyan to green: head /var/log/auth.log | colout -c "^.*$" 39,38,37,36,35,34

  • Color permissions with a predefined template: ls -l | colout -t perm

  • Color in light green comments in non-empty colout sources, with the sharp in bold green: grep -v '^\s*$' colout.py | colout '.*(#)(.*)$' green,119 bold,normal

  • Color a make output, line numbers in yellow, errors in bold red, warning in magenta, pragma in green and C++ file base names in cyan: make 2>&1 | colout ':([0-9]+):[0-9]*' yellow normal | colout error | colout warning magenta | colout pragma green normal | colout '/(\w+)*\.(h|cpp)' cyan normal Or using themes: make 2>&1 | colout -t cmake | colout -t g++

  • Color each word in the head of auth.log with a rainbow color map, starting a new colormap at each new line (the beginning of the command is just bash magic to repeat the string "(\w+)\W+": L=$(seq 10) ; P=${L//??/(\\w+)\\W+} ; head /var/log/auth.log | colout -g "^${P}(.*)$" rainbow

  • Color source code in 8 colors mode, without seeing comments: cat colout.py | grep -v "#" | colout -s python

  • Color source code in 256 color mode: cat colout.py | colout -s Python monokai

  • Color a JSON stream: echo '{"foo": "lorem", "bar":"ipsum"}' | python -mjson.tool | colout -t json

  • Color a source code substring: echo "There is an error in 'static void Functor::operator()( EOT& indiv ) { return indiv; }' you should fix it" | colout "'(.*)'" Cpp monokai

  • Color the percent of progress part of a CMake's makefile output, with a color related to the value of the progress (from 0%=blue to 100%=red): cmake .. && make | colout "^(\[\s*[0-9]+%\])" Scale

  • Color hosts and users in auth.log, with consistent colors: cat /var/log/auth.log | colout "^(\S+\s+){3}(\S+)\s(\S+\s+){3}(\S+)\s+(\S+\s+){2}(\S+)\s*" none,hash,none,hash,none,hash

Bash alias

The following bash function color the output of any command with the cmake and g++ themes:

function cm()
{
    set -o pipefail
    $@ 2>&1  | colout -t cmake | colout -t g++
}

You then can use the cm alias as a prefix to your build command, for example: cm make test

GDB integration

You can use colout within the GNU debuger (gbd) to color its output. For example, the following script .gdbinit configuration will color the output of the backtrace command:

set confirm off

# Don't wrap line or the coloring regexp won't work.
set width 0

# Create a named pipe to get outputs from gdb
shell test -e /tmp/coloutPipe && rm /tmp/coloutPipe
shell mkfifo /tmp/coloutPipe

define logging_on
  # Instead of printing on stdout only, log everything...
  set logging redirect on
  # ... in our named pipe.
  set logging on /tmp/coloutPipe
end

define logging_off
  set logging off
  set logging redirect off
  # Because both gdb and our commands are writing on the same pipe at the same
  # time, it is more than probable that gdb will end before our (higher level)
  # commands.  The gdb prompt will thus render before the result of the command,
  # which is highly akward. To prevent this, we need to wait before displaying
  # the prompt again.  The more your commands are complex, the higher you will
  # need to set this.
  shell sleep 0.4s
end

define hook-backtrace
    # Note: match path = [path]file[.ext] = (.*/)?(?:$|(.+?)(?:(\.[^.]*)|))
    # This line color highlights:
    # – lines that link to source code,
    # – function call in green,
    # – arguments names in yellow, values in magenta,
    # — the parent directory in bold red (assuming that the debug session would be in a "project/build/" directory).
    shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal | colout "/($(basename $(dirname $(pwd))))/" red bold &
    logging_on
end
define hookpost-backtrace
    logging_off
end

# Don't forget to clean the adhoc pipe.
define hook-quit
    set confirm off
    shell rm -f /tmp/coloutPipe
end

Take a look at the example.gdbinit file distributed with colout for more gdb commands.

Themes

You can easily add your own theme to colout. A theme is basically a module with a function named theme that take the configuration context as an argument and return back the (modified) context and a list of triplets. Each triplet figures the same arguments than those of the command line interface.

def theme(context):
    return context,[ [regexp, colors, styles] ]

With the context dictionary at hand, you have access to the internal configuration of colout, you can thus change colormaps for special keywords, the scale, even the available colors, styles or themes.

See the cmake theme for how to modify an existing colormap if (and only if) the user didn't ask for an alternative one. See the ninja theme for how to extend an existing theme with more regexps and a different configuration. See the gcc theme for an example of how to use the localization of existing softwares to build translated regexp.

Buffering

Note that when you use colout within real time streams (like tail -f X | grep Y | colout Z) of commands, you may observe that the lines are printed by large chunks and not one by one, in real time. This is not due to colout but to the buffering behavior of your shell. To fix that, use stdbuf, for example: tail -f X | stdbuf -o0 grep Y | colout Z.

Authors

Comments
  • Rainbow is strange in my command line

    Rainbow is strange in my command line

    There is a usage about Rainbow in http://nojhan.github.io/colout/ shows that, the "###"would be beautiful likes rainbow: progress_Rainbow.png

    But it strange in my commandline, screenshot is: abc

    What happens? Should I configure something? Thanks!!

    By the way, can I add the colout in alias? For example,add it with ls / cat / tail / head ... If yes, how can I do?

    bug question 
    opened by woainvzu 10
  • Pypi package for 0.4 is different from Github tag v0.4

    Pypi package for 0.4 is different from Github tag v0.4

    One consequence is that some bugs fixed on Github's v0.4 tag are not fixed on Pypi (e.g. UnicodeDecodeError).

    v=0.4
    gh_url=https://codeload.github.com/nojhan/colout/zip/v$v
    pp_url=https://pypi.python.org/packages/source/c/colout/colout-$v.tar.gz
    curl -s $gh_url -o /tmp/$v.gh.zip
    curl -s $pp_url -o /tmp/$v.pp.tar.gz
    unzip -qo /tmp/$v.gh.zip -d /tmp/$v.gh
    mkdir -p /tmp/$v.pp && tar xf /tmp/$v.pp.tar.gz -C /tmp/$v.pp
    diff -r /tmp/$v.{gh,pp} -y --suppress-common-lines
    
    opened by louiskenzo 7
  • prevent No such file or directory: 'README.md' on install

    prevent No such file or directory: 'README.md' on install

    This should prevent the following error,

    $ pip --version
    pip 18.1 from /Users/jq/.pyenv/versions/3.6.5/envs/jupyter/lib/python3.6/site-packages/pip (python 3.6)
    $ pip install colout
    Collecting colout
      Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB)
        100% |████████████████████████████████| 51kB 970kB/s
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/setup.py", line 25, in <module>
            long_description=open('README.md').read(),
        FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
    
        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/
    

    I tested this locally, by clone of this repository, change to folder parent of the repository, install from relative folder, ./colout, where README.md is not found:

    $ pip install --upgrade --force-reinstall ./colout/
    

    Without patch, fails, with patch, succeeds.

    opened by jquast 5
  • Failed to install with pip

    Failed to install with pip

    Recommended way to install with pip fails.

    $ sudo pip install colout
    Collecting colout
      Using cached colout-0.5.tar.gz
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-ob3xy1/colout/setup.py", line 25, in <module>
            long_description=open('README.md').read(),
        IOError: [Errno 2] No such file or directory: 'README.md'
        
        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ob3xy1/colout/
    
    question help wanted 
    opened by sanmai 5
  • Option to run only when stdout is terminal

    Option to run only when stdout is terminal

    I'd like the command line switch that does the equivalent of --color=auto in grep and ls, which makes colout becomes no-op if the output isn't connected to a terminal.

    This allows me to automatically enable colout for normal command line use without messing up my scripts.

    enhancement question wontfix 
    opened by kohsuke 5
  • Add launcher script

    Add launcher script

    I tried to package this program in Ubuntu, and found that it has no startup script. So I added a colout script that gets installed into the scripts directory with the setup.py.

    opened by martin-ueding 5
  • Prepare for new `colout` version

    Prepare for new `colout` version

    Because there is a weird v0.11 tag, we pick the next version v0.12.0, instead of the "real" next version aka v0.7.0

    This project is considered to use Semantic Versioning (https://semver.org/) (https://semver.org/spec/v2.0.0.html as of now)

    Python versioning updates:

    • Unify that package is offered for >=Python3.5 2.7 support was dropped in dab5555503b07fe3e1f730a2bdebd97f4b535c8c, and <3.5 versions do not exist in https://devguide.python.org/#status-of-python-branches as of committing time

    • Add some classifiers (YMMV, my first pip package)

    • Add some bare-bones tox configuration (YMMV, my first tox interaction)

    • Add packages required for packaging/deployment in requirements-build.txt

    • README.md is not required to be packaged anymore - it is read at install time

      • Fix Content-Type for PyPI
    • Update README.md:

      • Reorder installation options (pip > pipsi > ppa)
      • Hard wrap at 100 chars for "meaningful" offences.
      • Add myself as maintainer
      • Remove escapes that don't make sense in CommonMark (GFM, as project is hosted in Github)
      • Fix typos
    • Add a more complete .gitignore file

    opened by stdedos 4
  • replace elipses with three periods

    replace elipses with three periods

    elipses was causing exceptions when trying to print the help message: UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 345: ordinal not in range(256) Replaced them with three periods so folks can get help messages

    invalid question 
    opened by prubel 4
  • Alternative colors in output

    Alternative colors in output

    Hey, I'm not sure if colout is capable of just highlighting a new output.. say we have

    tail -f /var/log/apache2/error.log

    after it updates another output, it should alternate to another colors. like group it. Do you think it's possible?

    enhancement 
    opened by neilborromeo 4
  • Tests and release tweaks

    Tests and release tweaks

    This adds some changes to help with with dev/releases:

    • get the package version from git, rather than being hard coded
    • add package classifiers
    • use Travis to run smoke tests (you'll have to set it up, but it is trivial)
    • build package wheel
    • replace shell script so the package will work with pipsi
    • only recommend installing with pipsi or pip

    The package may be compatible with 2.7 and 3.3+, versions lower than that will at least have syntax issues - simple colouring works in these versions (covered by smoke tests).

    This also changes what happens when you run publish from setup.py, it will now build a wheel instead of a source distribution.

    I noticed there have been a couple of tagged releases, but no corresponding releases on pypi - if you'd like a hand with it let me know.

    opened by Code0x58 3
  • [colout] ERROR: unknown color: Cpp

    [colout] ERROR: unknown color: Cpp

    Installed the latest master (commit b193ce4885dcd312f2a8a49deaec38992d469000) and I have the error

    [colout] ERROR: unknown color: Cpp

    when I use

    make -j6 2>&1 | colout -t cmake | colout -t g++

    opened by fmorency 3
  • Custom color selectors support

    Custom color selectors support

    I've starting create color themes for kubectl commands. The first one is kubectl get pods. But I can't create some logic without custom color selectors (like Scale or Rainbow). For example I need two digits comparer that will choose color by percentage ranges. I've created BaseSelector and PercentSelector as child of BaseSelector. BaseSelector should be a parent for any custom selectors. I've push this selectors into context and now it is possible to create any custom selectors inside colout_.py files. Example of usage for custom selectors is kubectlpods theme. For example kubectl get pods |colout.py -t kubectlpods

    opened by Tolyar 5
  • Developing new themes

    Developing new themes

    I am developing a theme to colorize Zabbix log files. What would be the best way to do it? Would you like me to create a pull request with this new theme (in this case I will proceed with development in a fork of your repository) or do you prefer keeping custom themes for not-that-commonly-used applications out of the mainstream repository (in which case I will create my own theme-only repository like dabrady/colout-themes and cym13/colout-templates)?

    opened by i-ky 0
  • Hanging when process writing into pipe has exited

    Hanging when process writing into pipe has exited

    I use the command like this one:

    $ ./my_script.py 2>&1 | colout -t cmake | colout -t g++ | colout -s Xml
    

    Sometimes this command hangs. In the process list I don't see my_script, only colout processes:

    develop+ 14887  0.0  0.0  12664  3068 pts/4    S+   14:17   0:00 /bin/bash /usr/local/bin/colout -t cmake
    develop+ 14888  0.0  0.0  12664  3080 pts/4    S+   14:17   0:00 /bin/bash /usr/local/bin/colout -t g++
    develop+ 14889  0.0  0.0  12664  2972 pts/4    S+   14:17   0:00 /bin/bash /usr/local/bin/colout -s Xml
    develop+ 14890  0.2  0.4  59708 22988 pts/4    S+   14:17   0:00 python3 -m colout.colout -t cmake
    develop+ 14891  0.2  0.4  59848 23324 pts/4    S+   14:17   0:00 python3 -m colout.colout -t g++
    develop+ 14892  0.2  0.4  59704 23060 pts/4    S+   14:17   0:00 python3 -m colout.colout -s Xml
    

    Doing

    $ sudo strace -p 14890
    

    reveals that this process is doing read(0.

    colout was installed from GitHub. OS is Ubuntu 16.04.

    opened by i-ky 0
  • `colout` is missing the `gray` color

    `colout` is missing the `gray` color

    In some version of colout, I was able to write:

    cat /proc/misc | colout cpu gray
    

    And have the output formatted as gray. However, today it seems unable:

    # cat /proc/misc | colout cpu gray
    234 btrfs-control
     56 memory_bandwidth
     57 network_throughput
     58 network_latency
    [colout] ERROR: Unknown color: gray (maybe you forgot to install python3-pygments?)
    
    

    Neither 0.6.1-3~xenial7 nor 0.6.2.dev21+g70bec38 (aka stdedos/[email protected] aka nojhan/[email protected] + 2) seem to contain it.

    # colout -r all
    STYLES: blink, bold, conceal, faint, italic, normal, rapid_blink, reverse, underline
    COLORS: black, blue, cyan, green, magenta, none, orange, purple, red, white, yellow
    SPECIAL: colormap, Hash, hash, Random, random, Scale, scale
    THEMES: clang, cmake, configure, ctest, g++, javac, json, latex, ninja, perm, python, valgrind
    COLORMAPS: Default, default, Hash, hash, jet72, Rainbow, rainbow, Random, random, Scale, scale, Spectrum, spectrum
    SYNTAX COLORING: abap, abnf, ada, adl, agda, aheui, ahk, alloy, ampl, antlr-as, antlr-cpp, antlr-csharp, antlr-java, antlr-objc, antlr-perl, antlr-python, antlr-ruby, antlr, apacheconf, apl, applescript, arduino, as3, as, aspectj, aspx-cs, aspx-vb, asy, at, autoit, awk, basemake, bash, bat, bbcode, bc, befunge, bib, blitzbasic, blitzmax, bnf, boo, boogie, brainfuck, bro, bst, bugs, c-objdump, ca65, cadl, camkes, capdl, capnp, cbmbas, c, ceylon, cfc, cfengine3, cfm, cfs, chai, chapel, cheetah, cirru, clay, clean, clojure, clojurescript, cmake, cobol, cobolfree, coffee-script, common-lisp, componentpascal, console, control, coq, cpp-objdump, cpp, cpsa, cr, crmsh, croc, cryptol, csharp, csound-document, csound-score, csound, css+django, css+erb, css+genshitext, css+lasso, css+mako, css+mozpreproc, css+myghty, css+php, css+smarty, css, cucumber, cuda, cypher, cython, d-objdump, dart, d, delphi, dg, diff, django, docker, doscon, dpatch, dtd, duel, dylan-console, dylan-lid, dylan, earl-grey, easytrieve, ebnf, ec, ecl, eiffel, elixir, elm, emacs, erb, erlang, erl, evoque, extempore, ezhil, factor, fancy, fan, felix, fish, flatline, forth, fortranfixed, fortran, foxpro, fsharp, gap, gas, genshi, genshitext, glsl, gnuplot, go, golo, gooddata-cl, gosu, groff, groovy, gst, haml, handlebars, haskell, haxeml, hexdump, hsail, html+cheetah, html+django, html+evoque, html+genshi, html+handlebars, html+lasso, html+mako, html+myghty, html+ng2, html+php, html+smarty, html+twig, html+velocity, html, http, hx, hybris, hylang, i6t, idl, idris, iex, igor, inform6, inform7, ini, io, ioke, irc, isabelle, jags, jasmin, java, javascript+mozpreproc, jcl, j, jlcon, js+cheetah, js+django, js+erb, js+genshitext, js+lasso, js+mako, js+myghty, js+php, js+smarty, jsgf, js, json-object, json, jsonld, jsp, julia, juttle, kal, kconfig, koka, kotlin, lagda, lasso, lcry, lean, less, lhs, lidr, lighty, limbo, liquid, live-script, llvm, logos, logtalk, lsl, lua, make, mako, maql, mask, mason, mathematica, matlab, matlabsession, md, minid, modelica, modula2, monkey, monte, moocode, moon, mozhashpreproc, mozpercentpreproc, mql, mscgen, mupad, mxml, myghty, mysql, nasm, ncl, nemerle, nesc, newlisp, newspeak, ng2, nginx, nim, nit, nixos, nsis, numpy, nusmv, objdump-nasm, objdump, objective-c++, objective-c, objective-j, ocaml, octave, odin, ooc, opa, openedge, pacmanconf, pan, parasail, pawn, perl6, perl, php, pig, pike, pkgconfig, plpgsql, postgresql, postscript, pot, pov, powershell, praat, prolog, properties, protobuf, ps1con, psql, pug, puppet, py3tb, pycon, pypylog, pytb, python3, python, qbasic, qml, qvto, racket, ragel-cpp, ragel-c, ragel-d, ragel-em, ragel-java, ragel-objc, ragel-ruby, ragel, raw, rbcon, rb, rconsole, rd, rebol, redcode, red, registry, resource, rexx, rhtml, rnc, roboconf-graph, roboconf-instances, robotframework, rql, rsl, rst, rts, rust, sas, sass, scala, scaml, scheme, scilab, sc, scss, shen, silver, slim, smali, smalltalk, smarty, sml, snobol, snowball, sourceslist, sparql, spec, splus, sp, sqlite3, sql, squidconf, ssp, stan, stata, swift, swig, systemverilog, tads3, tap, tasm, tcl, tcshcon, tcsh, tea, termcap, terminfo, terraform, tex, text, thrift, todotxt, trac-wiki, treetop, tsql, ts, turtle, twig, typoscriptcssdata, typoscripthtmldata, typoscript, urbiscript, vala, vb.net, vclsnippets, vcl, vctreestatus, velocity, verilog, vgl, vhdl, vim, wdiff, whiley, x10, xml+cheetah, xml+django, xml+erb, xml+evoque, xml+lasso, xml+mako, xml+myghty, xml+php, xml+smarty, xml+velocity, xml, xquery, xslt, xtend, xul+mozpreproc, yaml+jinja, yaml, zephir
    

    Output differs slightly between computers

    I could assume it is a python3-pygments issue, but I have no idea how to verify or "why" this happened.


    I know I could do something like cat /proc/misc | colout cpu '#xxxxxx' for x in [0-9a-f], but that is besides the point

    opened by stdedos 0
  • `pip install colout` is broken for everyone

    `pip install colout` is broken for everyone

    setup.py tries to read 'README.md', but no such file exists in the source dist package on PyPI.

    $ python3.7 -mpip install --user colout
    Collecting colout
      Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB)
        100% |████████████████████████████████| 51kB 736kB/s 
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-gfp0x0mf/colout/setup.py", line 25, in <module>
            long_description=open('README.md').read(),
        FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
        
        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-gfp0x0mf/colout/
    

    This is not limited to py3.7. Earlier versions fail in the same way.

    opened by tartley 16
Releases(v1.0)
  • v1.0(May 12, 2022)

    What's Changed

    • Fix a bug when loading some pygments’ syntax coloring lexers
    • Update the PPA information by @kecsap in https://github.com/nojhan/colout/pull/100
    • Tests and release tweaks by @Code0x58 in https://github.com/nojhan/colout/pull/98
    • Update colout.py to remove PY2 global by @linkmauve in https://github.com/nojhan/colout/pull/107
    • Papercut fixes in colout by @stdedos in https://github.com/nojhan/colout/pull/108
    • prevent No such file or directory: 'README.md' on install by @jquast in https://github.com/nojhan/colout/pull/102
    • Stop advertising python2 support by @linkmauve in https://github.com/nojhan/colout/pull/110

    New Contributors

    • @kecsap made their first contribution in https://github.com/nojhan/colout/pull/100
    • @linkmauve made their first contribution in https://github.com/nojhan/colout/pull/107
    • @stdedos made their first contribution in https://github.com/nojhan/colout/pull/108
    • @jquast made their first contribution in https://github.com/nojhan/colout/pull/102

    Full Changelog: https://github.com/nojhan/colout/compare/v0.6.1...v1.0

    Source code(tar.gz)
    Source code(zip)
Owner
nojhan
Maker, scientist, researcher in artificial intelligence algorithmics, illustrator, author, hacker, wikipedian, free culture enthusiast.
nojhan
Typer, build great CLIs. Easy to code. Based on Python type hints.

Typer, build great CLIs. Easy to code. Based on Python type hints. Documentation: https://typer.tiangolo.com Source Code: https://github.com/tiangolo/

Sebastián Ramírez 10.1k Jan 02, 2023
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.

Python Fire Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. Python Fire is a s

Google 23.6k Dec 31, 2022
Clint is a module filled with a set of awesome tools for developing commandline applications.

Clint: Python Command-line Interface Tools Clint is a module filled with a set of awesome tools for developing commandline applications. C ommand L in

Kenneth Reitz Archive 82 Dec 28, 2022
Color text streams with a polished command line interface

colout(1) -- Color Up Arbitrary Command Output Synopsis colout [-h] [-r RESOURCE] colout [-g] [-c] [-l min,max] [-a] [-t] [-T DIR] [-P DIR] [-d COLORM

nojhan 1.1k Dec 21, 2022
Python Command-line Application Tools

Clint: Python Command-line Interface Tools Clint is a module filled with a set of awesome tools for developing commandline applications. C ommand L in

Kenneth Reitz Archive 82 Dec 28, 2022
Library for building powerful interactive command line applications in Python

Python Prompt Toolkit prompt_toolkit is a library for building powerful interactive command line applications in Python. Read the documentation on rea

prompt-toolkit 8.1k Dec 30, 2022
Python library that measures the width of unicode strings rendered to a terminal

Introduction This library is mainly for CLI programs that carefully produce output for Terminals, or make pretend to be an emulator. Problem Statement

Jeff Quast 305 Dec 25, 2022
prompt_toolkit is a library for building powerful interactive command line applications in Python.

Python Prompt Toolkit prompt_toolkit is a library for building powerful interactive command line applications in Python. Read the documentation on rea

prompt-toolkit 8.1k Jan 04, 2023
Python and tab completion, better together.

argcomplete - Bash tab completion for argparse Tab complete all the things! Argcomplete provides easy, extensible command line tab completion of argum

Andrey Kislyuk 1.1k Jan 08, 2023
plotting in the terminal

bashplotlib plotting in the terminal what is it? bashplotlib is a python package and command line tool for making basic plots in the terminal. It's a

Greg Lamp 1.7k Jan 02, 2023
sane is a command runner made simple.

sane is a command runner made simple.

Miguel M. 22 Jan 03, 2023
Rich is a Python library for rich text and beautiful formatting in the terminal.

Rich 中文 readme • lengua española readme • Läs på svenska Rich is a Python library for rich text and beautiful formatting in the terminal. The Rich API

Will McGugan 41.4k Jan 02, 2023
A CLI tool to build beautiful command-line interfaces with type validation.

Piou A CLI tool to build beautiful command-line interfaces with type validation. It is as simple as from piou import Cli, Option cli = Cli(descriptio

Julien Brayere 310 Dec 07, 2022
Simple cross-platform colored terminal text in Python

Colorama Makes ANSI escape character sequences (for producing colored terminal text and cursor positioning) work under MS Windows. PyPI for releases |

Jonathan Hartley 3k Jan 01, 2023
A simple terminal Christmas tree made with Python

Python Christmas Tree A simple CLI Christmas tree made with Python Installation Just clone the repository and run $ python terminal_tree.py More opti

Francisco B. 64 Dec 27, 2022
A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team.

Roid 🤖 A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team. 🚀 Installation You can install roid in it's default

Harrison Burt 7 Aug 09, 2022
emoji terminal output for Python

Emoji Emoji for Python. This project was inspired by kyokomi. Example The entire set of Emoji codes as defined by the unicode consortium is supported

Taehoon Kim 1.6k Jan 02, 2023
Cement is an advanced Application Framework for Python, with a primary focus on CLI

Cement Framework Cement is an advanced Application Framework for Python, with a primary focus on Command Line Interfaces (CLI). Its goal is to introdu

Data Folk Labs, LLC 1.1k Dec 31, 2022
Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer.

Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer. The end goal is to be able to rapidly create rich termin

Will McGugan 17k Jan 02, 2023
Python library to build pretty command line user prompts ✨Easy to use multi-select lists, confirmations, free text prompts ...

Questionary ✨ Questionary is a Python library for effortlessly building pretty command line interfaces ✨ Features Installation Usage Documentation Sup

Tom Bocklisch 990 Jan 01, 2023