Skip to main content

Python build pre-commit Code style: black release

Minari is a Python library for conducting research in offline reinforcement learning, akin to an offline version of Gymnasium or an offline RL version of HuggingFace's datasets library.

The documentation website is at minari.farama.org. We also have a public discord server (which we use for Q&A and to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6.

Installation

To install Minari from PyPI:

pip install minari

This will install the minimum required dependencies. Additional dependencies will be prompted for installation based on your use case. To install all dependencies at once, use:

pip install "minari[all]"

If you'd like to start testing or contribute to Minari please install this project from source with:

git clone https://github.com/Farama-Foundation/Minari.git --single-branch
cd Minari
pip install -e ".[all]"

Command Line API

To check available remote datasets:

minari list remote

To download a dataset:

minari download D4RL/door/human-v2

To check available local datasets:

minari list local

To show the details of a dataset:

minari show D4RL/door/human-v2

For the list of commands:

minari --help

Basic Usage

Reading a Dataset

import minari

dataset = minari.load_dataset("D4RL/door/human-v2")

for episode_data in dataset.iterate_episodes():
    observations = episode_data.observations
    actions = episode_data.actions
    rewards = episode_data.rewards
    terminations = episode_data.terminations
    truncations = episode_data.truncations
    infos = episode_data.infos
    ...

Writing a Dataset

import minari
import gymnasium as gym
from minari import DataCollector


env = gym.make('FrozenLake-v1')
env = DataCollector(env)

for _ in range(100):
    env.reset()
    done = False
    while not done:
        action = env.action_space.sample()  # <- use your policy here
        obs, rew, terminated, truncated, info = env.step(action)
        done = terminated or truncated

dataset = env.create_dataset("frozenlake/test-v0")

For other examples, see Basic Usage. For a complete tutorial on how to create new datasets using Minari, see our Pointmaze D4RL Dataset tutorial, which re-creates the Maze2D datasets from D4RL.

Training Libraries Integrating Minari

Citation

If you use Minari, please consider citing it:

@software{minari,
	author = {Younis, Omar G. and Perez-Vicente, Rodrigo and Balis, John U. and Dudley, Will and Davey, Alex and Terry, Jordan K},
	doi = {10.5281/zenodo.13767625},
	month = sep,
	publisher = {Zenodo},
	title = {Minari},
	url = {https://doi.org/10.5281/zenodo.13767625},
	version = {0.5.0},
	year = 2024,
	bdsk-url-1 = {https://doi.org/10.5281/zenodo.13767625}
}

Minari is a shortening of Minarai, the Japanese word for "learning by observation".

Metadata

Release files for minari 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minari 0.6.0
File Size Uploaded Provenance Actions
minari-0.6.0.tar.gz 55.4 kB Without provenance Details for minari-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minari 0.6.0
File Interpreter ABI Platform Actions
minari-0.6.0-py3-none-any.whl Python 3 none any Details for minari-0.6.0-py3-none-any.whl

Total release size: 114.1 kB

Release files / minari-0.6.0.tar.gz

Download URL minari-0.6.0.tar.gz
Size 55.4 kB
Tags Source
SHA-256 checksum
How to use checksums
392f9988f279e3f645c5df510540ff9bd1c4f45fc8500db4ad0dfbffdf5d7d6f
BLAKE2b-256 checksum
How to use checksums
6876477be8c8247eeaec4e842384cd262352dfe9b43c063b65eb50dc41fc871e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / minari-0.6.0-py3-none-any.whl

Download URL minari-0.6.0-py3-none-any.whl
Size 58.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c913c5eb398d6f8ff2f79901ce83fdb0341e0ec656732c4fb3c91fd7ed4d2ce
BLAKE2b-256 checksum
How to use checksums
768a61256bc76cc935e2de1e6f07ff76adead3c223f2a8aaf1cd43c36b8c86b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for minari 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page