A tool for replaying terminal sessions


License
MIT
Install
pip install gjenta==4.3.4

Documentation

Python version Build Status

gjenta

Tool for replaying Python REPL sessions.

Quickstart

To see gjenta in action, install it and ask it to "quick play" an example script:

pip install gjenta
gjenta quickplay examples/gjenta/simple.py

Installation

Install gjenta from the PyPI with pip:

pip install gjenta

From source

Just use pip again. Run this command from the directory containing setup.py:

pip install .

Basic usage

The basic thing to do with gjenta is to have it replay an existing Python script through the REPL. There are some scripts in the examples directory that you can try. First you need to compile the script to a schedule:

gjenta compile -o commands.sched examples/gjenta/commands.py

Then you can run the schedule with the replay command:

gjenta replay commands.sched

If everything is working properly, you'll see this start a new REPL, enter some commands, and exit the REPL.

Quickplay

You can ask gjenta to compile and run a script all in one pass, without generating the intermediate schedule file, using the quickplay command:

gjenta quickplay example/gjenta/commands.py

This is useful for iterating on scripts during development.

Configuration

Gjenta has fairly sophisticated support for configuring its various plugins. Each plugin specifies its configuration option, and you can provide values via a TOML configuration file.

There is an example configuration file in examples/gjentarc.toml.

TODO: Document this!

Tests

To run the tests you first need to install the testing dependencies:

pip install ".[test]"

Then you can use tox to run everything. For example, to run the tests with Python 3.7:

tox -e py37