File tree Expand file tree Collapse file tree 6 files changed +698
-374
lines changed
Expand file tree Collapse file tree 6 files changed +698
-374
lines changed Original file line number Diff line number Diff line change 22
33Unofficial Client for Piazza's Internal API
44
5- ## Example
5+ ## Setup
6+
7+ ``` bash
8+ git clone https://github.com/hfaran/piazza-api
9+ cd piazza-api
10+ sudo python setup.py install
611```
12+
13+ ## Examples
14+
15+ Some examples to get started; more in the documentation (which is coming soon;
16+ but the code is all Sphinx style documented and is fairly readable).
17+
18+ ``` python
719>> > from piazza_api import Piazza
8- >>> p = Piazza("hl5qm84dl4t3x2" )
9- >>> p.user_auth ()
20+ >> > p = Piazza()
21+ >> > p.user_login ()
1022Email: ...
1123Password: ...
12- >>> p.get_post(181 )
13- ...
14- >>> p.enroll_students(["student@example.com", "anotherStudent@example.com"] )
24+ >> > user_profile = p.get_user_profile( )
25+ >> > eece210 = p.network( " hl5qm84dl4t3x2 " )
26+ >> > eece210.get_post( 100 )
1527...
28+ >> > posts = eece210.iter_all_posts(limit = 10 )
29+ >> > for post in posts:
30+ ... do_awesome_thing(post)
31+ >> > users = eece210.get_users([" userid1" , " userid2" ])
32+ >> > all_users = eece210.get_all_users()
1633```
1734
18- ## Dependencies
35+ You can also use the "internal" PiazzaRPC class which maps more directly
36+ to Piazza's API itself but is not as nice and as intuitive to use as the
37+ ` Piazza ` class abstraction.
1938
20- * [ requests] ( http://python-requests.org/ )
39+ ``` python
40+ >> > from piazza_api.rpc import PiazzaRPC
41+ >> > p = PiazzaRPC(" hl5qm84dl4t3x2" )
42+ >> > p.user_login()
43+ Email: ...
44+ Password: ...
45+ >> > p.content_get(181 )
46+ ...
47+ >> > p.add_students([" student@example.com" , " anotherStudent@example.com" ])
48+ ...
49+ ```
You can’t perform that action at this time.
0 commit comments