Metadata-Version: 2.1
Name: gym-notebook-wrapper
Version: 0.0.3
Summary: Wrapper for running/rendering OpenAI Gym on Jupyter Notebook
Home-page: https://gitlab.com/ymd_h/gym-notebook-wrapper
Author: Yamada Hiroyuki
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
Requires-Dist: gym
Requires-Dist: matplotlib
Requires-Dist: pyvirtualdisplay
Requires-Dist: ipython

# Gym-Notebook-Wrapper

Gym-Notebook-Wrapper provides small wrapper for running and rendering
[OpenAI Gym](https://github.com/openai/gym) on [Jupyter
Notebook](https://jupyter.org/) or similar (e.g. [Google
Corab](https://colab.research.google.com/)).

# Requirement

- Linux
- [Xvfb](https://www.x.org/releases/X11R7.7/doc/man/man1/Xvfb.1.xhtml)
  - On Ubuntu, you can install `sudo apt update && sudo apt install xvfb`.
- Open GL (for some environment)
  - On Ubuntu, you can install `sudo apt update && sudo apt install python-opengl`

# Installation

You can install from
[PyPI](https://pypi.org/project/gym-notebook-wrapper/) with `pip install gym-notebook-wrapper`


# Usage

Wrap `gym.Env` class with `gnwrapper.Animation`. That's all! The
`render()` method shows the environment on its output. An example code
is following;

``` python
import gnwrapper
import gym

env = gnwrapper.Animation(gym.make('CartPole-v1'))

obs = env.reset()

for _ in range(1000):
    next_obs, reward, done, info = env.step(env.action_space.sample())
    env.render()

    obs = next_obs
    if done:
        obs = env.reset()
```

# Limitation

- Calling `render()` method delete the other output for the same cell.
- The output image is shown only once.


