-
Notifications
You must be signed in to change notification settings - Fork 1
API reference
pradyun edited this page Apr 23, 2013
·
7 revisions
Note: All functions and methods return
Noneunless specified.
Hierarchy of classes:
To be implemented very soon (hopefully)
- Access_Token
- Me
-
uid- The Unique ID (num) of the data the instance refers to.
-
site- The site this object is on
-
get_info(self, *args, **kwargs)- Gets and loads the data about itself from a dict as the first (and only) argument or gets it from the API.
-
set_args(self, dic)- Sets the arguments from the
dic(<type 'dict'>), such thatelf.key = valuefor every key, value in dic.
- Sets the arguments from the
This class has post-specific methods and variables
-
comments- Holds the
Commenton this Post
- Holds the
-
set_args(self, dic)- Same as Base's
et_argsbut the owner is aUserinstance.
- Same as Base's
-
get_comments(self)- Gets the
Commenton this Post
- Gets the
This class has 1 question-specific method and variable, for answers:
-
answers- List of
Answerto this Question
- List of
-
get_answers(self)- Load
Answerintoanswers
- Load
This class has 1 site-specific method and variable, for questions:
-
questions- List of Question` on this Site
-
get_questions(self, **kwargs)- Load
Questionintoquestions
- Load
- Comment(Base) - A comment on a Post
- Answer(Post) - An answer to a Question
- Tag(Base) - A tag
- Badge(Base) - A badge
- User(Base) - An user
The functions listed here are used by the classes above. These would usually not be used in your program (unless you decide to implement your own class).
-
get_dict(url) => dict- Returns the dictionary of the response from url
- This function return the API response from url
-
make_url(base, kargs={}, **kwargs) => str- Creates a url from base and keywords
- This function is used to add the kwargs to the url (which are needed by the API)
The functions listed here are (mostly) not used by the classes above. These do "global" work, like Proxy Handling, Authenticating
-
authenticate()- Not fully implemented Don't use!!
-
get_sites() => dict- Returns a dict in the form of name:api_site_name of all sites on SE
-
make_auth_proxy(proxy=None) => True- Allows for connection through authenticated proxy
-
make_proxy(proxy=None) => True- Allows for connection through proxy