Skip to content

Latest commit

 

History

History
118 lines (75 loc) · 2.49 KB

python.rst

File metadata and controls

118 lines (75 loc) · 2.49 KB

single: Python single: API

Weblate's Python API

Instalation

The Python API is shipped separately, you need to install wlc to have it, it also include wlc:

pip install wlc

wlc

wlc

WeblateException

WeblateException

Base class for all exceptions.

Weblate

param key

User key

type key

string

param url

API server URL, if not specified default is used

type url

string

param config

Configuration object, overrides any other parameters.

type config

WeblateConfig

Access class to the API, define API key and optionally API URL.

get(path)

param path

Request path

type path

string

rtype

object

Performs single API GET call.

post(path, **kwargs)

param path

Request path

type path

string

rtype

object

Performs single API GET call.

wlc.config

wlc.config

WeblateConfig

param section

Configuration section to use

type section

string

Configuration file parser following XDG specification.

load(path=None)

param path

Path where to load configuration.

type path

string

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)

param settings

settings to override

type settings

list of tuples

param stdout

stdout for printing output, uses sys.stdout as default

type stdout

file

param args

command line argumets to process, uses sys.args as default

type args

list

Main entry point for command line interface.

register_command(command)

Decorator to register Command class in main parser used by main.

Command

Main class for invoking commands.