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
An information scroller Twitter trends, news, weather for raspberry pi and Pimoroni Unicorn Hat Mini and Scroll Phat HD.

uticker An information scroller Twitter trends, news, weather for raspberry pi and Pimoroni Unicorn Hat Mini and Scroll Phat HD. Features include: Twi

Tansu Åženyurt 1 Nov 28, 2021
A discord bot with information and template tracking for pxls.space.

pyCharity A discord bot with information and template tracking for pxls.space. Inspired by Mikarific's Charity bot. Try out the beta version on your s

1 Dec 03, 2021
It is automated instagram follower bot.

Instagram-Follower-Bot It is automated instagram follower bot. In This project I've used Selenium and Python. Work-Flow When I run my code. It's gonna

Falak Shair 3 Sep 28, 2022
Python API for British Geological Survey magnetic field calculator

Magnetic field calculator Python API for British Geological Survey magnetic field calculator. Description This project magnetic field calculator. It u

Filip Å  3 Mar 11, 2022
A simpler way to make forms, surveys, and reaction input using discord.py.

discord-ext-forms An easier way to make forms and surveys in discord.py. This module is a very simple way to ask questions and create complete forms i

thrizzle 16 Nov 06, 2022
Python Capfire API wrapper

General CampfireAPI based on Campfire web. Install pip install Campfire-API Quickstart Use it without login: from campfire_api import CampfireAPI cf

Ghost 0 Jan 03, 2022
A simple Discord bot that can fetch definitions and post them in chat.

A simple Discord bot that can fetch definitions and post them in chat. If you are connected to a voice channel, the bot will also read out the definition to you.

Tycho Bellers 4 Sep 29, 2022
A Telegram mirror bot which can be deployed using Heroku.

Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive. Getting Google OAuth API cred

Hafitz Setya 1.2k Jan 01, 2023
A code that can make your 5 accounts stay 24/7 in a discord voice channel!

Voicecord A code that can make your 5 accounts stay 24/7 in a discord voice channel! Usage ・Fork the repo ・Clone it to replit ・Install the required pa

DraKenCodeZ 3 Jan 09, 2022
PRNT.sc Image Grabber

PRNTSender PRNT.sc Image Grabber PRNTSender is a script that takes images posted on PRNT.sc and sends them to a Discord webhook, if you want to know h

neox 2 Dec 10, 2021
itadori webhook spammer fucker

itadori-webhook-spammer-fucker Installation # install the requirements $ python3 -m pip install -r requirements.txt $ python3 main.py Repl.it: https:/

6 Mar 05, 2022
Track live sentiment for stocks from Reddit and Twitter and identify growing stocks

Market Sentiment About This repository can mainly be used for two things. a. Tracking the live sentiment of stocks from Reddit and Twitter b. Tracking

Market Sentiment 345 Dec 17, 2022
Bypass Hcaptcha Purely based on http requests, Creates unlocked discord accounts if used correctly

hcaptcha-bypass-discord Bypass HCAPTCHA purely based on http requests Works for discord dosen't create locked accounts :)) HOW TO USE â—‰ add the hcapby

Avenger 80 Dec 22, 2022
Token-gate Notion pages

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

John 8 Oct 13, 2022
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022
McTrade is a bot exploiting Binance API, open source! built in python !

Open Source Crypto Trading Bot using Binance API Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Prerequis

Raphael Cohen 5 Jul 17, 2022
Validate all your Customer IAM Policies against AWS Access Analyzer - Policy Validation

✅ Access Analyzer - Batch Policy Validator This script will analyze using AWS Access Analyzer - Policy Validation all your account customer managed IA

Victor GRENU 41 Dec 12, 2022
A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

David .K. Danso 1 Jan 17, 2022
Slack->DynamDB->Some applications

slack-event-subscriptions About The Project Do you want to get simple attendance checks? If you are using Slack, participants can just react on a spec

UpstageAI 26 May 28, 2022
Python library for interacting with the Wunderlist 2 REST API

Overview Wunderpy2 is a thin Python library for accessing the official Wunderlist 2 API. What does a thin library mean here? Only the bare minimum of

mieubrisse 24 Dec 29, 2020