Metadata-Version: 2.4
Name: unienv
Version: 0.0.1b11
Summary: Unified robot environment framework supporting multiple tensor and simulation backends
License-Expression: MIT
Project-URL: Homepage, https://github.com/UniEnvOrg/UniEnv
Project-URL: Documentation, https://github.com/UniEnvOrg/UniEnv
Project-URL: Repository, https://github.com/UniEnvOrg/UniEnv
Project-URL: Issues, https://github.com/UniEnvOrg/UniEnv/issues
Project-URL: Changelog, https://github.com/UniEnvOrg/UniEnv/blob/main/CHANGELOG.md
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: xbarray>=0.0.1a16
Requires-Dist: pillow
Requires-Dist: cloudpickle
Requires-Dist: pyvers
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Provides-Extra: gymnasium
Requires-Dist: gymnasium>=0.29.0; extra == "gymnasium"
Provides-Extra: video
Requires-Dist: moviepy>=2.1; extra == "video"
Dynamic: license-file

# UniEnv

Framework unifying robot environments and data APIs. UniEnv provides an universal interface for robot actors, sensors, environments, and data. 

## Tensor library cross-backend Support

UniEnv supports multiple tensor backends with zero-copy translation layers through the DLPack protocol, and allows you to use the same abstract compute backend interface to write custom data transformation layers, environment wrappers and other utilities. This is powered by the [XBArray](https://github.com/UniEnvOrg/XBArray) package.

## Universal Robot Environment Interface

UniEnv supports diverse simulation environments and real robots, built on top of the abstract environment / world interface. This allows you to reuse code across different sim and real robots.

## Universal Robot Data Interface

UniEnv provides a universal data interface for accessing robot data through the abstract `BatchBase` interface. We also provide a utility `ReplayBuffer` for saving data from various environments with diverse data format support, including `hdf5`, memory-mapped torch tensors, and others.

## Installation

Install the package with pip

```bash
pip install unienv
```

You can install optional dependencies such as `gymnasium` (for Gymnasium-compatible environments), `dev`, or `video` by running

```bash
pip install unienv[gymnasium,video]
```

## Local Developments

### Development Environment Setup

To perform development on your local machine, you need to clone the repository and install the package in editable mode.

```bash
git clone https://github.com/UniEnvOrg/UniEnv
cd UniEnv
pip install numpy
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu # You can choose to either install cpu version or cuda version, up to you
pip install jax # same for jax
python -m pip install pytest
python -m pip install tensordict h5py opencv-python
pip install -e .[dev,gymnasium,video]
```

### Before commiting

Make sure all unit tests pass and your added code compiles before commiting or making a PR. You can run the tests with

```bash
pytest
```

## Cite

If you use UniEnv in your research, please cite it as follows:

```bibtex
@software{cao_unienv,
  author = {Cao, Yunhao AND Fang, Kuan},
  title = {{UniEnv: Unifying Robot Environments and Data APIs}},
  year = {2025},
  month = oct,
  url = {https://github.com/UniEnvOrg/UniEnv},
  license = {MIT}
}
```

## Acknowledgements

The idea of this project is inspired by [Gymnasium](https://github.com/Farama-Foundation/Gymnasium) and its predecessor [OpenAI Gym](https://github.com/openai/gym). 
This library is impossible without the great work of DataAPIs Consortium and their work on the [Array API Standard](https://data-apis.org/array-api/latest/). The zero-copy translation layers are powered by the [DLPack](https://github.com/dmlc/dlpack) project.
