omni.client

Omniverse Client Library

Python Module

Introduction

Most functions come in 3 flavors:

Example:

import omni.client
import asyncio

async def task():
    (result, entries) = await omni.client.list_async("omniverse://ov-sandbox/Users")
    print(result) # omni.client.Result.OK)
    for entry in entries:
        print(entry) # __str__ is supported

asyncio.ensure_future(task())

For more example look into omni.client tests (omni.client.tests).

API Reference

class omni.client.AccessFlags(self: omni.client._omniclient.AccessFlags, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

READ : Can read

WRITE : Can write

ADMIN : Can change ACLs

ADMIN = AccessFlags.ADMIN
READ = AccessFlags.READ
WRITE = AccessFlags.WRITE
property name

handle) -> str

Type

(self

class omni.client.ChannelEvent(self: omni.client._omniclient.ChannelEvent, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

ERROR : Error.

MESSAGE : Someone sent a message.

HELLO : You joined a channel that someone else was already in, and they said hello.

JOIN : Someone joined.

LEFT : Someone left.

DELETED : Someone deleted the channel or changed ACLs so you no longer have access.

DELETED = ChannelEvent.DELETED
ERROR = ChannelEvent.ERROR
HELLO = ChannelEvent.HELLO
JOIN = ChannelEvent.JOIN
LEFT = ChannelEvent.LEFT
MESSAGE = ChannelEvent.MESSAGE
property name

handle) -> str

Type

(self

class omni.client.ConnectionStatus(self: omni.client._omniclient.ConnectionStatus, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

CONNECTING : Attempting to connect

CONNECTED : Successfully connected

CONNECT_ERROR : Error trying to connect

DISCONNECTED : Disconnected

CONNECTED = ConnectionStatus.CONNECTED
CONNECTING = ConnectionStatus.CONNECTING
CONNECT_ERROR = ConnectionStatus.CONNECT_ERROR
DISCONNECTED = ConnectionStatus.DISCONNECTED
property name

handle) -> str

Type

(self

class omni.client.Content

Bases: pybind11_builtins.pybind11_object

Object to hold file content.

Use python std memoryview to access it. For example:

_, content = await omni.client.read_file_async("omniverse://ov-sandbox/some/file.txt")
print(memoryview(content).tobytes())
class omni.client.FileStatus(self: omni.client._omniclient.FileStatus, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

READING : Reading

WRITING : Writing

COPYING : Copying

DELETING : Deleting

SENDING_UPDATE : Sending Live Update

RECEIVED_UPDATE : Received Live Update

COPYING = FileStatus.COPYING
DELETING = FileStatus.DELETING
READING = FileStatus.READING
RECEIVED_UPDATE = FileStatus.RECEIVED_UPDATE
SENDING_UPDATE = FileStatus.SENDING_UPDATE
WRITING = FileStatus.WRITING
property name

handle) -> str

Type

(self

class omni.client.ItemFlags(self: omni.client._omniclient.ItemFlags, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

READABLE_FILE : You can call read_file on this. note: ACLs may still prevent you from reading it

WRITEABLE_FILE : You can call write_file on this. note: ACLs may still prevent you from writing it

CAN_HAVE_CHILDREN : This thing can contain other things (a folder-like thing)

DOES_NOT_HAVE_CHILDREN : This thing does not have any children. The lack of this flag does not mean it does have children!Sometimes we are not sure if it has children until you attempt to list the children.This is only intended to be used for UI elements to hide the ‘expand’ button if weare sure it does not have any children.

IS_MOUNT : This thing is the root of a mount point

IS_INSIDE_MOUNT : This thing is located inside a mounted folder

CAN_LIVE_UPDATE : This thing supports live updates

IS_OMNI_OBJECT : This thing is in omni-object format. You must use a special API to read/write it

IS_CHANNEL : This thing is a channel. You can call join_channel on it

CAN_HAVE_CHILDREN = ItemFlags.CAN_HAVE_CHILDREN
CAN_LIVE_UPDATE = ItemFlags.CAN_LIVE_UPDATE
DOES_NOT_HAVE_CHILDREN = ItemFlags.DOES_NOT_HAVE_CHILDREN
IS_CHANNEL = ItemFlags.IS_CHANNEL
IS_INSIDE_MOUNT = ItemFlags.IS_INSIDE_MOUNT
IS_MOUNT = ItemFlags.IS_MOUNT
IS_OMNI_OBJECT = ItemFlags.IS_OMNI_OBJECT
READABLE_FILE = ItemFlags.READABLE_FILE
WRITEABLE_FILE = ItemFlags.WRITEABLE_FILE
property name

handle) -> str

Type

(self

class omni.client.ListEntry

Bases: pybind11_builtins.pybind11_object

property access

YOUR access level, some combination of AccessFlags

property comment

Provider-specific comment Not all providers support this, so it may be null

property created_by

User Name of the person that created it Not all providers support this, so it may be null

property created_time

Nanoseconds since the epoch

property flags

Some combination of ItemFlags

property modified_by

User Name of the last person to modify it Not all providers support this, so it may be null

property modified_time

Nanoseconds since the epoch

property relative_path

The path for this item relative to the url provided to “List”

property size

For files, the size in bytes

property version

Provider-specific version May not be an always incrementing number (could be a hash, for example) Not all providers support this, so it may be null

class omni.client.ListEvent(self: omni.client._omniclient.ListEvent, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

UNKNOWN

CREATED

UPDATED

DELETED

METADATA

LOCKED

UNLOCKED

CREATED = ListEvent.CREATED
DELETED = ListEvent.DELETED
LOCKED = ListEvent.LOCKED
METADATA = ListEvent.METADATA
UNKNOWN = ListEvent.UNKNOWN
UNLOCKED = ListEvent.UNLOCKED
UPDATED = ListEvent.UPDATED
property name

handle) -> str

Type

(self

class omni.client.LogLevel(self: omni.client._omniclient.LogLevel, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

DEBUG : Extra chatty

VERBOSE : Chatty

INFO : Not a problem

WARNING : Potential problem

ERROR : Definite problem

DEBUG = LogLevel.DEBUG
ERROR = LogLevel.ERROR
INFO = LogLevel.INFO
VERBOSE = LogLevel.VERBOSE
WARNING = LogLevel.WARNING
property name

handle) -> str

Type

(self

class omni.client.Request

Bases: pybind11_builtins.pybind11_object

Generic request object. Can be used to stop request before completing.

property id
is_finished(self: omni.client._omniclient.Request)bool
stop(self: omni.client._omniclient.Request)None
class omni.client.Result(self: omni.client._omniclient.Result, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

OK

OK_LATEST

OK_NOT_YET_FOUND

ERROR

ERROR_CONNECTION

ERROR_NOT_SUPPORTED

ERROR_ACCESS_DENIED

ERROR_NOT_FOUND

ERROR_BAD_VERSION

ERROR_ALREADY_EXISTS

ERROR_ACCESS_LOST

ERROR = Result.ERROR
ERROR_ACCESS_DENIED = Result.ERROR_ACCESS_DENIED
ERROR_ACCESS_LOST = Result.ERROR_ACCESS_LOST
ERROR_ALREADY_EXISTS = Result.ERROR_ALREADY_EXISTS
ERROR_BAD_VERSION = Result.ERROR_BAD_VERSION
ERROR_CONNECTION = Result.ERROR_CONNECTION
ERROR_NOT_FOUND = Result.ERROR_NOT_FOUND
ERROR_NOT_SUPPORTED = Result.ERROR_NOT_SUPPORTED
OK = Result.OK
OK_LATEST = Result.OK_LATEST
OK_NOT_YET_FOUND = Result.OK_NOT_YET_FOUND
property name

handle) -> str

Type

(self

class omni.client.ServerInfo

Bases: pybind11_builtins.pybind11_object

property auth_token
property cache_enabled
property checkpoints_enabled
property omniojects_enabled
property username
property version
class omni.client.Subscription

Bases: pybind11_builtins.pybind11_object

class omni.client.Url

Bases: pybind11_builtins.pybind11_object

property fragment
property host
property path
property port
property query
property scheme
property user
class omni.client.UsdLiveMode(self: omni.client._omniclient.UsdLiveMode, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

DEFAULT : Default will be the value of global mode.

DISABLED : Disabled.

ENABLED : Enabled.

DEFAULT = UsdLiveMode.DEFAULT
DISABLED = UsdLiveMode.DISABLED
ENABLED = UsdLiveMode.ENABLED
property name

handle) -> str

Type

(self

omni.client.break_url(arg0: str) → omni.client._omniclient.Url
omni.client.combine_urls(arg0: str, arg1: str)str
omni.client.combine_with_base_url(arg0: str)str
omni.client.copy(src_url: str, dst_url: str) → omni.client._omniclient.Result

Synchronously copy a thing from src_url to dst_url. (Blocking version.)

The thing can be anything that supports copying (files, folders, etc..) If both src and dst are on the same server, this is done on the server Otherwise the file is first downloaded from ‘src’ then uploaded to ‘dst’ Destination folders will be created as needed

Parameters
  • src_url (str) – Source url.

  • dst_url (str) – Destination url.

Returns

Result.

Return type

(omni.client.Result)

async omni.client.copy_async(src_url: str, dst_url: str) → omni.client._omniclient.Result

Asynchronously copy a thing from src_url to dst_url. (Coroutine version.)

The thing can be anything that supports copying (files, folders, etc..) If both src and dst are on the same server, this is done on the server Otherwise the file is first downloaded from ‘src’ then uploaded to ‘dst’ Destination folders will be created as needed

Parameters
  • src_url (str) – Source url.

  • dst_url (str) – Destination url.

Returns

Result.

Return type

(omni.client.Result)

omni.client.copy_with_callback(src_url: str, dst_url: str, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously copy a thing from src_url to dst_url. (Callback version.)

The thing can be anything that supports copying (files, folders, etc..) If both src and dst are on the same server, this is done on the server Otherwise the file is first downloaded from ‘src’ then uploaded to ‘dst’ Destination folders will be created as needed

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.create_checkpoint(url: str, comment: str) → omni.client._omniclient.Result

Synchronously create a checkpoint. (Blocking version.)

Parameters
  • url (str) – Url.

  • comment (str) – Comment to associate with the checkpoint (must not be blank)

Returns

Result and query that can be used to refer to this checkpoint

Return type

(Tuple[omni.client.Result, CheckpointQuery])

async omni.client.create_checkpoint_async(url: str, comment: str) → omni.client._omniclient.Result

Asynchronously create a checkpoint. (Coroutine version.)

Parameters
  • url (str) – Url.

  • comment (str) – Comment to associate with the checkpoint (must not be blank)

Returns

Result and query that can be used to refer to this checkpoint

Return type

(Tuple[omni.client.Result, CheckpointQuery])

omni.client.create_checkpoint_with_callback(url: str, comment: str, callback: Callable[[omni.client._omniclient.Result, str], None]) → omni.client._omniclient.Request

Asynchronously create a checkpoint. (Callback version.)

Parameters
  • url (str) – Url.

  • comment (str) – Comment to associate with the checkpoint (must not be blank)

  • callback (Callable[omni.client.Result, CheckpointQuery]) – Callback to be called with the result.

Returns

Request object.

Return type

(omni.client.Request)

omni.client.create_folder(url: str) → omni.client._omniclient.Result

Synchronously create a folder. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result.

Return type

(omni.client.Result)

async omni.client.create_folder_async(url: str) → omni.client._omniclient.Result

Asynchronously create a folder. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result.

Return type

(omni.client.Result)

omni.client.create_folder_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously create a folder. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.delete(url: str) → omni.client._omniclient.Result

Synchronously delete something (file, folder, mount, liveFile, channel etc..). (Blocking version.)

Parameters

url (str) – Url.

Returns

Result.

Return type

(omni.client.Result)

async omni.client.delete_async(url: str) → omni.client._omniclient.Result

Asynchronously delete something (file, folder, mount, liveFile, channel etc..). (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result.

Return type

(omni.client.Result)

omni.client.delete_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously delete something (file, folder, mount, liveFile, channel etc..). (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.get_log_level(arg0: omni.client._omniclient.LogLevel)str
omni.client.get_server_info(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.ServerInfo]

Get server info by url (blocking version).

async omni.client.get_server_info_async(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.ServerInfo]

Get server info by url (async version).

omni.client.get_server_info_with_callback(arg0: str, arg1: Callable[[omni.client._omniclient.Result, omni.client._omniclient.ServerInfo], None]) → omni.client._omniclient.Request
omni.client.get_version()str
omni.client.initialize(version: int = 77309411328)bool
omni.client.join_channel_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result, omni.client._omniclient.ChannelEvent, str, omni.client._omniclient.Content], None]) → omni.client._omniclient.Request

Asynchronously join a channel. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.list(url: str) → Tuple[omni.client._omniclient.Result, Tuple[omni.client._omniclient.ListEntry]]

Synchronously list content of a folder. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result and tuple of entries.

Return type

(Tuple[Result, Tuple[omni.client.ListEntry]]])

async omni.client.list_async(url: str) → Tuple[omni.client._omniclient.Result, Tuple[omni.client._omniclient.ListEntry]]

Asynchronously list content of a folder. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result and tuple of entries.

Return type

(Tuple[Result, Tuple[omni.client.ListEntry]]])

omni.client.list_checkpoints(url: str) → Tuple[omni.client._omniclient.Result, Tuple[omni.client._omniclient.ListEntry]]

Synchronously list checkpoints of a file. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result and tuple of entries.

Return type

(Tuple[Result, Tuple[omni.client.ListEntry]]])

async omni.client.list_checkpoints_async(url: str) → Tuple[omni.client._omniclient.Result, Tuple[omni.client._omniclient.ListEntry]]

Asynchronously list checkpoints of a file. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result and tuple of entries.

Return type

(Tuple[Result, Tuple[omni.client.ListEntry]]])

omni.client.list_checkpoints_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result, tuple], None]) → omni.client._omniclient.Request

Asynchronously list checkpoints. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.list_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result, tuple], None]) → omni.client._omniclient.Request

