API Reference¶
The following section outlines the API of scpper.
Scpper¶
- class scpper.api.Scpper(site: str = 'en')[source]¶
Scpper API wrapper class
- Attributes:
- site: Branch site name.
SCP Foundation (scp-wiki.net): “en” Russian branch (scpfoundation.ru): “ru” Korean branch (ko.scp-wiki.net): “ko” Japanese branch (ja.scp-wiki.net): “ja” French branch (fondationscp.wikidot.com): “fr” Spanish branch (lafundacionscp.wikidot.com): “es” Thai branch (scp-th.wikidot.com): “th” Polish branch (scp-wiki.net.pl): “pl” German branch (scp-wiki-de.wikidot.com): “de” Chinese branch (scp-wiki-cn.wikidot.com): “cn” Italian branch (fondazionescp.wikidot.com): “it” SCP International (scp-int.wikidot.com): “int”
- find_pages(title: str, limit: int = 50, random: bool = False) List[scpper.api.Page][source]¶
Retrieves up to limit pages from the specified wiki with part of the name matching title.
- Args:
- title:
Search query, part of page’s name (i.e. “173” will match “SCP-173”, “SCP-1173”, etc). Between 3 and 256 characters.
- limit:
Maximum number of rows returned by the query. Limited to 50.
- random:
Bool indicating whether resulting list of pages should be randomized. False - returns limit pages ordered by (kind of) relevance, descending (default) True - returns random selection of limit pages from the original query.
- Returns:
A list object containing all found pages.
- Raises:
ValueError: Title must be between 3 and 256 characters long.
- find_users(name: str, limit: int = 50) List[scpper.api.User][source]¶
Retrieves up to limit users from the with part of the name matching name.
- Args:
- name:
Search query, part of user’s name (i.e. “cle” will match “Dr Clef”, “Agent MacLeod”, etc). Between 3 and 256 characters.
- limit:
Maximum number of rows returned by the query. Limited to 50.
- Returns:
A list object containing all found users.
- Raises:
ValueError: Name must be between 3 and 256 characters long.
- tags(tags: str, method: str = 'and', limit: int = 50, random: int = 0) List[scpper.api.Page][source]¶
Retrieves up to limit pages from the specified wiki, selected using provided tags.
- Args:
- method:
How to combine provided tags for the query (“and”/”or”) “and” - only pages that have all the tags (default) “or” - pages that contain any of the tags.
- tags:
List of tags, each prefixed with “+” or “-”, separated by commas “+” indicates that pages containing this tag must be included in the query “-” indicates that pages containing this tag must be excluded from the query Each tag MUST be prefixed by only ONE of those options.
- limit:
Maximum number of rows returned by the query. Limited to 50.
- random:
Bit flag indicating whether resulting list of pages should be randomized. “0” - returns limit pages ordered by clean rating, descending (default) “1” - returns random selection of limit pages from the original query.
- Returns:
A list object containing all selected pages.