Command Line Program Documentation
purdy
Command
Displays a highlighted version of python text to the screen as if it is being typed
usage: purdy [-h] [--version] [-l {con,py3,bash,dbash,node,yaml,rst,md,none}]
[--maxheight MAXHEIGHT] [-c] [-x16] [-d DELAY | -w WPM]
[--variance VARIANCE]
filename
Positional Arguments
- filename
Name of file to parse
Named Arguments
- --version
show program’s version number and exit
- -l, --lexer
Possible choices: con, py3, bash, dbash, node, yaml, rst, md, none
Name of lexer to use to parse the file. Choices are: “con” (Python 3 Console), “py3” (Python 3 Source), “bash” (Bash Console), “dbash” (Bash Console with a dollar-sign prompt), “node” (JavaScript Node.js Console), “yaml” (YAML Doc), “rst” (RST Doc), “md” (Markdown Doc), “none” (No Parsing). If no choice given, attempts to determine the result automatically. If it cannot detect it, it assumes Python 3.
Default: “detect”
- --maxheight
Sets a maximum screen height for the TUI screen viewer. Ignored if not in TUI mode.
Default: 0
- -c, --continuous
Instead of prentending to type like a human, just dump the file to the screen
Default: False
- -x16
Force 16 colour terminal mode in case 256 is not working to the screen
Default: False
- -d, --delay
Amount of time between each letter when in typewriter mode. Specified in milliseconds. Defaults to 130ms
- -w, --wpm
Number of words per minute that the typing speed should look like
- --variance
To make the typing look more real there is a variance in the delay between keystrokes. This value, in milliseconds is how much to go over or under the delay by. Defaults to +/- 30ms
pat
Command
This command prints ANSI colourized versions of a file, parsing the file based on a limited number of pygments lexers. ‘pat’ is part of the ‘purdy’ library. A list of supported lexers is available in the help. If no lexer is specified the library attempts to determine which lexer to use automatically.
usage: pat [-h] [-l {con,py3,bash,dbash,node,yaml,rst,md,none}] [--version]
[--num NUM] [--highlight HIGHLIGHT]
filename
Positional Arguments
- filename
Name of file to parse
Named Arguments
- -l, --lexer
Possible choices: con, py3, bash, dbash, node, yaml, rst, md, none
Name of lexer to use to parse the file. Choices are: “con” (Python 3 Console), “py3” (Python 3 Source), “bash” (Bash Console), “dbash” (Bash Console with a dollar-sign prompt), “node” (JavaScript Node.js Console), “yaml” (YAML Doc), “rst” (RST Doc), “md” (Markdown Doc), “none” (No Parsing). If no choice given, attempts to determine the result automatically. If it cannot detect it, it assumes Python 3.
Default: “detect”
- --version
show program’s version number and exit
- --num
Display line numbers with code starting with the value given here
Default: -1
- --highlight, --hl
Highlight certain line numbers when displaying the code. Line numbers are 1-indexed. Multiple lines can be higlighted using a hyphen for range (e.g. 1-4, inclusive) or a comma separated list (e.g. 1-4,7,9 is line 1, 2, 3, 4, 7 and 9).
prat
Command
This command prints colourized RTF version of a file, parsing the file based on a limited number of pygments lexers. ‘prat’ is part of the ‘purdy’ library. A list of supported lexers is available in the help. If no lexer is specified the library attempts to determine which lexer to user automatically.
usage: prat [-h] [-l {con,py3,bash,dbash,node,yaml,rst,md,none}] [--version]
[--num NUM] [--background BACKGROUND] [--highlight HIGHLIGHT]
filename
Positional Arguments
- filename
Name of file to parse
Named Arguments
- -l, --lexer
Possible choices: con, py3, bash, dbash, node, yaml, rst, md, none
Name of lexer to use to parse the file. Choices are: “con” (Python 3 Console), “py3” (Python 3 Source), “bash” (Bash Console), “dbash” (Bash Console with a dollar-sign prompt), “node” (JavaScript Node.js Console), “yaml” (YAML Doc), “rst” (RST Doc), “md” (Markdown Doc), “none” (No Parsing). If no choice given, attempts to determine the result automatically. If it cannot detect it, it assumes Python 3.
Default: “detect”
- --version
show program’s version number and exit
- --num
Display line numbers with code starting with the value given here
Default: -1
- --background, --bg
Change the background colour of the document. When using the –highlight option, you you should also set a background colour, otherwise the background will turn white due to how RTF supports colouring. Format of the colour is like an HTML colour, e.g. #c1b455, without the leading #
- --highlight, --hl
Highlight certain line numbers when displaying the code. Line numbers are 1-indexed. Multiple lines can be higlighted using a hyphen for range (e.g. 1-4, inclusive) or a comma separated list (e.g. 1-4,7,9 is line 1, 2, 3, 4, 7 and 9).
subpurdy
Command
Purdy is a library and set of command line tools for displaying code. You can write your own code to display specific content using the library, or use the subcommands of this program for preset usages. The ‘purdy’ command uses the Urwid library to display a colourized version of your code in the console, and is a wrapper to the subcommand of the same name.
usage: subpurdy [-h] [-l {con,py3,bash,dbash,node,yaml,rst,md,none}]
[--version]
{purdy,tokens,print,html,rtf} ... filename
Positional Arguments
- filename
Name of file to parse
Named Arguments
- -l, --lexer
Possible choices: con, py3, bash, dbash, node, yaml, rst, md, none
Name of lexer to use to parse the file. Choices are: “con” (Python 3 Console), “py3” (Python 3 Source), “bash” (Bash Console), “dbash” (Bash Console with a dollar-sign prompt), “node” (JavaScript Node.js Console), “yaml” (YAML Doc), “rst” (RST Doc), “md” (Markdown Doc), “none” (No Parsing). If no choice given, attempts to determine the result automatically. If it cannot detect it, it assumes Python 3.
Default: “detect”
- --version
show program’s version number and exit
subcommands
- command
Possible choices: purdy, tokens, print, html, rtf
Sub-commands
purdy
Display code in a interactive console window. Code is written to the screen as if it is being typed
subpurdy purdy [-h] [-c] [-x16] [-d DELAY | -w WPM] [--variance VARIANCE]
Named Arguments
- -c, --continuous
Instead of prentending to type like a human, just dump the file to the screen
Default: False
- -x16
Force 16 colour terminal mode in case 256 is not working to the screen
Default: False
- -d, --delay
Amount of time between each letter when in typewriter mode. Specified in milliseconds. Defaults to 130ms
- -w, --wpm
Number of words per minute that the typing speed should look like
- --variance
To make the typing look more real there is a variance in the delay between keystrokes. This value, in milliseconds is how much to go over or under the delay by. Defaults to +/- 30ms
tokens
Prints out each line in a file with the corresponding tokens indented beneath it
subpurdy tokens [-h] [--blackandwhite]
Named Arguments
- --blackandwhite, --bw
By default code lines are highlighted using ANSI colour. This flag turns this off.
Default: False
print
Prints code to screen using colourized ANSI escape sequences
subpurdy print [-h] [--num NUM] [--highlight HIGHLIGHT]
Named Arguments
- --num
Display line numbers with code starting with the value given here
Default: -1
- --highlight, --hl
Highlight certain line numbers when displaying the code. Line numbers are 1-indexed. Multiple lines can be higlighted using a hyphen for range (e.g. 1-4, inclusive) or a comma separated list (e.g. 1-4,7,9 is line 1, 2, 3, 4, 7 and 9).
html
Prints code to screen formatted as an HTML div
subpurdy html [-h] [--num NUM] [--highlight HIGHLIGHT] [--full]
Named Arguments
- --num
Display line numbers with code starting with the value given here
Default: -1
- --highlight, --hl
Highlight certain line numbers when displaying the code. Line numbers are 1-indexed. Multiple lines can be higlighted using a hyphen for range (e.g. 1-4, inclusive) or a comma separated list (e.g. 1-4,7,9 is line 1, 2, 3, 4, 7 and 9).
- --full
By default only a snippet of HTML is displayed inside a <div>. This flag produces a full HTML document.
Default: False
rtf
Prints code to screen formatted as an RTF document
subpurdy rtf [-h] [--num NUM] [--background BACKGROUND]
[--highlight HIGHLIGHT]
Named Arguments
- --num
Display line numbers with code starting with the value given here
Default: -1
- --background, --bg
Change the background colour of the document. When using the –highlight option, you you should also set a background colour, otherwise the background will turn white due to how RTF supports colouring. Format of the colour is like an HTML colour, e.g. #c1b455, without the leading #
- --highlight, --hl
Highlight certain line numbers when displaying the code. Line numbers are 1-indexed. Multiple lines can be higlighted using a hyphen for range (e.g. 1-4, inclusive) or a comma separated list (e.g. 1-4,7,9 is line 1, 2, 3, 4, 7 and 9).