# rblx-open-cloud
[![Discord Server](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Finvites%2F4CSc9E5uQy%3Fwith_counts%3Dtrue&query=%24.approximate_member_count&suffix=%20members&style=for-the-badge&logo=discord&logoColor=white&label=Discord%20Server&labelColor=%235865F2&color=%23353535)](https://discord.gg/4CSc9E5uQy)
[![DevForum Post](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdevforum.roproxy.com%2Ft%2F1991959.json&query=%24.like_count&suffix=%20Likes&style=for-the-badge&logo=robloxstudio&logoColor=white&label=DevForum%20Post&labelColor=%23009fff&color=%23353535)](https://devforum.roblox.com/t/1991959)
[![Downloads](https://img.shields.io/pypi/dm/rblx-open-cloud?style=for-the-badge&logo=pypi&logoColor=white&label=PyPi%20Downloads&labelColor=%23006dad&color=%23353535)](https://pypi.org/project/rblx-open-cloud)
rblx-open-cloud is a Python API wrapper for [Roblox Open Cloud](https://create.roblox.com/docs/open-cloud/index). It supports all experience and creator APIs, OAuth2, and incoming webhooks.
**Documentation: https://rblx-open-cloud.readthedocs.io**
## Quickstart
### Getting Started
1. Install the library with pip in your terminal.
```console
pip install rblx-open-cloud
```
2. Create an API key from the [Creator Dashboard](https://create.roblox.com/credentials). You can read [Managing API Keys](https://create.roblox.com/docs/open-cloud/managing-api-keys) for help.
You've got the basics down, below are examples for some of the APIs.
### Accessing Data Stores
```py
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.**
```py
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.**
```py
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-object.png", "rb") as file:
user.upload_asset(file, rblxopencloud.AssetType.Decal, "name", "description")
# this will wait until Roblox has processed the upload
if isinstance(asset, rblxopencloud.Asset):
# if it's already been processed, then print the asset.
print(asset)
else:
# otherwise, we'll go into a loop that continuosly checks if it's done.
while True:
# this will try to check if the asset has been processed yet
operation = asset.fetch_operation()
if operation:
# if it has been print it then stop the loop.
print(operation)
break
```
Examples for more APIs are avalible in the [examples](https://github.com/TreeBen77/rblx-open-cloud/tree/main/examples) directory.
Raw data
{
"_id": null,
"home_page": "https://github.com/TreeBen77/rblx-open-cloud",
"name": "rblx-open-cloud",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": "",
"keywords": "roblox,open-cloud,data-store,place-publishing,mesageing-service",
"author": "TreeBen77",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/57/a3/45d50f7404d1f8a06c3e8e3ba658ee18a6a45b86fd7b8559bbbee3e28589/rblx-open-cloud-1.5.1.tar.gz",
"platform": null,
"description": "# rblx-open-cloud\n[![Discord Server](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Finvites%2F4CSc9E5uQy%3Fwith_counts%3Dtrue&query=%24.approximate_member_count&suffix=%20members&style=for-the-badge&logo=discord&logoColor=white&label=Discord%20Server&labelColor=%235865F2&color=%23353535)](https://discord.gg/4CSc9E5uQy)\n[![DevForum Post](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdevforum.roproxy.com%2Ft%2F1991959.json&query=%24.like_count&suffix=%20Likes&style=for-the-badge&logo=robloxstudio&logoColor=white&label=DevForum%20Post&labelColor=%23009fff&color=%23353535)](https://devforum.roblox.com/t/1991959)\n[![Downloads](https://img.shields.io/pypi/dm/rblx-open-cloud?style=for-the-badge&logo=pypi&logoColor=white&label=PyPi%20Downloads&labelColor=%23006dad&color=%23353535)](https://pypi.org/project/rblx-open-cloud)\n\nrblx-open-cloud is a Python API wrapper for [Roblox Open Cloud](https://create.roblox.com/docs/open-cloud/index). It supports all experience and creator APIs, OAuth2, and incoming webhooks.\n\n**Documentation: https://rblx-open-cloud.readthedocs.io**\n\n## Quickstart\n\n### Getting Started\n\n1. Install the library with pip in your terminal.\n ```console\n pip install rblx-open-cloud\n ```\n\n2. Create an API key from the [Creator Dashboard](https://create.roblox.com/credentials). You can read [Managing API Keys](https://create.roblox.com/docs/open-cloud/managing-api-keys) for help.\n\nYou've got the basics down, below are examples for some of the APIs.\n\n### Accessing Data Stores\n```py\nimport rblxopencloud\n\n# create an Experience object with your experience ID and your api key\n# TODO: replace '13058' with your experience ID\nexperience = rblxopencloud.Experience(13058, api_key=\"api-key-from-step-2\")\n\n# get the data store, using the data store name and scope (defaults to global)\ndatastore = experience.get_data_store(\"data-store-name\", scope=\"global\")\n\n# sets the key 'key-name' to 68 and provides users and metadata\n# DataStore.set does not return the value or an EntryInfo object, instead it returns a EntryVersion object.\ndatastore.set(\"key-name\", 68, users=[287113233], metadata={\"key\": \"value\"})\n\n# get the value with the key 'number'\n# info is a EntryInfo object which contains data like the version code, metadata, userids and timestamps.\nvalue, info = datastore.get(\"key-name\")\n\nprint(value, info)\n\n# increments the key 'key-name' by 1 and ensures to keep the old users and metadata\n# DataStore.increment retuens a value and info pair, just like DataStore.get and unlike DataStore.set\nvalue, info = datastore.increment(\"key-name\", 1, users=info.users, metadata=info.metadata)\n\nprint(value, info)\n\n# deletes the key\ndatastore.remove(\"key-name\")\n```\n\n### Publishing To Message Service\n**NOTE: Messages published with Open Cloud only arrive in live game servers and not in Studio.**\n```py\nimport rblxopencloud\n\n# create an Experience object with your experience ID and your api key\n# TODO: replace '13058' with your experience ID\nexperience = rblxopencloud.Experience(13058, api_key=\"api-key-from-step-2\")\n\n# publish a message with the topic 'topic-name'\nexperience.publish_message(\"topic-name\", \"Hello World!\")\n```\n\n### Uploading Assets\n**NOTE: Only `Decal`, `Audio`, and `Model` (fbx) are supported right now.**\n```py\nimport rblxopencloud\n\n# create an User object with your user ID and your api key\n# TODO: replace '13058' with your user ID\nuser = rblxopencloud.User(13058, api_key=\"api-key-from-step-2\")\n# or, create a Group object:\ngroup = rblxopencloud.Group(13058, api_key=\"api-key-from-step-2\")\n\n# this example is for uploading a decal:\nwith open(\"path-to/file-object.png\", \"rb\") as file:\n user.upload_asset(file, rblxopencloud.AssetType.Decal, \"name\", \"description\")\n\n# this will wait until Roblox has processed the upload\nif isinstance(asset, rblxopencloud.Asset):\n # if it's already been processed, then print the asset.\n print(asset)\nelse:\n # otherwise, we'll go into a loop that continuosly checks if it's done.\n while True:\n # this will try to check if the asset has been processed yet\n operation = asset.fetch_operation()\n if operation:\n # if it has been print it then stop the loop.\n print(operation)\n break\n```\nExamples for more APIs are avalible in the [examples](https://github.com/TreeBen77/rblx-open-cloud/tree/main/examples) directory.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "API wrapper for Roblox Open Cloud",
"version": "1.5.1",
"project_urls": {
"Homepage": "https://github.com/TreeBen77/rblx-open-cloud"
},
"split_keywords": [
"roblox",
"open-cloud",
"data-store",
"place-publishing",
"mesageing-service"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1bae9fff5c3f5154ae7af233c512f5166a84161e229f4dc94025bb0599c99f30",
"md5": "aa4dc7aec5b2527d6d7a9f2d1297265a",
"sha256": "1fd22adc4392aee55057321f68c1e314e7302b643651740688539020a8bfd8ba"
},
"downloads": -1,
"filename": "rblx_open_cloud-1.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aa4dc7aec5b2527d6d7a9f2d1297265a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 22354,
"upload_time": "2023-09-25T22:37:37",
"upload_time_iso_8601": "2023-09-25T22:37:37.840905Z",
"url": "https://files.pythonhosted.org/packages/1b/ae/9fff5c3f5154ae7af233c512f5166a84161e229f4dc94025bb0599c99f30/rblx_open_cloud-1.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57a345d50f7404d1f8a06c3e8e3ba658ee18a6a45b86fd7b8559bbbee3e28589",
"md5": "58de8a610d288945a117b420b2bf0193",
"sha256": "f7562a75f92a77cd23f002c609bf085aaf1080a4d5b70523a7bd54e986a309d0"
},
"downloads": -1,
"filename": "rblx-open-cloud-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "58de8a610d288945a117b420b2bf0193",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 18104,
"upload_time": "2023-09-25T22:37:38",
"upload_time_iso_8601": "2023-09-25T22:37:38.913033Z",
"url": "https://files.pythonhosted.org/packages/57/a3/45d50f7404d1f8a06c3e8e3ba658ee18a6a45b86fd7b8559bbbee3e28589/rblx-open-cloud-1.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-25 22:37:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TreeBen77",
"github_project": "rblx-open-cloud",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rblx-open-cloud"
}