Reference¶
The Client
class is what is used to make all requests.
Example¶
Below is a simple example of how to make requests:
from scpython import Client
conn = Client("YOUR-TOKEN")
scp173 = conn.getScpArticle("SCP-173")
print(scp173.page_source)
You can get SCPs from different branches:
from scpython import Client
conn = Client("YOUR-TOKEN")
scp040it = conn.getScpArticle("SCP-040-IT")
print(scp040it.page_source)
And in any language it’s been translated to:
from scpython import Client, Language
conn = Client("YOUR-TOKEN")
scp173 = conn.getScpArticle("SCP-173", language=Language.IT)
print(scp173.page_source)
Class Reference¶
-
class
scpython.
Client
(wikidot_token7)[source]¶ A connection to interact with Wikidot.
- Arguments
- wikidot_token7
str
— The user’s identity.
-
getScpArticle
(code, **kwargs)[source]¶ Gets the requested SCP.
- Arguments
code
str
— The SCP’s full code ("SCP-XXXX-BRANCH"
).branch
Branch
— In case the Client cannot determine which branch the SCP was originally written in, you can specify it manually.language
Language
— The language to return the SCP in.- Returns
- article
Article
— The corresponding article. - Throws
InvalidToken
— The wikidot token7 you have provided is invalid.ScpArticleNotFound
— The SCP article you searched does not exist.ScpArticleNotTranslated
— The SCP article you searched exists, but it’s not translated in the language you’re looking for.