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
Repository to access information of stocks in Bombay Stock Exchange.

BSE Repository to access information of stocks in Bombay Stock Exchange. The code in this repository uses BSE API and conclusions made using the code

1 Nov 13, 2021
PESU Academy Discord Bot built for PESsants and PESts of PES University

PESU Academy Bot PESU Academy Discord Bot built for PESsants and PESts of PES University You can add the bot to your Discord Server using this link. O

Aditeya Baral 0 Nov 16, 2021
WhatSender is a python package that allows you to send Whatsapp messages at a given time.

WhatSender is a python package that allows you to send Whatsapp messages at a given time.

IdoBarel 0 Apr 21, 2022
Anchor Protocol Script that can save you from being liquidated!

Why My day job requires a fairly good amount of automation from time to time. Besides, I do like computers to work on what I cannot while I'm sleeping

126 Oct 16, 2022
Requests based multi-threaded script for increasing followers on Spotify

Proxyless Spotify Follow Bot Requests based multi-threaded script for increasing followers on Spotify. Click here to report bugs. Usage Download ZIP h

397 Jan 03, 2023
An Undertale RPG Discord bot to fight monsters, bosses, level up and duel with other players

UNDERTALE-RPG An Undertale RPG Discord bot to fight monsters, bosses, level up and duel with other players!. Explanation you can collect gold which is

2 Oct 21, 2021
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 07, 2022
Guildead - Guilded api wrapper written in python

Guildead Guilded api wrapper written in python. I have found "exploit" (guilded

0хVιcнy#1337 5 Sep 23, 2022
Lib for create and show QRCode to PIX, you can show this code in another applications for payment by final consumer.

Biblioteca para a geração de codigos QR (BRCode como chamados na documentação do BACEN) a fins de facilitar a exibição para pagamentos ao consumidor.

João Camargo 13 Oct 05, 2022
Archive tweets and make them searchable

Tweeter Archive and search your tweets and liked tweets using AWS Lambda, DynamoDB and Elasticsearch. Note: this project is primarily being used a tes

Kamil Sindi 8 Nov 18, 2022
You can submit any PR and have SWAGS. Happy Hacktoberfest !

Excluded project Repository 🔴 🔴 🔴 - PR limit is reached. Please use another Repository Hacktoberfest 2021 🎉 🗣 Hacktoberfest encourages participat

Hansajith 63 Oct 21, 2022
“ Hey there 👋 I'm Sophia „ TG Group management bot with Some Extra features..

❤️ Sophia ❤️ Avaiilable on Telegram as SophiaBot 🏃‍♂️ Easy Deploy Mandatory Vars [+] Make Sure You Add All These Mandatory Vars. [-] APP_ID: You ca

THEEKSHANA 5 Dec 09, 2021
Easy to use API Wrapper for somerandomapi.ml.

Overview somerandomapi is an API Wrapper for some-random-api.ml Examples Asynchronous from somerandomapi import Animal import asyncio async def main

Myxi 1 Dec 31, 2021
Basic-Discord-Response-Bot, in Python

Response bot for Discord. EG: User: Hello! Bot: Hello there! About Very customizable, no credits needed. Edit the bot.py to what you want, basic Pytho

rhys 1 Nov 20, 2021
Python script for download course from platzi.com

Platzi Downloader Tool Esta es una pequeña herramienta que hace mucho y que te ahorra una gran cantidad de trabajo a la hora de descargar cursos de Pl

Devil64-Dev 21 Sep 22, 2022
Please Do Not Throw Sausage Pizza Away - Side Scrolling Up The OSI Stack

Please Do Not Throw Sausage Pizza Away - Side Scrolling Up The OSI Stack

John Capobianco 2 Jan 25, 2022
Terminal Bot which will Execute your Commands From telegram bot!

Terminal-Bot see this bot alive: https://t.me/HerokuTerminal_Bot With this bot you can execute system commands on your server. how to config? clone or

Moshe 41 Dec 09, 2022
Trading through Binance's API using Python & sqlite

pycrypt Automate trading crypto using Python to pull data from Binance's API and analyse trends. May or may not consistently lose money but oh well it

Maxim 4 Sep 02, 2022
Change between dark/light mode depending on the ambient light intensity

svart Change between dark/light mode depending on the ambient light intensity Installation Install using pip $ python3 -m pip install --user svart Ins

Siddharth Dushantha 169 Nov 26, 2022
This is Telegram Files Store Bot by @AbirHasan2005

PyroFilesStoreBot This is Telegram Parmanent Files Store Bot by @AbirHasan2005. Language: Python3 Library: Pyrogram Features: In PM Just Forward or Se

Abir Hasan 168 Dec 19, 2022