Skip to main content

API wrapper for Roblox Open Cloud

Project description

rblx-open-cloud

Discord Server DevForum Post Downloads

rblx-open-cloud is a Python API wrapper for Roblox Open Cloud.

Key Features

  • Support for most endpoints, including the OAuth2 flow and authentication.
  • Allows both syncronous and asyncronous usage.
  • Logic for operation polling and internal error retrying.

Documentation: https://rblx-open-cloud.readthedocs.io/en/latest/

Quickstart

Getting Started

  1. Install the library with pip in your terminal.
# Stable (PyPi, recommended)
pip install rblx-open-cloud~=2.0

# Development (GitHub)
pip install "rblx-open-cloud @ git+https://github.com/treeben77/rblx-open-cloud@v2"
  1. Create an API key from the Creator Dashboard. You can read Managing API Keys for help.

You've got the basics down, below are examples for some of the APIs.

Accessing Data Stores

import rblxopencloud

# create an Experience object with your experience ID and your api key
# TODO: replace '13058' with your experience ID
experience = rblxopencloud.Experience(13058, api_key="api-key-from-step-2")

# get the data store, using the data store name and scope (defaults to global)
datastore = experience.get_data_store("data-store-name", scope="global")

# sets the key 'key-name' to 68 and provides users and metadata
# DataStore.set does not return the value or an EntryInfo object, instead it returns a EntryVersion object.
datastore.set("key-name", 68, users=[287113233], metadata={"key": "value"})

# get the value with the key 'number'
# info is a EntryInfo object which contains data like the version code, metadata, userids and timestamps.
value, info = datastore.get("key-name")

print(value, info)

# increments the key 'key-name' by 1 and ensures to keep the old users and metadata
# DataStore.increment retuens a value and info pair, just like DataStore.get and unlike DataStore.set
value, info = datastore.increment("key-name", 1, users=info.users, metadata=info.metadata)

print(value, info)

# deletes the key
datastore.remove("key-name")

Publishing To Message Service

NOTE: Messages published with Open Cloud only arrive in live game servers and not in Studio.

import rblxopencloud

# create an Experience object with your experience ID and your api key
# TODO: replace '13058' with your experience ID
experience = rblxopencloud.Experience(13058, api_key="api-key-from-step-2")

# publish a message with the topic 'topic-name'
experience.publish_message("topic-name", "Hello World!")

Uploading Assets

NOTE: Only Decal, Audio, and Model (fbx) are supported right now.

import rblxopencloud

# create an User object with your user ID and your api key
# TODO: replace '13058' with your user ID
user = rblxopencloud.User(13058, api_key="api-key-from-step-2")
# or, create a Group object:
group = rblxopencloud.Group(13058, api_key="api-key-from-step-2")

# this example is for uploading a decal:
with open("path/to/file.png", "rb", encoding="utf-8") as file:
    asset = user.upload_asset(file, rblxopencloud.AssetType.Decal, "name", "description").wait()

print(asset.id)

Examples for more APIs are avalible in the examples directory.

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

rblx_open_cloud-2.0.0.tar.gz (83.6 kB view details)

Uploaded Source

Built Distribution

rblx_open_cloud-2.0.0-py3-none-any.whl (110.5 kB view details)

Uploaded Python 3

File details

Details for the file rblx_open_cloud-2.0.0.tar.gz.

File metadata

  • Download URL: rblx_open_cloud-2.0.0.tar.gz
  • Upload date:
  • Size: 83.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for rblx_open_cloud-2.0.0.tar.gz
Algorithm Hash digest
SHA256 539acba148b80c0cc1f5756b2ded2ead2b921267147d9101a3696bdf55113b55
MD5 7b9cf77233ab6dda27aafeab04affb8f
BLAKE2b-256 95f5bc593f6514bd5f5e7cad1181976b1c0a1babd3678d483af90a342fc8b554

See more details on using hashes here.

File details

Details for the file rblx_open_cloud-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rblx_open_cloud-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79add3f0c9ffa319e1cef442ee36c548af7ca72f440bf49246468ad04d87ca25
MD5 9d00bfc4415b32c246e2a9b6530b54f5
BLAKE2b-256 496a6d2f58fd1d49e7426ed5d3eced4ceb89e951aea4a46eb99e215e7569c190

See more details on using hashes here.

Supported by

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