Python bindings to the Syncthing REST interface.
pip install syncthing
The main interface Syncthing
provides access to all of the underlying endpoints. They're divided the same as the documentation, in categories: sys
(system
), db
(database
), stats
, misc
. All GET
methods are available as immediate function calls, and POST
methods via sync.CATEGORY.set.COMMAND()
(for example, sync.sys.set.config(..)
).
from syncthing import Syncthing
sync = Syncthing(api_key='xxxxabcdef', port=8384)
print(sync.sys.config())
sync = Syncthing()
...
...
sync.init(api_key='...')
Both the syncthing.Syncthing
and syncthing.Interface
objects take the same __init__
parameters. Syncthing
provides getter/setter methods for the REST api that direct all communication through the Interface
instance. An Interface
object could interact with Syncthing directly by passing endpoints to the do_req
method.
api_key
: requiredhost
: localhostport
: 8080timeout
: 3.5 (seconds)is_https
: Falsessl_cert_file
: None
conf = sync.sys.config()
logs = sync.sys.log()
db_status = sync.db.status()
sync.sys.set.restart()
sync.db.set.scan(folder='desktop_home')
The MIT License (MIT)
Copyright (c) 2015-2016 Blake VandeMerwe
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.