{ "info": { "author": "Andrew Colin Kissa", "author_email": "andrew@topdog.za.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pysyncthing\n===========\n\nPython bindings for Syncthing REST API\n--------------------------------------\n\nThis is a Python port of the `Ruby REST API\nBindings `__ for\n`Syncthing `__\n\n|Build Status| |Code Climate| |codecov.io| |MPLv2 License|\n\nInstallation\n------------\n\nInstall from PyPi\n\n::\n\n pip install pysyncthing\n\nInstall from Githib\n\n::\n\n git clone https://github.com/akissa/pysyncthing.git\n cd pysyncthing\n python setup.py install\n\nUsage\n-----\n\n**Parameters**\n\n+------------+----------+--------------------------------------------------------+--------------+\n| Name | Type | Description | Mandatory? |\n+============+==========+========================================================+==============+\n| api\\_key | string | API key | Yes |\n+------------+----------+--------------------------------------------------------+--------------+\n| api\\_url | string | Url to connect to. Default is https://127.0.0.1:8384 | No |\n+------------+----------+--------------------------------------------------------+--------------+\n\nMake a new instance of SyncthingClient with API key and Url.\n\n.. code:: python\n\n >> from pysyncthing import SyncthingClient\n >> c = SyncthingClient('XX6406JTI3NH673QRHOGU840PL8702', 'https://192.168.1.26:8384')\n\nget\\_version()\n~~~~~~~~~~~~~~\n\nreturns current version\n\n.. code:: python\n\n >> c.get_version()\n {u'os': u'linux', u'codename': u'Aluminium Ant', u'version': u'v0.11.25', u'arch': u'amd64', u'longVersion': u'syncthing v0.11.25 \"Aluminium Ant\" (go1.4.2 linux-amd64 default) mockbuild@build2.home.topdog-software.com 2015-09-19 18:15:16 UTC'}\n\nget\\_connections()\n~~~~~~~~~~~~~~~~~~\n\nReturns current connections\n\n.. code:: python\n\n >> c.get_connections()\n {u'connections': {u'6RBLNBN-6EIGPRG-ZLZR7XI-LDWUXSE-NYWEBLI-3DFE2AI-L2DP3JL-4R77ZAM': {u'inBytesTotal': 40436, u'outBytesTotal': 43412, u'at': u'2015-09-22T23:10:31.182773186+02:00', u'clientVersion': u'v0.11.25', u'address': u'192.168.1.14:1027'}}, u'total': {u'inBytesTotal': 40436, u'outBytesTotal': 43412, u'at': u'2015-09-22T23:10:31.182824757+02:00', u'clientVersion': u'', u'address': u''}}\n\nget\\_config()\n~~~~~~~~~~~~~\n\nReturns current syncthing config\n\n.. code:: python\n\n >> c.get_config()\n {u'folders': [{u'pullers': 0, u'hashers': 0, u'rescanIntervalS': 60, u'copiers': 0, u'devices': [{u'deviceID': u'UH3COQQ-AG2MDOF-YY7PBVX-M5T5FEQ-JIYZ57Q-C5PVKSW-3TVX7OT-MPNL6AD'}, {u'deviceID': u'6RBLNBN-6EIGPRG-ZLZR7XI-LDWUXSE-NYWEBLI-3DFE2AI-L2DP3JL-4R77ZAM'}], u'order': u'random', u'minDiskFreePct': 1, u'readOnly': False, u'ignoreDelete': False, u'invalid': u'', u'path': u'/var/spool/MailScanner/quarantine', u'autoNormalize': True, u'ignorePerms': False, u'id': u'ms-quarantine', u'versioning': {u'params': {}, u'type': u''}}], u'gui': {u'apiKey': u'8X2iXtByzNHJ4okYAzFELkd8vFNby8G5', u'enabled': True, u'useTLS': False, u'user': u'', u'address': u'192.168.1.26:8384', u'password': u''}, u'devices': [{u'compression': u'metadata', u'certName': u'', u'introducer': False, u'name': u'standalone.home.topdog-software.com', u'deviceID': u'UH3COQQ-AG2MDOF-YY7PBVX-M5T5FEQ-JIYZ57Q-C5PVKSW-3TVX7OT-MPNL6AD', u'addresses': [u'127.0.0.1:1027']}, {u'compression': u'metadata', u'certName': u'', u'introducer': False, u'name': u'ms2.home.topdog-software.com', u'deviceID': u'6RBLNBN-6EIGPRG-ZLZR7XI-LDWUXSE-NYWEBLI-3DFE2AI-L2DP3JL-4R77ZAM', u'addresses': [u'192.168.1.14:1027']}], u'version': 11, u'ignoredDevices': [], u'options': {u'urAccepted': -1, u'limitBandwidthInLan': False, u'upnpLeaseMinutes': 60, u'globalAnnounceServers': [u'udp4://announce.syncthing.net:22026', u'udp6://announce-v6.syncthing.net:22026'], u'upnpTimeoutSeconds': 10, u'pingTimeoutS': 30, u'localAnnounceMCAddr': u'[ff32::5222]:21026', u'maxSendKbps': 0, u'progressUpdateIntervalS': 5, u'autoUpgradeIntervalH': 12, u'maxRecvKbps': 0, u'keepTemporariesH': 24, u'listenAddress': [u'0.0.0.0:1027'], u'cacheIgnoredFiles': True, u'urUniqueId': u'', u'symlinksEnabled': True, u'globalAnnounceEnabled': False, u'localAnnounceEnabled': False, u'upnpRenewalMinutes': 30, u'pingIdleTimeS': 60, u'startBrowser': False, u'databaseBlockCacheMiB': 0, u'upnpEnabled': False, u'reconnectionIntervalS': 60, u'localAnnouncePort': 21025, u'restartOnWakeup': True, u'minHomeDiskFreePct': 1}}\n\nget\\_insync()\n~~~~~~~~~~~~~\n\nReturns current insync condition\n\n.. code:: python\n\n >> c.get_insync()\n {u'configInSync': True}\n\nget\\_errors()\n~~~~~~~~~~~~~\n\nReturns raised and not cleared errors\n\n.. code:: python\n\n >> c.get_errors()\n {u'errors': []}\n\nget\\_discovery()\n~~~~~~~~~~~~~~~~\n\nReturns local discovery hash\n\n.. code:: python\n\n >> c.get_discovery()\n {}\n\nnew\\_error()\n~~~~~~~~~~~~\n\nRaises a new error with given message. Returns code 200 on success.\n\n.. code:: python\n\n >> c.new_error('foo')\n {u'message': u'Completed successfully', u'code': 200}\n\nclear\\_errors()\n~~~~~~~~~~~~~~~\n\nClears previously raised errors. Returns code 200 on success.\n\n.. code:: python\n\n >> c.clear_errors()\n {u'message': u'Completed successfully', u'code': 200}\n\nnew\\_config()\n~~~~~~~~~~~~~\n\nUploads a new config to syncthing server.\n\n**Parameters**\n\n+----------+--------+------------------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+========+========================+==============+\n| config | Dict | New syncthing config | Yes |\n+----------+--------+------------------------+--------------+\n\n.. code:: python\n\n cfg = {}\n >> c.new_config(cfg)\n {u'message': u'Completed successfully', u'code': 200}\n\nrestart()\n~~~~~~~~~\n\nWill restart syncthing server\n\n.. code:: python\n\n >> c.restart()\n {u'ok': u'restarting'}\n\nreset()\n~~~~~~~\n\nThis means renaming all repository directories to temporary, unique\nnames, destroying all indexes and restarting.\n\nThis should probably not be used during normal operations...\n\n.. code:: python\n\n >> c.reset()\n {u'ok': 'resetting database'}\n\nshutdown()\n~~~~~~~~~~\n\n.. code:: python\n\n >> c.shutdown()\n {u'ok': u'shutting down'}\n\nupgrade()\n~~~~~~~~~\n\nCheck for the new version\n\n.. code:: python\n\n >> c.upgrade()\n\nupgrade()\n~~~~~~~~~\n\nPerform an upgrade and restart if new version exists. Does nothing if\ncurrent version is latest.\n\n.. code:: python\n\n >> c.upgrade()\n {u'message': u'Completed successfully', u'code': 200}\n\nget\\_status()\n~~~~~~~~~~~~~\n\nReturns current status\n\n.. code:: python\n\n >> c.get_status()\n {u'alloc': 10398664, u'cpuPercent': 0.02499997913651528, u'pathSeparator': u'/', u'uptime': 87, u'sys': 18495736, u'tilde': u'/var/spool/exim', u'myID': u'UH3COQQ-AG2MDOF-YY7PBVX-M5T5FEQ-JIYZ57Q-C5PVKSW-3TVX7OT-MPNL6AD', u'goroutines': 36}\n\nget\\_ping()\n~~~~~~~~~~~\n\nReturns a ``{\"ping\": \"pong\"}`` object\n\n.. code:: python\n\n >> c.get_ping()\n {u'ping': u'pong'}\n\nbrowse\\_database()\n~~~~~~~~~~~~~~~~~~\n\n**Parameters**\n\n+----------+----------+-----------------------------------------------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+=====================================================+==============+\n| folder | string | Name of a database | Yes |\n+----------+----------+-----------------------------------------------------+--------------+\n| level | int | Depth of a list. Default is ``0`` - maximum depth | No |\n+----------+----------+-----------------------------------------------------+--------------+\n| prefix | string | Path to directory or subdirectory to start from | No |\n+----------+----------+-----------------------------------------------------+--------------+\n\nReturns files in given folder\n\n.. code:: python\n\n >> c.browse_databse('ms-quarantine')\n\nget\\_completion()\n~~~~~~~~~~~~~~~~~\n\nReturns completion in percentage (0-100) for given device and folder\n\n**Parameters**\n\n+----------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+===============+==============+\n| device | string | device\\_id | Yes |\n+----------+----------+---------------+--------------+\n| folder | string | folder name | Yes |\n+----------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.get_completion('6RBLNBN-6EIGPRG-ZLZR7XI-LDWUXSE-NYWEBLI-3DFE2AI-L2DP3JL-4R77ZAM', 'ms-quarantine')\n {u'completion': 100}\n\nget\\_file()\n~~~~~~~~~~~\n\nReturns info for given file\n\n**Parameters**\n\n+--------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+========+==========+===============+==============+\n| file | string | file name | Yes |\n+--------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.get_file('1Ze9NH-00057p-Vl')\n {u'global': {u'numBlocks': 0, u'name': u'', u'modified': u'1970-01-01T02:00:00+02:00', u'version': [], u'flags': u'0', u'localVersion': 0, u'size': 0}, u'local': {u'numBlocks': 0, u'name': u'', u'modified': u'1970-01-01T02:00:00+02:00', u'version': [], u'flags': u'0', u'localVersion': 0, u'size': 0}, u'availability': None}\n\nget\\_ignores()\n~~~~~~~~~~~~~~\n\nReturns ignores for given folder\n\n**Parameters**\n\n+----------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+===============+==============+\n| folder | string | folder | Yes |\n+----------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.get_ignores('ms-quarantine')\n {u'ignore': None, u'patterns': None}\n\nnew\\_ignores()\n~~~~~~~~~~~~~~\n\nSets new ignores for given folder\n\n**Parameters**\n\n+-----------+----------+--------------------------------------------------+--------------+\n| Name | Type | Description | Mandatory? |\n+===========+==========+==================================================+==============+\n| folder | string | folder | Yes |\n+-----------+----------+--------------------------------------------------+--------------+\n| ignores | object | ignore object like in ``get_ignores`` response | Yes |\n+-----------+----------+--------------------------------------------------+--------------+\n\n.. code:: python\n\n >> ignores = {'ignore': ['foo']}\n >> c.new_ignores('ms-quarantine', ignores)\n {u'ignore': [u'foo'], u'patterns': [u'^foo$', u'^.*/foo$', u'^foo/.*$', u'^.*/foo/.*$']}\n\nneed()\n~~~~~~\n\nReturns files which are needed for this device.\n\n**Parameters**\n\n+----------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+===============+==============+\n| folder | string | folder | Yes |\n+----------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.get_need('ms-quarantine')\n {u'perpage': 65536, u'rest': [], u'queued': [], u'progress': [], u'total': 0, u'page': 1} \n\nassign\\_priority()\n~~~~~~~~~~~~~~~~~~\n\nAssigns top priority for a given file in a given folder\n\n**Parameters**\n\n+----------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+===============+==============+\n| folder | string | folder | Yes |\n+----------+----------+---------------+--------------+\n| file | string | filename | Yes |\n+----------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.assign_priority('ms-quarantine', '1Ze9NH-00057p-Vl')\n {u'perpage': 65536, u'rest': [], u'queued': [], u'progress': [], u'total': 0, u'page': 1}\n\nscan()\n~~~~~~\n\nRequest an immediate rescan of a folder with a subfolder\n\n**Parameters**\n\n+-------------+----------+------------------+--------------+\n| Name | Type | Description | Mandatory? |\n+=============+==========+==================+==============+\n| folder | string | folder | Yes |\n+-------------+----------+------------------+--------------+\n| subfolder | string | subfolder name | No |\n+-------------+----------+------------------+--------------+\n\n.. code:: python\n\n >> c.scan('ms-quarantine')\n {u'message': u'Completed successfully', u'code': 200}\n\nget\\_folder\\_status()\n~~~~~~~~~~~~~~~~~~~~~\n\nReturns status for a given folder\n\n**Parameters**\n\n+----------+----------+---------------+--------------+\n| Name | Type | Description | Mandatory? |\n+==========+==========+===============+==============+\n| folder | string | folder | Yes |\n+----------+----------+---------------+--------------+\n\n.. code:: python\n\n >> c.get_folder_status('ms-quarantine')\n {u'localBytes': 12115773, u'globalFiles': 514, u'needBytes': 0, u'ignorePatterns': True, u'localDeleted': 31, u'globalBytes': 12126909, u'invalid': u'', u'globalDeleted': 118, u'state': u'idle', u'version': 1835, u'inSyncFiles': 514, u'needFiles': 0, u'inSyncBytes': 12126909, u'localFiles': 514, u'stateChanged': u'2015-09-22T23:45:56.227948076+02:00'}\n\nget\\_device\\_statistics()\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturns device statistics\n\n.. code:: python\n\n >> c.get_device_statistics()\n {u'UH3COQQ-AG2MDOF-YY7PBVX-M5T5FEQ-JIYZ57Q-C5PVKSW-3TVX7OT-MPNL6AD': {u'lastSeen': u'1970-01-01T02:00:00+02:00'}, u'6RBLNBN-6EIGPRG-ZLZR7XI-LDWUXSE-NYWEBLI-3DFE2AI-L2DP3JL-4R77ZAM': {u'lastSeen': u'2015-09-22T23:47:03.851867821+02:00'}}\n\nget\\_folder\\_statistics()\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReturns general statistics about folders.\n\n.. code:: python\n\n >> c.get_folder_statistics()\n {u'ms-quarantine': {u'lastFile': {u'deleted': False, u'at': u'0001-01-01T00:00:00Z', u'filename': u''}}}\n\nContributing\n------------\n\n1. Fork it (https://github.com/akissa/pysyncthing/fork)\n2. Create your feature branch (``git checkout -b my-new-feature``)\n3. Commit your changes (``git commit -am 'Add some feature'``)\n4. Push to the branch (``git push origin my-new-feature``)\n5. Create new Pull Request\n\nLicense\n-------\n\nAll code is licensed under the `MPLv2\nLicense `__.\n\n.. |Build Status| image:: https://travis-ci.org/akissa/pysyncthing.svg?branch=master\n :target: https://travis-ci.org/akissa/pysyncthing\n.. |Code Climate| image:: https://codeclimate.com/github/akissa/pysyncthing/badges/gpa.svg\n :target: https://codeclimate.com/github/akissa/pysyncthing\n.. |codecov.io| image:: https://codecov.io/github/akissa/pysyncthing/coverage.svg?branch=master\n :target: https://codecov.io/github/akissa/pysyncthing?branch=master\n.. |MPLv2 License| image:: https://img.shields.io/badge/license-MPLv2-blue.svg?style=flat-square\n :target: https://www.mozilla.org/MPL/2.0/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/akissa/pysyncthing", "keywords": "syncthing sync api rest backup syncronization", "license": "MPL 2.0", "maintainer": null, "maintainer_email": null, "name": "pysyncthing", "package_url": "https://pypi.org/project/pysyncthing/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pysyncthing/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/akissa/pysyncthing" }, "release_url": "https://pypi.org/project/pysyncthing/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "Python bindings for Syncthing REST API", "version": "0.0.4" }, "last_serial": 1809118, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d3b3d8f4b501c4cbe72fd20c4dca2932", "sha256": "ad3164402d64aaa002d7988f364a01c3ef24d1eb07ed73b13f376b27e8d8c6f9" }, "downloads": -1, "filename": "pysyncthing-0.0.1.tar.bz2", "has_sig": false, "md5_digest": "d3b3d8f4b501c4cbe72fd20c4dca2932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13051, "upload_time": "2015-09-22T22:15:00", "url": "https://files.pythonhosted.org/packages/b2/c5/f387bf328228d43ffa49c119d3056d565f1a01e9dd3a15be71850d0da57d/pysyncthing-0.0.1.tar.bz2" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d4cd63255feb95859ee9051c1af0f992", "sha256": "5621785fceb31f4f6f204f459de768683097f9b72c47b19d142440b2e83fc8e2" }, "downloads": -1, "filename": "pysyncthing-0.0.2.tar.bz2", "has_sig": false, "md5_digest": "d4cd63255feb95859ee9051c1af0f992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14080, "upload_time": "2015-09-30T12:50:02", "url": "https://files.pythonhosted.org/packages/22/13/6800f5b5dafaa7dfea091ec95c7d60887e4f041265634af0908f8f69639d/pysyncthing-0.0.2.tar.bz2" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "49d9fb45a71c1cb5137ec542b1efd6a7", "sha256": "267de7b255ad1eb50075c1364f63233324c44e67807430d0d71e00bed2656255" }, "downloads": -1, "filename": "pysyncthing-0.0.3.tar.bz2", "has_sig": false, "md5_digest": "49d9fb45a71c1cb5137ec542b1efd6a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14141, "upload_time": "2015-10-01T10:08:39", "url": "https://files.pythonhosted.org/packages/68/e6/ae2a8560c274729251136788008c096180fd68340406784b59665f058502/pysyncthing-0.0.3.tar.bz2" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "90d8c337ea896c07a7132b87a38355d0", "sha256": "4e5cc9ee086b589ec05ae0f91880160fd67fbdc6d0468161f65cb397f8c8d6a9" }, "downloads": -1, "filename": "pysyncthing-0.0.4.tar.bz2", "has_sig": false, "md5_digest": "90d8c337ea896c07a7132b87a38355d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14476, "upload_time": "2015-11-10T06:49:10", "url": "https://files.pythonhosted.org/packages/c5/fd/26588547aa38d62d912423d994ce9d612ecec6ef8a4c0198039ecb319c63/pysyncthing-0.0.4.tar.bz2" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90d8c337ea896c07a7132b87a38355d0", "sha256": "4e5cc9ee086b589ec05ae0f91880160fd67fbdc6d0468161f65cb397f8c8d6a9" }, "downloads": -1, "filename": "pysyncthing-0.0.4.tar.bz2", "has_sig": false, "md5_digest": "90d8c337ea896c07a7132b87a38355d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14476, "upload_time": "2015-11-10T06:49:10", "url": "https://files.pythonhosted.org/packages/c5/fd/26588547aa38d62d912423d994ce9d612ecec6ef8a4c0198039ecb319c63/pysyncthing-0.0.4.tar.bz2" } ] }