Asynchronously list content of a folder. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.lock_with_callback(arg0: str, arg1: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Lock a URL so only this client can modify it. (Callback version.)

Parameters

url (str) – URL.

omni.client.make_file_url(arg0: str)str
omni.client.make_relative_url(arg0: str, arg1: str)str
omni.client.make_url(scheme: str = None, user: str = None, host: str = None, port: str = None, path: str = None, query: str = None, fragment: str = None)str
omni.client.normalize_url(arg0: str)str
omni.client.pop_base_url(arg0: str)bool
omni.client.push_base_url(arg0: str)None
omni.client.read_file(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.Content]

Read a file. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result, version and content.

Return type

(Tuple[omni.client.Result, str, omni.client.Content])

async omni.client.read_file_async(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.Content]

Asynchronously read a file. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result, version and content.

Return type

(Tuple[omni.client.Result, str, omni.client.Content])

omni.client.read_file_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result, str, omni.client._omniclient.Content], None]) → omni.client._omniclient.Request

Asynchronously read a file. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.reconnect(arg0: str)None

Attempt to connect to a specific url

Parameters

url (str) – Attempt to connect to this url

omni.client.register_authorize_callback(arg0: Callable[[str], object]) → omni.client._omniclient.Subscription

Set authorize callback.

The callback receives the URL prefix (such as “scheme://server:port”) as a parameter and should return either:

None or False: Continue to the next authorize callback (or default authorization method) True: Abort the connection String: A token (usually the auth_token provided by get_server_info) (String, String): A username and password

Parameters

callback (Callable[UrlPrefix]) – Callback to be called to provide authentication information.

Returns

Subscription Object. Callback will be unregistered once subcription is released.

Return type

(omni.client.Subscription)

omni.client.register_connection_status_callback(arg0: Callable[[str, omni.client._omniclient.ConnectionStatus], None]) → omni.client._omniclient.Subscription

Register connection status callback.

Parameters

callback (Callable[ServerUrl, OmniClientFileStatus]) – Callback to be called with the status.

Returns

Subscription Object. Callback will be unregistered once subcription is released.

Return type

(omni.client.Subscription)

omni.client.register_file_status_callback(arg0: Callable[[str, omni.client._omniclient.FileStatus, int], None]) → omni.client._omniclient.Subscription

Register file status callback.

Parameters

callback (Callable[ServerUrl, OmniClientFileStatus, percent]) – Callback to be called with the status.

Returns

Subscription Object. Callback will be unregistered once subcription is released.

Return type

(omni.client.Subscription)

omni.client.restore_checkpoint(url: str) → omni.client._omniclient.Result

Synchronously restore a checkpoint. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result

Return type

(omni.client.Result)

async omni.client.restore_checkpoint_async(url: str) → omni.client._omniclient.Result

Asynchronously restore a checkpoint. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result

Return type

(omni.client.Result)

omni.client.restore_checkpoint_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously restore a checkpoint. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

async omni.client.send_message_async(join_request_id: int, buffer) → Tuple[omni.client._omniclient.Result]

Asynchronously send message to channel. (Coroutine version.)

Parameters
  • join_request_id (int) – Join request id you get from omni.client.join_channel_with_callback.

  • content (buffer) – Content

Returns

Result object.

Return type

(omni.client.Result)

omni.client.send_message_with_callback(join_request_id: int, content: buffer, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously send a message to a channel. (Callback version.)

Parameters
  • join_request_id (int) – Request id that you get from omni.client.join_channel_with_callback.

  • content (buffer) – Content

  • callback (Callable[omni.client.Result]) – Callback to be called with the result.

Returns

Request object.

Return type

(omni.client.Request)

omni.client.set_log_callback(arg0: Callable[[str, str, omni.client._omniclient.LogLevel, str], None])None
omni.client.set_log_level(arg0: omni.client._omniclient.LogLevel)None
omni.client.shutdown()None
omni.client.sign_out(arg0: str)None

Sign out specific url connection.

Parameters

url (str) – Immediately disconnect from the server specified by this URL. Any outstanding requests will call their callbacks with OmniClientResult.ErrorConnection. Additionally, clear the saved authentication token so future requests to this server will trigger re-authentication.

omni.client.stat(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.ListEntry]

Synchronously retrieve information about a file or folder. (Blocking version.)

Parameters

url (str) – Url.

Returns

Result and entry.

Return type

(Tuple[Result, omni.client.ListEntry]])

async omni.client.stat_async(url: str) → Tuple[omni.client._omniclient.Result, omni.client._omniclient.ListEntry]

Asynchronously retrieve information about a file or folder. (Coroutine version.)

Parameters

url (str) – Url.

Returns

Result and entry.

Return type

(Tuple[Result, omni.client.ListEntry]])

