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.1b12.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.1b12-py3-none-any.whl (232.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unienv-0.0.1b12.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.1b12.tar.gz
Algorithm Hash digest
SHA256 a16d158effe8018ebb49d1feb95b7b61da860f1c56062af05bc4ae51100152f5
MD5 bb97368143470dfc244fec35a12ab024
BLAKE2b-256 db455d54afed73cf180f0b2675a346c8db6150e3ce6735d9bad34bfaa45a448d

See more details on using hashes here.

Provenance

The following attestation bundles were made for unienv-0.0.1b12.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.1b12-py3-none-any.whl.

File metadata

  • Download URL: unienv-0.0.1b12-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.1b12-py3-none-any.whl
Algorithm Hash digest
SHA256 fd520de9930d20f119abe97d11c6edd31ee4c36c46f5091f3f351f9e8099dc17
MD5 64ef96ff47b9b6951432afc9d5d600db
BLAKE2b-256 66111b858eecf3e735ffdbcb6e199afa67a27436dfd289d9d07bbab09515c904

See more details on using hashes here.

Provenance

The following attestation bundles were made for unienv-0.0.1b12-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