A tool replaying REPL sessions.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src/gjenta
tests
.dir-locals.el
.gitignore
.travis.yml
LICENSE
README.rst
poetry.lock
pyproject.toml
tox.ini

README.rst

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.gj

Installation

Install gjenta from the PyPI with pip:

pip install gjenta

From source

For development we use poetry, so to install gjenta from source you'll first need to install poetry.

Once you've got poetry installed, you can install gjenta like this:

poetry install

If you want to install in "development" mode, you can use the --develop flag:

poetry install --develop .

If you want to install the testing dependencies, use the -E flag:

poetry install -E test

If you want to do all of this in one command, that's also possible:

poetry install --develop . -E test

There's more to using poetry that you can find out about at their project page.

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.gj

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.gj

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:

poetry install -E test

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

tox -e py37