<commit_before>:author: <NAME>
:email: <EMAIL>
:institution: Texas A&M University

---------------------------------------------------------------------------------------------------------
 GraphTerm: A notebook-like graphical terminal interface for collaboration and inline data visualization
---------------------------------------------------------------------------------------------------------

.. class:: abstract

  The notebook interface, which blends text and graphics, has been in
  use for a number of years in commercial mathematical software and is
  now finding more widespread usage in scientific Python with the
  availability browser-based front-ends like the Sage and IPython
  notebooks. This paper describes a new open-source Python project,
  GraphTerm, that takes a slightly different approach to blending text
  and graphics to create a notebook-like interface. Rather than
  operating at the application level, it works at the unix shell level
  by extending the command line interface to incorporate elements of
  the graphical user interface. The XTerm terminal escape sequences
  are augmented to allow any program to interactively display inline
  graphics (or other HTML content) simply by writing to standard
  output.

  GraphTerm is designed to be a drop-in replacement for the standard
  unix terminal, with additional features for multiplexing sessions
  and easy deployment in the cloud. The interface aims to be
  tablet-friendly, with features like clickable/tappable directory
  listings for navigating folders etc. The user can switch, as needed,
  between standard line-at-a-time shell mode and the notebook mode,
  where multiple lines of code are entered in cells, allowing for
  in-place editing and re-execution. Multiple users can share terminal
  sessions for collaborative computing.

  GraphTerm is implemented in Python, using the Tornado web framework
  for the server component and HTML+Javascript for the browser
  client. This paper discusses the architecture and capabilities of
  GraphTerm, and provides usage examples such as inline data
  visualization using matplotlib and the notebook mode.

.. class:: keywords

   GUI, CLI, graphical user interface, command line
   interface, notebook interface, graphical shell

Introduction
------------

Text and graphics form important components of the user interface
when working with computers. Early personal computers only supported
the textual user interface, more commonly known as the *command line
interface* (CLI). However, when the Apple Macintosh popularized the
*graphical user interface* (GUI), it soon became the preferred means
for interacting with the computer. The GUI is more user-friendly,
especially for beginners, and provides a more pleasant visual
experience. The GUI typically provides buttons and widgets for the
most common tasks, whereas the CLI requires recalling and typing out
commands to accomplish tasks. However, the friendliness
of the GUI comes at a cost---it can be much more difficult to perform
advanced tasks using the GUI as compared to using the CLI. Using a GUI
is analogous to using a phrase book to express yourself in a foreign
language, whereas using a CLI is like learning words to form new
phrases in the foreign language. The former is more convenient for
first-time and casual users, whereas the latter provides the versatility
required by more advanced users.

The dichotomy between the textual and graphical modes of interaction
also extends to scientific data analysis tools. Traditionally,
commands for data analysis were typed into a terminal window with an
interactive shell and the graphical output was displayed in a separate
window. Some commercial software, such as Mathematica and Maple,
provided a more integrated notebook interface that blended text and
graphics, thus combining aspects of the CLI with the GUI. One of the
exciting recent developments in scientific Python has been the
development of alternative, open source, notebook interfaces for
scientific computing and data analysis---the Sage and IPython
notebooks [Perez12]_. Since Python is a more general-purpose language
than Mathematica or Maple, the notebook interface could potentially
reach a much wider audience.

A notebook display consists of a sequence of cells, each of which can
contain code, figures, or text (with markup). Although originally
developed for exploratory research, notebooks can be very useful
for presentations and teaching as well. They can provide step-by-step
documentation of complex tasks and can easily be shared. The cells in
a notebook do not necessarily have to be executed in the sequence in
which they appear. In this respect, the notebook interface can be
considered an expression of "literate programming", where snippets of
code are embedded in natural language documentation that explains what
the code does [Knuth84]_.

Another emerging area where the notebook interface could serve as an
important tool is *reproducible research* [Stodden13]_. As
computational techniques are increasingly being used in all areas of
research, reproducing a research finding requires not just the broad
outline of the research methodology but also documentation of the
software development environment used for the study. The need for
reproducible research is highlighted by the recent controversy
surrounding the highly influential Reinhart-Rogoff study that
identified a negative relationship between a country's debt and its<commit_msg>Restored the em dash fixes<commit_after>:author: <NAME>
:email: <EMAIL>
:institution: Texas A&M University

