Skip to main content

Unified robot environment framework supporting multiple tensor and simulation backends

Project description

UniEnv

UniEnv overview

UniEnv is a Python framework for building robot environments and robot data pipelines on top of a shared set of abstractions.

Documentation: https://unienvorg.github.io/UniEnv/

It gives you:

  • a common environment interface for simulation and real-robot control
  • a functional environment variant for explicit state passing
  • backend-aware spaces, wrappers, and transformations
  • world and node composition utilities for multi-component environments
  • replay buffers, storages, samplers, and dataset adapters for offline data workflows

The project is designed around one idea: environment code and dataset code should not have to be rewritten every time the simulator, robot, or tensor library changes.

What Is In The Package

  • unienv_interface: environments, worlds, nodes, spaces, wrappers, and transformations
  • unienv_data: batches, replay buffers, storage backends, samplers, and dataset integrations
  • backend portability through XBArray and DLPack-based conversion paths

Installation

Install the base package:

pip install unienv

Install optional extras when needed:

pip install "unienv[gymnasium,video]"

Some integrations and storage backends rely on their own ecosystem packages such as pyarrow, h5py, datasets, huggingface_hub, torch, or jax. Install the ones that match the features you plan to use.

Quick Example

The example below shows the core building blocks without depending on a specific simulator:

import numpy as np

from unienv_interface.backends.numpy import NumpyComputeBackend
from unienv_interface.space.spaces import BoxSpace, DictSpace
from unienv_interface.transformations import RescaleTransformation
from unienv_data.replay_buffer import ReplayBuffer
from unienv_data.storages.parquet import ParquetStorage

backend = NumpyComputeBackend

transition_space = DictSpace(
    backend,
    {
        "obs": BoxSpace(backend, 0.0, 1.0, np.float32, shape=(4,)),
        "action": BoxSpace(backend, -1.0, 1.0, np.float32, shape=(2,)),
        "reward": BoxSpace(backend, -np.inf, np.inf, np.float32, shape=()),
    },
)

action_transform = RescaleTransformation(new_low=0.0, new_high=1.0)
normalized_action_space = action_transform.get_target_space_from_source(
    transition_space["action"]
)

buffer = ReplayBuffer.create(
    ParquetStorage,
    transition_space,
    cache_path="cache/demo_buffer",
    capacity=10_000,
)

print(normalized_action_space)
print(buffer.single_space)

In practice, you would pair these components with your own Env, FuncEnv, World, or WorldNode implementations, then add wrappers and storage backends as needed.

Documentation

Documentation: https://unienvorg.github.io/UniEnv/

Start with:

  • docs/getting-started.md for installation and the package map
  • docs/concepts/ for the core abstractions
  • docs/guides/ for wrappers, replay buffers, and dataset integrations

Development

For local development:

git clone https://github.com/UniEnvOrg/UniEnv
cd UniEnv/UniEnvPy
pip install -e .[dev,gymnasium,video]
pytest

If you want to exercise optional backends or integrations during development, install their matching dependencies explicitly before running the relevant tests.

Cite

If you use UniEnv in research, cite:

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

Acknowledgements

UniEnv is influenced by Gymnasium and OpenAI Gym, and builds on ideas from the Array API Standard and DLPack.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unienv-0.0.1b13.tar.gz (165.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unienv-0.0.1b13-py3-none-any.whl (232.9 kB view details)

Uploaded Python 3

File details

Details for the file unienv-0.0.1b13.tar.gz.

File metadata

  • Download URL: unienv-0.0.1b13.tar.gz
  • Upload date:
  • Size: 165.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unienv-0.0.1b13.tar.gz
Algorithm Hash digest
SHA256 f779d3d8fd0bc488eb56bcb6a770b3ca70473c7e8593301778985830ce4f3077
MD5 e8b17f12934eec1317114ea51b5134c5
BLAKE2b-256 fe13fb9631674dd97c2ce4aedfa15fe9c2fd4f0a65710d0a03305e8aab47cf58

See more details on using hashes here.

Provenance

The following attestation bundles were made for unienv-0.0.1b13.tar.gz:

Publisher: python-publish.yml on UniEnvOrg/UniEnv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unienv-0.0.1b13-py3-none-any.whl.

File metadata

  • Download URL: unienv-0.0.1b13-py3-none-any.whl
  • Upload date:
  • Size: 232.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unienv-0.0.1b13-py3-none-any.whl
Algorithm Hash digest
SHA256 db9f6f8007ef1942fddbe49fbb1b2df5f017e864209d406259049b3d181baeeb
MD5 4c99db4fede94f7219ac2a99bcd1ea1d
BLAKE2b-256 7ae96c41a69455f3c077dc8a8afb03094238aea9e2f3e8213ca28f7808f2d109

See more details on using hashes here.

Provenance

The following attestation bundles were made for unienv-0.0.1b13-py3-none-any.whl:

Publisher: python-publish.yml on UniEnvOrg/UniEnv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page