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):
Parámetros: - 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)¶ Parámetros: path (string) – Request path Tipo del valor devuelto: object Performs single API GET call.
-
wlc.
post
(path, **kwargs)¶ Parámetros: path (string) – Request path Tipo del valor devuelto: object Performs single API GET call.
wlc.config
¶
WeblateConfig
¶
-
class
wlc.config.
WeblateConfig
(section='wlc')¶ Parámetros: section (string) – Configuration section to use Configuration file parser following XDG specification.
-
load
(path=None)¶ Parámetros: 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/wlc
and/etc/xdg/wlc
).
-
wlc.main
¶
-
wlc.main.
main
(settings=None, stdout=None, args=None)¶ Parámetros: - settings (list of tuples) – settings to override
- stdout (file) – stdout for printing output, uses
sys.stdout
as default - args (list) – command line argumets to process, uses
sys.args
as default
Main entry point for command line interface.