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
Asynchronous Python Wrapper for the GoFile API

Asynchronous Python Wrapper for the GoFile API

Gautam Kumar 22 Aug 4, 2022
Asynchronous Python Wrapper for the Ufile API

Ufile.io Asynchronous Python Wrapper for the Ufile API (Unofficial).

Gautam Kumar 16 Aug 31, 2022
Asynchronous Guilded API wrapper for Python

Welcome to guilded.py, a discord.py-esque asynchronous Python wrapper for the Guilded API. If you know discord.py, you know guilded.py. Documentation

shay 115 Dec 30, 2022
Asynchronous Python API Wrapper for phisherman.gg

Asynchronous Python API Wrapper for phisherman.gg

Qrista Labs 4 Apr 30, 2022
Fully asynchronous trace.moe API wrapper

AioMoe Fully asynchronous trace.moe API wrapper Installation You can install the stable version from PyPI: $ pip install aiomoe Or get it from github

null 2 Jun 26, 2022
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and await

Senpai Development 4 Nov 5, 2021
A modern,feature-rich, and async ready API wrapper for Discord written in Python

discord.io A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using asyn

Vincent 18 Jan 2, 2023
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

disfork A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async a

null 2 Feb 9, 2022
A modern, easy to use, feature-rich, and async ready API wrapper improved and revived from original discord.py.

A Python API wrapper that is improved and revived from the original discord.py

Orion 19 Nov 6, 2021
Discord Webhook Proxy for Roblox payloads.

RoProxy A Discord webhook proxy passthrough for roblox. Setup Your port and endpoint are in the config.json, make sure both app.py and config.json are

PythonSerious 2 Nov 5, 2021
Find Roblox Groups & Send To Discord

Roblox-Group-Finder A tool to help you find ownerless roblox groups :) It's really easy, all you need is a discord webhook :) It will not send locked

null 1 Dec 13, 2021
A nuker for Roblox accounts.

Roblox-Nuker A nuker for Roblox accounts. Made by Ice Bear#0167 Usage I would recommend running in replit (https://replit.com) as it is deprecated in

null 7 May 10, 2022
Roblox-Account-Gen - A simple account generator not using paid solving services

Roblox Account Generator Star this if it helped to spread awareness! No 2captcha

x 1 Feb 17, 2022
Asynchronous wrapper для Gismeteo.ru.

aiopygismeteo Асинхронная обёртка для Gismeteo.ru. Синхронная версия здесь. Установка python -m pip install -U aiopygismeteo Документация https://aiop

Almaz 6 Dec 8, 2022
Asynchronous wrapper for wttr.in weather forecast.

aiopywttr Asynchronous wrapper for wttr.in weather forecast. Synchronous version here. Installation pip install aiopywttr Example This example prints

Almaz 4 Dec 24, 2022
The modern Lavalink wrapper designed for discord.py

Pomice The modern Lavalink wrapper designed for discord.py This library is heavily based off of/uses code from the following libraries: Wavelink Slate

Gstone 1 Feb 2, 2022
🖥️ Python - P1 Monitor API Asynchronous Python Client

??️ Asynchronous Python client for the P1 Monitor

Klaas Schoute 9 Dec 12, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
Python: Asynchronous client for the Tailscale API

Python: Asynchronous client for the Tailscale API Asynchronous client for the Tailscale API. About This package allows you to control and monitor Tail

Franck Nijhof 9 Nov 22, 2022