ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.

Overview

ro.py

GitHub | Discord | PyPI | Documentation | Examples | License

RoAPI Discord ro.py PyPI ro.py PyPI Downloads ro.py PyPI Downloads (Legacy) ro.py PyPI License ro.py GitHub Commit Activity ro.py GitHub Last Commit

Overview

Welcome to ro.py! ro.py is an asynchronous, object-oriented wrapper for the Roblox web API.

Features

The key features are:

  • Asynchronous: ro.py works well with asynchronous frameworks like FastAPI and discord.py.
  • Easy: ro.py's client-based model is intuitive and easy to learn for both the beginner and expert developer. It abstracts away API requests and leaves you with simple objects that represent data types on the Roblox platform.
  • Flexible: ro.py's builtin Requests object allows the user to do things that we haven't already implemented ourselves without dealing with advanced Roblox-specific concepts.

Installation

To install ro.py from PyPI, you can install with pip:

pip install roblox

To install the latest unstable version of ro.py, install git-scm and run the following:

pip install git+git://github.com/ro-py/ro.py.git

Tutorial

Learn how to use ro.py in our docs: https://ro.py.jmk.gg/tutorial/

Comments
  • Problems with .join() and browser_tracker_id

    Problems with .join() and browser_tracker_id

    Describe the bug When trying to launch a game I get this error pycharm64_RoMMnoEtNO

    To Reproduce Use .join() on a root game place

    Expected behavior Expected the game to start

    Additional context I am using the Bleeding Edge version as the stable one had the error in the screenshot pycharm64_099xeypO9t

    opened by ghost 8
  • Message Router API

    Message Router API

    This API only consists of /v1/router/signalr, and will only support Studio messages (I haven't found out what the main channel/main accessKey is for open grid servers)

    opened by nikita-petko 8
  • Inconsistencies between return types on different Client methods

    Inconsistencies between return types on different Client methods

    Roblox endpoints that take in a single ID, like users.roblox.com/v1/users/{userId}, usually raise errors when the passed ID is invalid or does not exist. For example, /v1/users/{userId} returns the following data and a 404 error when an invalid user ID is passed:

    {
      "errors": [
        {
          "code": 3,
          "message": "The user id is invalid.",
          "userFacingMessage": "Something went wrong"
        }
      ]
    }
    

    In ro.py, this means we can raise a NotFound error:

    roblox.utilities.exceptions.NotFound: 404 Not Found: https://users.roblox.com/v1/users/4.
    
    Errors:
    	3: The user id is invalid.
    		User-facing message: Something went wrong
    

    Endpoints that take in multiple user IDs, like games.roblox.com/v1/games/multiget-place-details, tend to ignore invalid IDs and don't raise errors if none of the IDs are valid. In ro.py, all of our get_PLURAL functions like get_places and get_universes maintain this behavior and do not raise errors for invalid IDs.

    The issue is that not all of our get_SINGULAR functions use endpoints that only take in one ID. multiget-place-details is the only endpoint ro.py uses for places. Because it does not raise an error, get_place returns None if the place is invalid and doesn't raise an exception. Multiple other methods also have this behavior.

    This causes an inconsistency between methods where some methods (the ones that send requests that take just one ID) raise errors with invalid inputs, but other methods (the ones that take multiple IDs but only pass one) don't raise errors.

    The following Client methods all return None with invalid IDs:

    get_user_by_username()
    get_universe()
    get_place()
    get_plugin()
    

    All other singular methods raise exceptions for invalid IDs. This causes an inconsistency between methods. What should we do?

    We have a couple options here:

    • Make the other methods also return None instead of raising exceptions
      • Not only is this a large breaking change, but it's also not proper when compared to API responses which do raise errors. I feel better about raising errors manually than I do about replacing the API's error behavior.
    • Raise fake NotFound errors on these methods in particular
      • I don't like this because we're only supposed to raise NotFound for actual 404 errors.
    • Create custom errors, like UserNotFound that are raised in place of NotFound on get_user and get_user_by_username, and do the same for other methods
      • This means you can't do a try-except for NotFound on get_user anymore, which is breaking.
      • Making it a subclass of HTTPException kind of breaks the rules because it's really only for 4xx/5xx HTTP status codes, not for other purposes.
      • Making it a subclass of RobloxException means we're not raising the right exception for get_user anymore. That's an actual HTTP exception, so I think we should keep that there.
      • Only raising it for get_user_by_username and not get_user is a bit weird for the developer because there's an exception called UserNotFound that isn't raised on the method used to get users but is raised on the method used to get users by username.
    • Live with the inconsistencies.
      • Obviously not ideal. 😔
    • Completely get rid of get_user_by_username, get_universe, get_place and get_plugin and force developers to use their plural counterparts: get_users_by_username, get_universes, get_places and get_plugins.
      • This makes the methods consistent now but breaks existing code and is not really ideal.
    opened by jmkd3v 7
  • Advice for the rewrite

    Advice for the rewrite

    There is an issue with production right now, there is little to no strong typing on anything.

    All implementations for the rewrite should be strong typed, as it is supported.

    The benefits of this include stronger intellisense.

    If you look at my libraries they show strong typed code, with predicable interfaces, it is preferable to do this because it is more convenient than having to go to some documentation page.

    image image

    You can disregard this issue if you wish, but take it into mind.

    opened by nikita-petko 4
  • PIP install Error

    PIP install Error

    So when I try to install the latest version using the readme as a guide, I get an exit code of 128 and am unable to install.

      Cloning git://github.com/ro-py/ro.py.git to c:\users\willy\appdata\local\temp\pip-req-build-6sxtv1nh
      Running command git clone --filter=blob:none --quiet git://github.com/ro-py/ro.py.git 'C:\Users\###\AppData\Local\Temp\pip-req-build-6sxtv1nh'
      fatal: unable to connect to github.com:
      github.com[0: 140.82.113.4]: errno=Unknown error
    
      error: subprocess-exited-with-error
    
      × git clone --filter=blob:none --quiet git://github.com/ro-py/ro.py.git 'C:\Users\###\AppData\Local\Temp\pip-req-build-6sxtv1nh' did not run successfully.
      │ exit code: 128
      ╰─> See above for output.
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × git clone --filter=blob:none --quiet git://github.com/ro-py/ro.py.git 'C:\Users\###\AppData\Local\Temp\pip-req-build-6sxtv1nh' did not run successfully.
    │ exit code: 128
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.```
    opened by LIPDProductionsInc 2
  • Calling group.get_member(id) errors

    Calling group.get_member(id) errors

    Describe the bug When calling group.get_member(id), the following error is thrown:

    obraz

    To Reproduce Call .get_member(id) on a group object.

    Expected behaviour Expected the call to not error and return a Member object.

    Additional context A request to https://groups.roblox.com/v2/users/{userId}/groups/roles is sent, and passed on to Member. It will attempt to index the user key on the data, which errors because the endpoint does not return that data.

    obraz

    opened by zmadie 2
  • Fix get_member_by_id not found error.

    Fix get_member_by_id not found error.

    Before, get_member_by_id would error with a NotFound since it was trying to compare a string and an int. This just adds an int() to convert the group id to an int, which is what the response is.

    opened by slickxz 2
  • Checking a user's inventory

    Checking a user's inventory

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] NO If your feature is related to implementing a new Roblox API, provide information here. API URL: https://users.roblox.com/v1/users/{userId} Documented: Yes/No no

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. It would be cool if we could check a user's inventory for checking gamepasses or asset's and then from there, ranking them in your group. Additional context Add any other context or screenshots about the feature request here.

    opened by kenthegreat8 2
  • Add a function for change the password

    Add a function for change the password

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    If your feature is related to implementing a new Roblox API, provide information here. API URL: https://users.roblox.com/v1/users/{userId} Documented: Yes/No

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by HRT9014 1
  • Improve docs

    Improve docs

    Improving the docs would improve developers workflow and code efficiency which would result in lower amount of requests aswell.

    My suggestion on how to improve docs:

    • Add ~40px space or a separator between each method so its visible what belongs where
    • Remove unnecessary source code snippets and replace them with code examples (on the methods which might sound confusing)
    • Remove unnecessary init constructors found at some methods
    • Make an examples tab
    opened by kuhanaklobasa 1
  • Turn ro.py objects into Python dataclasses

    Turn ro.py objects into Python dataclasses

    The Python 3.7 feature "Dataclasses" could be very useful for ro.py. Our objects, like User, should be immutable as the only way to return new information is generating a new object entirely. https://docs.python.org/3.9/library/dataclasses.html

    opened by jmkd3v 1
  • Added has_verified_badge

    Added has_verified_badge

    Changes:

    • Added has_verified_badge to User
    • Added has_verified_badge to PartialUser
    • Added has_verified_badge to Group
    • Added has_verified_badge to UniversePartialGroup
    • Added has_verified_badge to AssetPartialGroup
    • Added has_verified_badge to Place
    • Added has_verified_badge to Member
    opened by Jodenee 0
  • Update client.py

    Update client.py

    Add group_search to client.

    E.g:

     async for group in client.group_search("roblox").items(10):
        print(group.name)
    

    Returns:

    Roblox
    Roblox High School: Fan Club
    RODNY ROBLOX
    Roblox Wiki
    Studios Military Roleplay Fan Roblox Clothing
    LankyBox Roblox Group!
    Roblox+
    Roblox Military Building Roleplaying Community
    Robloxian High School Group
    Roblox catalog Group fan
    
    opened by CookieHax 0
  • Documentation fixes

    Documentation fixes

    Fixes links to the Bases page for every get_base_XYZ method documentation and clarifies that get_base_XYZ is not asynchronous and does not need to be awaited in bases.md

    opened by Auriosi 0
  • Add an option to pass your own requests class into the client

    Add an option to pass your own requests class into the client

    Is your feature request related to a problem? Please describe. Yes, I wanted to customise timeouts but I didn't have a way so I wrote spaghetti code :=)

    If your feature is related to implementing a new Roblox API, provide information here. API URL: none Documented: none

    Describe the solution you'd like Add an option to pass your own requests class into the client

    Describe alternatives you've considered None

    Additional context

    session = httpx.Session(timeout=10)
    requests = Requests(
        url_generator=None,
        session=session
    )
    client = Client(requests=requests)
    
    opened by kuhanaklobasa 1
Releases(v2.0.0)
Owner
ro.py
ro.py is a powerful Python library for interacting with the Roblox web API.
ro.py
This code will guide you on how you can make your own Twitter Bot.

This code will guide you on how you can make your own Twitter Bot. This bot retweets, and likes to tweet with a particular word, here Python3.

Kunal Diwan 1 Oct 14, 2022
JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with spotify and youtube playlist support

Just Another Konsole YouTube-Music Overview I wanted to create this application so that I could use the command line to play music easily. I often pla

Mayank Jha 73 Jan 01, 2023
A Next-Gen modular Python3 Telegram-Bot with Anime Theme to it.

Hsea Robot A modular Telegram Python bot running on python3 with a sqlalchemy database and an entirely themed persona to make Cutiepii suitable for An

Wahyusaputra 1 Dec 29, 2021
Centralized whale instance using github actions, sourcing metadata from bigquery-public-data.

Whale Demo Instance: Bigquery Public Data This is a fully-functioning demo instance of the whale data catalog, actively scraping data from Bigquery's

Hyperquery 17 Dec 14, 2022
Simple Bot With Python 3.8+ For Converstaion Your Media

Media-Conversation Simple Bot With Python 3.8+ For Converstaion Your Media

Farzin 2 Dec 06, 2021
fair-test is a library to build and deploy FAIR metrics tests APIs supporting the specifications used by the FAIRMetrics working group.

☑️ FAIR test fair-test is a library to build and deploy FAIR metrics tests APIs supporting the specifications used by the FAIRMetrics working group. I

Maastricht University IDS 6 Oct 30, 2022
Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

Matheus Muguet 4 Feb 05, 2022
A python notification tool used for sending you text messages when certain conditions are met in the game, Neptune's Pride.

A python notification tool used for sending you text messages when certain conditions are met in the game, Neptune's Pride.

Paul Clarke 1 Jan 16, 2022
Herramienta para transferir eventos de Sucuri WAF hacia Azure Monitor Log Analytics.

Transfiere eventos de Sucuri hacia Azure LogAnalytics Script para transferir eventos del Sucuri Web Application Firewall (WAF) hacia Azure LogAnalytic

CSIRT-RD 1 Dec 22, 2021
A beginner’s guide to train and deploy machine learning pipelines in Python using PyCaret

This model involves Insurance bill prediction, which was subsequently deployed on Heroku PaaS

1 Jan 27, 2022
A bot to get Statistics like the Playercount from your Minecraft-Server on your Discord-Server

Hey Thanks for reading me. Warning: My English is not the best I have programmed this bot to show me statistics about the player numbers and ping of m

spaffel 12 Sep 24, 2022
Send GitHub Issues, PRs or Discussions Updates to Wechat

Send GitHub Issues, PRs or Discussions Updates to Wechat

Hollow Man 2 Jul 12, 2022
Policy and data administration, distribution, and real-time updates on top of Open Policy Agent

⚡ OPAL ⚡ Open Policy Administration Layer OPAL is an administration layer for Open Policy Agent (OPA), detecting changes to both policy and policy dat

8 Dec 07, 2022
This is Pdisk Upload Bot made using Python with Pyrogram Framework. Its capable of uploading direct download link with thumbnail or without thumbnail & with Title Support.

Pdisk-Upload-Bot Introduction This Is PDisk Upload Bot Used To Upload Direct Link To Pdisk With Thumb Support Deploy Heroku Deploy Local Deploy pip in

HEIMAN PICTURES 32 Oct 21, 2022
SpaceManJax's open-source Discord Bot. Now on Github!

SpaceManBot This is SpaceManJax's open-source Discord.py Bot. Now on Github! This bot runs on Repl.it, which is a free online code editor. It can do a

Jack 1 Nov 16, 2021
Telegram Voice Chat UserBot made with Pyrogram and MarshalX/tgcalls with playlist and Heroku support

Telegram Voice Chat UserBot A Telegram UserBot to Play Audio in Voice Chats. This is also the source code of the userbot which is being used for playi

Calls Music 164 Nov 12, 2022
Open Resource Calculator Module for Python

Calculator Module for Python By White Night Install #

White_Night_awa 4 Aug 22, 2022
This is a repository for the Duke University Cloud Computing course project on Serveless Data Engineering Pipeline. For this project, I recreated the below pipeline.

AWS Data Engineering Pipeline This is a repository for the Duke University Cloud Computing course project on Serverless Data Engineering Pipeline. For

15 Jul 28, 2021
This is a okay that is okay that means none is okay

Owner: Masterolic 🇮🇳 CatUB A Powerful, Smart And Simple Userbot In Telethon. Credits This is A Remix Bot Of Many UserBot. DARKCOBRA FridayUserBot Ja

Masterolic 1 Nov 28, 2021
Bulk NFT uploader to OpenSea!

Bulk NFT Uploader Description Simple easy peasy python script which logins to opensea account using metamask and bulk uploads NFT to your default coll

Lakshya Khera 25 May 23, 2022