---------------------------------------------------------------------------------------------------------
 GraphTerm: A notebook-like graphical terminal interface for collaboration and inline data visualization
---------------------------------------------------------------------------------------------------------

.. class:: abstract

  The notebook interface, which blends text and graphics, has been in
  use for a number of years in commercial mathematical software and is
  now finding more widespread usage in scientific Python with the
  availability browser-based front-ends like the Sage and IPython
  notebooks. This paper describes a new open-source Python project,
  GraphTerm, that takes a slightly different approach to blending text
  and graphics to create a notebook-like interface. Rather than
  operating at the application level, it works at the unix shell level
  by extending the command line interface to incorporate elements of
  the graphical user interface. The XTerm terminal escape sequences
  are augmented to allow any program to interactively display inline
  graphics (or other HTML content) simply by writing to standard
  output.

  GraphTerm is designed to be a drop-in replacement for the standard
  unix terminal, with additional features for multiplexing sessions
  and easy deployment in the cloud. The interface aims to be
  tablet-friendly, with features like clickable/tappable directory
  listings for navigating folders etc. The user can switch, as needed,
  between standard line-at-a-time shell mode and the notebook mode,
  where multiple lines of code are entered in cells, allowing for
  in-place editing and re-execution. Multiple users can share terminal
  sessions for collaborative computing.

  GraphTerm is implemented in Python, using the Tornado web framework
  for the server component and HTML+Javascript for the browser
  client. This paper discusses the architecture and capabilities of
  GraphTerm, and provides usage examples such as inline data
  visualization using matplotlib and the notebook mode.

.. class:: keywords

   GUI, CLI, graphical user interface, command line
   interface, notebook interface, graphical shell

Introduction
------------

.. |---| unicode:: U+02014 .. em dash
   :trim:

Text and graphics form important components of the user interface
when working with computers. Early personal computers only supported
the textual user interface, more commonly known as the *command line
interface* (CLI). However, when the Apple Macintosh popularized the
*graphical user interface* (GUI), it soon became the preferred means
for interacting with the computer. The GUI is more user-friendly,
especially for beginners, and provides a more pleasant visual
experience. The GUI typically provides buttons and widgets for the
most common tasks, whereas the CLI requires recalling and typing out
commands to accomplish tasks. However, the friendliness
of the GUI comes at a cost |---| it can be much more difficult to perform
advanced tasks using the GUI as compared to using the CLI. Using a GUI
is analogous to using a phrase book to express yourself in a foreign
language, whereas using a CLI is like learning words to form new
phrases in the foreign language. The former is more convenient for
first-time and casual users, whereas the latter provides the versatility
required by more advanced users.

The dichotomy between the textual and graphical modes of interaction
also extends to scientific data analysis tools. Traditionally,
commands for data analysis were typed into a terminal window with an
interactive shell and the graphical output was displayed in a separate
window. Some commercial software, such as Mathematica and Maple,
provided a more integrated notebook interface that blended text and
graphics, thus combining aspects of the CLI with the GUI. One of the
exciting recent developments in scientific Python has been the
development of alternative, open source, notebook interfaces for
scientific computing and data analysis |---| the Sage and IPython
notebooks [Perez12]_. Since Python is a more general-purpose language
than Mathematica or Maple, the notebook interface could potentially
reach a much wider audience.

A notebook display consists of a sequence of cells, each of which can
contain code, figures, or text (with markup). Although originally
developed for exploratory research, notebooks can be very useful
for presentations and teaching as well. They can provide step-by-step
documentation of complex tasks and can easily be shared. The cells in
a notebook do not necessarily have to be executed in the sequence in
which they appear. In this respect, the notebook interface can be
considered an expression of "literate programming", where snippets of
code are embedded in natural language documentation that explains what
the code does [Knuth84]_.

Another emerging area where the notebook interface could serve as an
important tool is *reproducible research* [Stodden13]_. As
computational techniques are increasingly being used in all areas of
research, reproducing a research finding requires not just the broad
outline of the research methodology but also documentation of the
software development environment used for the study. The need for
reproducible research is highlighted by the recent controversy
surrounding the highly influential Reinhart-Rogoff study that
identified a negative relationship between a country's debt and its
{'fraction_non_alphanumeric': 0.06768005790807094, 'fraction_numerical': 0.0015381831342743395, 'mean_word_length': 3.877758164165931, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2136633', 'n_tokens_mistral': 2421, 'n_tokens_neox': 2266, 'n_words': 1532}