Skip to main content

python-syncthing

pypi Syncthing Documentation Status MIT License

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.

Metadata

Release files for syncthing2 2.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for syncthing2 2.4.5
File Size Uploaded
syncthing2-2.4.5.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for syncthing2 2.4.5
File Interpreter ABI Platform
syncthing2-2.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / syncthing2-2.4.5.tar.gz

Download URL syncthing2-2.4.5.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
42c2cd2ad42f8d6932c2e4cb16da937152bf4a1cfd47a25cc173a258c09bb4b3
BLAKE2b-256 checksum
How to use checksums
b3a5926466dbe1209870c0c808f8974fca46a0f0e8ba94f9bc4cec8be70aaaef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / syncthing2-2.4.5-py3-none-any.whl

Download URL syncthing2-2.4.5-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33b1e6fa1a36a885109727d0c61f3b1a06fd962f07da747e0a9d0ca7198befef
BLAKE2b-256 checksum
How to use checksums
4aadc19f893919baae7147cb621732cb67a3b0c1872d5ff6e88b59f194bd1bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

2.4.5 This release

2 release files

2.4.4

2 release files

2.4.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page