Weblate’s Python API¶
Instalation¶
The Python API is shipped separately, you need to install wlc to have it, it also include Weblate Client:
pip install wlc
wlc¶
WeblateException¶
-
exception
wlc.WeblateException¶ Base class for all exceptions.
Weblate¶
-
Weblate(key='', url=None, config=None): Параметры: - key (string) – User key
- url (string) – API server URL, if not specified default is used
- config (WeblateConfig) – Configuration object, overrides any other parameters.
Access class to the API, define API key and optionally API URL.
-
wlc.get(path)¶ Параметры: path (string) – Request path Тип результата: object Performs single API GET call.
-
wlc.post(path, **kwargs)¶ Параметры: path (string) – Request path Тип результата: object Performs single API GET call.
wlc.config¶
WeblateConfig¶
-
class
wlc.config.WeblateConfig(section='wlc')¶ Параметры: section (string) – Configuration section to use Configuration file parser following XDG specification.
-
load(path=None)¶ Параметры: path (string) – Path where to load configuration. Loads configuration from a file, if none is specified it loads from wlc configuration file placed in XDG configuration path (
~/.config/wlcand/etc/xdg/wlc).
-
wlc.main¶
-
wlc.main.main(settings=None, stdout=None, args=None)¶ Параметры: - settings (list of tuples) – settings to override
- stdout (file) – stdout for printing output, uses
sys.stdoutas default - args (list) – command line argumets to process, uses
sys.argsas default
Main entry point for command line interface.