qiuwenbot package

Qiuwen bot.

Subpackages

Submodules

qiuwenbot.argparse module

qiuwenbot.argparse.normalize(data: dict) dict[source]
qiuwenbot.argparse.page_variant() Variant[source]
qiuwenbot.argparse.submit_args() List[Argument][source]

qiuwenbot.bot module

qiuwenbot.bot.get_page(title: str, site: Site)[source]

Get the page with the specific title.

Parameters:
titlestr

title of the page

sitepywikibot.Site

qiuwen site

qiuwenbot.bot.login(user: str, password: str) Site[source]

Login to qiuwen.

Parameters:
user

username of the bot

password

password of the bot

Returns:
pywikibot.Site

qiuwen site

qiuwenbot.qwfamily module

class qiuwenbot.qwfamily.QiuwenFamily[source]

Bases: Family

Qiuwen faimily.

Attributes:
interwiki_forward
obsolete

Old codes that are not part of the family.

shared_urlshortner_wiki

Methods

apipath(code)

Return path to api.php.

base_url(code, uri[, protocol])

Prefix uri with port and hostname.

category_redirects(code[, fallback])

Return list of category redirect templates.

dbName(code)

Return the name of the MySQL database.

disambig(code[, fallback])

Return list of disambiguation templates.

encoding(code)

Return the encoding for a specific language wiki.

encodings(code)

Return list of historical encodings for a specific language wiki.

eventstreams_host(code)

Hostname for EventStreams.

eventstreams_path(code)

Return path for EventStreams.

from_url(url)

Return whether this family matches the given url.

get_address(code, title)

Return the path to title using index.php with redirects disabled.

get_archived_page_templates(code)

Return tuple of archived page templates.

get_edit_restricted_templates(code)

Return tuple of edit restricted templates.

hostname(code)

The hostname to use for standard http connections.

interface(code)

Return interface to use for code.

isPublic()

Check the wiki require logging in before viewing it.

linktrail(code)

Return regex for trailing chars displayed as part of a link.

load([fam])

Import the named family.

maximum_GET_length(code)

Return the maximum URL length for GET instead of POST.

path(code)

Return path to index.php.

post_get_convert(site, getText)

Do a conversion on the retrieved text from the Wiki.

pre_put_convert(site, putText)

Do a conversion on the text to insert on the Wiki.

protocol(code)

The protocol to use to connect to the site.

querypath(code)

Return path to query.php.

scriptpath(code)

The prefix used to locate scripts on this wiki.

shared_image_repository(code)

Return the shared image repository, if any.

ssl_hostname(code)

The hostname to use for SSL connections.

ssl_pathprefix(code)

The path prefix for secure HTTP access.

verify_SSL_certificate(code)

Return whether a HTTPS certificate should be verified.

instance = Family("qiuwen")
isPublic()[source]

Check the wiki require logging in before viewing it.

langs: dict[str, str] = {'zh': 'www.qiuwenbaike.cn'}
name: str | None = 'qiuwen'

The family name

protocol(code)[source]

The protocol to use to connect to the site.

May be overridden to return ‘http’. Other protocols are not supported.

Changed in version 8.2: https is returned instead of http.

Parameters:

code – language code

Returns:

protocol that this family uses

scriptpath(code)[source]

The prefix used to locate scripts on this wiki.

This is the value displayed when you enter {{SCRIPTPATH}} on a wiki page (often displayed at [[Help:Variables]] if the wiki has copied the master help page correctly).

The default value is the one used on Wikimedia Foundation wikis, but needs to be overridden in the family file for any wiki that uses a different value.

Parameters:

code – Site code

Raises:

KeyError – code is not recognised

Returns:

URL path without ending ‘/’

qiuwenbot.qwlogger module

qiuwenbot.user-config module

qiuwenbot.utils module

qiuwenbot.utils.archieve_page(page: Page, site: Site) Page[source]

Archieve a page.

Parameters:
page: pywikibot.Page

page to archieve

site: pywikibot.Site

qiuwen site

Returns:
pywikibot.Page

page with old title

qiuwenbot.utils.devide_parameters(params: str) Dict[str, str][source]

Devide parameters and remove subtemplate in it.

Parameters:
paramsstr

parameter string

Returns:
Dict[str, str]

dict of params

qiuwenbot.utils.get_cat_regex(name: str = '[^\\[\\]]+') Pattern[source]

Get categories regex.

Parameters:
namestr, optional

Name or regex of the category, by default all categories.

Returns:
List[str]

Categories.

qiuwenbot.utils.get_template_regex(name: str = '[^{\\|#0-9][^{\\|#]*?', end: str = '') Pattern[source]

Get templates regex.

Parameters:
namestr, optional

Name or regex of the template, by default all templates.

endstr, optional

End of the template, by default “”.

Returns:
List[str]

Templates.