-
Notifications
You must be signed in to change notification settings - Fork 0
get()
tlras edited this page Nov 28, 2021
·
1 revision
Retrieves the content and metadata of a page and then returns it as a PageData namedtuple. The reason this function returns a namedtuple rather than directly returning the API data is so that if the ETT API ever changes, the output of these functions will remain the same (you won't have to rewrite any of your code just because ETT's API changed, only I will).
get(pagename)
- pagename — The name of the page that you want to read.
PageData namedtuple containing the following fields:
- title — The name of the page. There is no leading '/'!
- timestamp — The Unix Epoch time of when the page was last edited. This value will always be an integer, even on pages that haven never been modified. This is so it can safely be passed to the conflict parameter of the write() function without having to be verified first.
- ip — The IP address of the last person to edit the page as a string. This will be set to None on pages that haven never been modified.
- content — The text that is on the requested page.
Note: This wiki is not yet complete. Documentation for exceptions and examples for functions still need to be added.