omni.client.stat_with_callback(url: str, callback: Callable[[omni.client._omniclient.Result, omni.client._omniclient.ListEntry], None]) → omni.client._omniclient.Request

Asynchronously retrieve information about a file or folder. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)

omni.client.unlock_with_callback(arg0: str, arg1: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Unlock a URL so other clients can modify it. (Callback version.)

Parameters

url (str) – URL.

omni.client.usd_live_get_default_enabled()bool

Get default live update mode.

omni.client.usd_live_get_latest_server_time(url: str)int

Returns the server timestamp of the most recently received message (0 if no messages have been received).

omni.client.usd_live_get_mode_for_url(arg0: str) → omni.client._omniclient.UsdLiveMode

Get live update mode for specific URL.

Parameters

url (str) – Layer URL.

Returns

Live update mode.

Return type

(omni.client.OmniUsdLiveMode)

omni.client.usd_live_process()None

Call this to process live updates received from the server.

omni.client.usd_live_process_up_to(url: str, server_time: int)None

Same as omni.client.usd_live_process(false) but you can specify a server time to stop processing updates.

Parameters
  • url (str) – URL to process.

  • server_time (int) – The server time to stop processing updates.

omni.client.usd_live_set_default_enabled(enabled: bool)None

Live mode means updates from other users are applied to your scene.

This API will change the live update mode for all layers if you don’t set it for each layer.

Parameters

enabled (bool) – Enable live update mode globally or not.

omni.client.usd_live_set_mode_for_url(url: str, mode: omni.client._omniclient.UsdLiveMode)None

Set live update mode for each layer.

Parameters
  • url (str) – Layer URL.

  • mode (omni.client.OmniUsdLiveMode) – Set live update mode per layer.

omni.client.usd_live_wait_for_pending_updates()None

Call this to wait for all pending live updates to complete.

omni.client.write_file(url: str, buffer) → Tuple[omni.client._omniclient.Result]

Create a new file, overwriting if it already exists. (Blocking version.)

Parameters
  • url (str) – Url.

  • content (buffer) – Content

Returns

Result object.

Return type

(omni.client.Result)

async omni.client.write_file_async(url: str, buffer) → Tuple[omni.client._omniclient.Result]

Asynchronously create a new file, overwriting if it already exists. (Coroutine version.)

Parameters
  • url (str) – Url.

  • content (buffer) – Content

Returns

Result object.

Return type

(omni.client.Result)

omni.client.write_file_with_callback(url: str, content: buffer, callback: Callable[[omni.client._omniclient.Result], None]) → omni.client._omniclient.Request

Asynchronously create a new file, overwriting if it already exists. (Callback version.)

Parameters
Returns

Request object.

Return type

(omni.client.Request)