Skip to content

Commit

Permalink
readme update + httpx + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkd3v committed Jan 19, 2021
1 parent 1f21dde commit dcad429
Show file tree
Hide file tree
Showing 21 changed files with 2,152 additions and 493 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ ro.py is an object oriented, asynchronous wrapper for the Roblox Web API (and ot
ro.py allows you to automate much of what you would do on the Roblox website and on other Roblox-related websites.

## Requirements
- httpx (for sending requests)
- iso8601 (for parsing dates)
- signalrcore (for recieving notifications)
- ~~cachecontrol (for caching requests)~~
- requests-async (for sending requests, might be updated to a new lib soon)
- ~~requests-async (for sending requests, might be updated to a new lib soon)~~
- pytweening (for UI animations for the "prompts" extension, optional)
- wxPython (for the "prompts" extension, optional)
- wxasync (see above)
Expand All @@ -32,7 +33,9 @@ We are not responsible for any malicious use of this library.
If you use this library in a way that violates the [Roblox Terms of Use](https://en.help.roblox.com/hc/en-us/articles/115004647846-Roblox-Terms-of-Use) your account may be punished.

## Documentation
You can view documentation for ro.py at [ro.py.jmksite.dev](https://ro.py.jmksite.dev/). If something's missing from docs, feel free to dive into the code and read the docstrings as most things are documented there.
You can view documentation for ro.py at [ro.py.jmksite.dev](https://ro.py.jmksite.dev/).
If something's missing from docs, feel free to dive into the code and read the docstrings as most things are documented there.
The docs are generated from docstrings in the code using pdoc3.

## Installation
You can install ro.py from pip:
Expand Down
62 changes: 56 additions & 6 deletions docs/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ <h1 class="title">Module <code>ro_py.assets</code></h1>
ID of the asset.
&#34;&#34;&#34;

def __init__(self, requests, asset_id):
def __init__(self, cso, asset_id):
self.id = asset_id
self.requests = requests
self.cso = cso
self.requests = cso.requests
self.target_id = None
self.product_type = None
self.asset_id = None
Expand Down Expand Up @@ -172,7 +173,15 @@ <h1 class="title">Module <code>ro_py.assets</code></h1>
class UserAsset(Asset):
def __init__(self, requests, asset_id, user_asset_id):
super().__init__(requests, asset_id)
self.user_asset_id = user_asset_id</code></pre>
self.user_asset_id = user_asset_id


class Events:
def __init__(self, cso):
self.cso = cso

async def bind(self, func, event, delay=15):
pass</code></pre>
</details>
</section>
<section>
Expand All @@ -186,7 +195,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="ro_py.assets.Asset"><code class="flex name class">
<span>class <span class="ident">Asset</span></span>
<span>(</span><span>requests, asset_id)</span>
<span>(</span><span>cso, asset_id)</span>
</code></dt>
<dd>
<div class="desc"><p>Represents an asset.</p>
Expand All @@ -213,9 +222,10 @@ <h2 id="parameters">Parameters</h2>
ID of the asset.
&#34;&#34;&#34;

def __init__(self, requests, asset_id):
def __init__(self, cso, asset_id):
self.id = asset_id
self.requests = requests
self.cso = cso
self.requests = cso.requests
self.target_id = None
self.product_type = None
self.asset_id = None
Expand Down Expand Up @@ -416,6 +426,40 @@ <h2 id="returns">Returns</h2>
</dd>
</dl>
</dd>
<dt id="ro_py.assets.Events"><code class="flex name class">
<span>class <span class="ident">Events</span></span>
<span>(</span><span>cso)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class Events:
def __init__(self, cso):
self.cso = cso

async def bind(self, func, event, delay=15):
pass</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="ro_py.assets.Events.bind"><code class="name flex">
<span>async def <span class="ident">bind</span></span>(<span>self, func, event, delay=15)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">async def bind(self, func, event, delay=15):
pass</code></pre>
</details>
</dd>
</dl>
</dd>
<dt id="ro_py.assets.UserAsset"><code class="flex name class">
<span>class <span class="ident">UserAsset</span></span>
<span>(</span><span>requests, asset_id, user_asset_id)</span>
Expand Down Expand Up @@ -483,6 +527,12 @@ <h4><code><a title="ro_py.assets.Asset" href="#ro_py.assets.Asset">Asset</a></co
</ul>
</li>
<li>
<h4><code><a title="ro_py.assets.Events" href="#ro_py.assets.Events">Events</a></code></h4>
<ul class="">
<li><code><a title="ro_py.assets.Events.bind" href="#ro_py.assets.Events.bind">bind</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="ro_py.assets.UserAsset" href="#ro_py.assets.UserAsset">UserAsset</a></code></h4>
</li>
</ul>
Expand Down
12 changes: 7 additions & 5 deletions docs/badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ <h1 class="title">Module <code>ro_py.badges</code></h1>
badge_id
ID of the badge.
&#34;&#34;&#34;
def __init__(self, requests, badge_id):
def __init__(self, cso, badge_id):
self.id = badge_id
self.requests = requests
self.cso = cso
self.requests = cso.requests
self.name = None
self.description = None
self.display_name = None
Expand Down Expand Up @@ -124,7 +125,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="ro_py.badges.Badge"><code class="flex name class">
<span>class <span class="ident">Badge</span></span>
<span>(</span><span>requests, badge_id)</span>
<span>(</span><span>cso, badge_id)</span>
</code></dt>
<dd>
<div class="desc"><p>Represents a game-awarded badge.</p>
Expand All @@ -150,9 +151,10 @@ <h2 id="parameters">Parameters</h2>
badge_id
ID of the badge.
&#34;&#34;&#34;
def __init__(self, requests, badge_id):
def __init__(self, cso, badge_id):
self.id = badge_id
self.requests = requests
self.cso = cso
self.requests = cso.requests
self.name = None
self.description = None
self.display_name = None
Expand Down
41 changes: 21 additions & 20 deletions docs/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ <h1 class="title">Module <code>ro_py.chat</code></h1>


class ConversationTyping:
def __init__(self, requests, conversation_id):
self.requests = requests
def __init__(self, cso, conversation_id):
self.cso = cso
self.requests = cso.requests
self.id = conversation_id

async def __aenter__(self):
Expand All @@ -97,22 +98,23 @@ <h1 class="title">Module <code>ro_py.chat</code></h1>


class Conversation:
def __init__(self, requests, conversation_id=None, raw=False, raw_data=None):
self.requests = requests
def __init__(self, cso, conversation_id=None, raw=False, raw_data=None):
self.cso = cso
self.requests = cso.requests
self.raw = raw
self.id = None
self.title = None
self.initiator = None
self.type = None
self.typing = ConversationTyping(self.requests, conversation_id)
self.typing = ConversationTyping(self.cso, conversation_id)

if self.raw:
data = raw_data
self.id = data[&#34;id&#34;]
self.title = data[&#34;title&#34;]
self.initiator = User(self.requests, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.initiator = User(self.cso, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.type = data[&#34;conversationType&#34;]
self.typing = ConversationTyping(self.requests, conversation_id)
self.typing = ConversationTyping(self.cso, conversation_id)

async def update(self):
conversation_req = await self.requests.get(
Expand All @@ -126,7 +128,6 @@ <h1 class="title">Module <code>ro_py.chat</code></h1>
self.title = data[&#34;title&#34;]
self.initiator = User(self.requests, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.type = data[&#34;conversationType&#34;]
self.typing = ConversationTyping(self.requests, conversation_id)

async def get_message(self, message_id):
return Message(self.requests, message_id, self.id)
Expand Down Expand Up @@ -370,7 +371,7 @@ <h2 id="parameters">Parameters</h2>
</dd>
<dt id="ro_py.chat.Conversation"><code class="flex name class">
<span>class <span class="ident">Conversation</span></span>
<span>(</span><span>requests, conversation_id=None, raw=False, raw_data=None)</span>
<span>(</span><span>cso, conversation_id=None, raw=False, raw_data=None)</span>
</code></dt>
<dd>
<div class="desc"></div>
Expand All @@ -379,22 +380,23 @@ <h2 id="parameters">Parameters</h2>
<span>Expand source code</span>
</summary>
<pre><code class="python">class Conversation:
def __init__(self, requests, conversation_id=None, raw=False, raw_data=None):
self.requests = requests
def __init__(self, cso, conversation_id=None, raw=False, raw_data=None):
self.cso = cso
self.requests = cso.requests
self.raw = raw
self.id = None
self.title = None
self.initiator = None
self.type = None
self.typing = ConversationTyping(self.requests, conversation_id)
self.typing = ConversationTyping(self.cso, conversation_id)

if self.raw:
data = raw_data
self.id = data[&#34;id&#34;]
self.title = data[&#34;title&#34;]
self.initiator = User(self.requests, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.initiator = User(self.cso, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.type = data[&#34;conversationType&#34;]
self.typing = ConversationTyping(self.requests, conversation_id)
self.typing = ConversationTyping(self.cso, conversation_id)

async def update(self):
conversation_req = await self.requests.get(
Expand All @@ -408,7 +410,6 @@ <h2 id="parameters">Parameters</h2>
self.title = data[&#34;title&#34;]
self.initiator = User(self.requests, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.type = data[&#34;conversationType&#34;]
self.typing = ConversationTyping(self.requests, conversation_id)

async def get_message(self, message_id):
return Message(self.requests, message_id, self.id)
Expand Down Expand Up @@ -486,15 +487,14 @@ <h3>Methods</h3>
self.id = data[&#34;id&#34;]
self.title = data[&#34;title&#34;]
self.initiator = User(self.requests, data[&#34;initiator&#34;][&#34;targetId&#34;])
self.type = data[&#34;conversationType&#34;]
self.typing = ConversationTyping(self.requests, conversation_id)</code></pre>
self.type = data[&#34;conversationType&#34;]</code></pre>
</details>
</dd>
</dl>
</dd>
<dt id="ro_py.chat.ConversationTyping"><code class="flex name class">
<span>class <span class="ident">ConversationTyping</span></span>
<span>(</span><span>requests, conversation_id)</span>
<span>(</span><span>cso, conversation_id)</span>
</code></dt>
<dd>
<div class="desc"></div>
Expand All @@ -503,8 +503,9 @@ <h3>Methods</h3>
<span>Expand source code</span>
</summary>
<pre><code class="python">class ConversationTyping:
def __init__(self, requests, conversation_id):
self.requests = requests
def __init__(self, cso, conversation_id):
self.cso = cso
self.requests = cso.requests
self.id = conversation_id

async def __aenter__(self):
Expand Down
Loading

0 comments on commit dcad429

Please sign in to comment.