Python bindings to the Syncthing REST interface, targeting v0.14.44
Project description
python-syncthing
Python bindings to the Syncthing REST interface.
$ pip install syncthing
Getting Started
from syncthing import Syncthing
API_KEY = "..."
s = Syncthing(API_KEY)
# name spaced by API endpoints
s.system.connections()
# supports GET/POST semantics
sync_errors = s.system.errors()
s.system.clear()
if sync_errors:
for e in sync_errors:
print(e)
# supports event long-polling
event_stream = s.events(limit=10)
for event in event_stream:
# do something with `event`
if event_stream.count > 100:
event_stream.stop()
Running Tests
The API doctests rely on the following function to run against your instance. None of the "breaking" calls will be tested. You must set the following environment variables otherwise all tests will fail.
def _syncthing():
KEY = os.getenv('SYNCTHING_API_KEY')
HOST = os.getenv('SYNCTHING_HOST', '127.0.0.1')
PORT = os.getenv('SYNCTHING_PORT', 8384)
IS_HTTPS = bool(int(os.getenv('SYNCTHING_HTTPS', '0')))
SSL_CERT_FILE = os.getenv('SYNCTHING_CERT_FILE')
return Syncthing(KEY, HOST, PORT, 10.0, IS_HTTPS, SSL_CERT_FILE)
License
The MIT License (MIT)
Copyright (c) 2015-2017 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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file syncthing2-2.4.5.tar.gz
.
File metadata
- Download URL: syncthing2-2.4.5.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42c2cd2ad42f8d6932c2e4cb16da937152bf4a1cfd47a25cc173a258c09bb4b3 |
|
MD5 | c7ef711a754c857114a43fbdd557be91 |
|
BLAKE2b-256 | b3a5926466dbe1209870c0c808f8974fca46a0f0e8ba94f9bc4cec8be70aaaef |
File details
Details for the file syncthing2-2.4.5-py3-none-any.whl
.
File metadata
- Download URL: syncthing2-2.4.5-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33b1e6fa1a36a885109727d0c61f3b1a06fd962f07da747e0a9d0ca7198befef |
|
MD5 | 606f297cbd26e814e002cf5aaced141c |
|
BLAKE2b-256 | 4aadc19f893919baae7147cb621732cb67a3b0c1872d5ff6e88b59f194bd1bdb |