{ "info": { "author": "Gabriel Chamon", "author_email": "gchamon@live.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# sysrsync\nPython module that wraps system calls to rsync\n\n## Requirements\n\n* rsync\n* python 3.6+\n\n**development**:\n\n* pipenv (be sure to have both pipenv and pip upgraded to the latest version)\n\n## Usage\n\n* Basic file sync\n\n```python\nimport sysrsync\n\nsysrsync.run(source='/home/user/foo.txt',\n destination='/home/server/bar')\n# runs 'rsync /home/users/foo.txt /home/server/files'\n```\n\n* ssh with options\n\n```python\nimport sysrsync\n\nsysrsync.run(source='/home/user/files',\n destination='/home/server/files',\n destination_ssh='myserver',\n options=['-a'])\n# runs 'rsync -a /home/users/files/ myserver:/home/server/files'\n```\n\n* exclusions\n\n```python\nimport sysrsync\n\nsysrsync.run(source='/home/user/files',\n destination='/home/server/files',\n destination_ssh='myserver',\n options=['-a'],\n exclusions=['file_to_exclude', 'unwanted_file'])\n# runs 'rsync -a /home/users/files/ myserver:/home/server/files --exclude file_to_exclude --exclude unwanted_file'\n```\n\n## API\n\n`sysrsync.run`\n\n| argument | type | default | description |\n| --------- | ---- | ------- | ----------- |\n| cwd | str | `os.getcwd()` | working directory in which subprocess will run the rsync command |\n| strict | bool | `True` | raises `RsyncError` when rsync return code is different than 0 |\n| verbose | bool | `False` | verbose mode: currently prints rsync command before executing |\n| **kwargs | dict | Not Applicable | arguments that will be forwarded to call to `sysrsync.get_rsync_command` |\n\n**returns**: `subprocess.CompletedProcess`\n\n**raises**: `RsyncError` when `strict = True` and rsync return code is different than 0 ([Success](https://lxadm.com/Rsync_exit_codes#List_of_standard_rsync_exit_codes))\n\n`sysrsync.get_rsync_command`\n\n| argument | type | default | description |\n| --------- | ---- | ------- | ----------- |\n| source | str | - | Source folder or file |\n| destination | str | - | Destination folder |\n| source_ssh | Optional[str] | None | Remote ssh client where source is located |\n| destination_ssh | Optional[str] | None | Remote ssh client where destination is located |\n| exclusions | Iterable[str] | [] | List of excluded patterns as in rsync's `--exclude` |\n| sync_source_contents | bool | True | Abstracts the elusive trailing slash behaviour that `source` normally has when using rsync directly, i.e. when a trailing slash is present in `source`, the folder's content is synchronized with destination. When no trailing slash is present, the folder itself is synchronized with destination. |\n| options | Iterable[str] | [] | List of options to be used right after rsync call, e.g. `['-a', '-v']` translates to `rsync -a -v` |\n\n**returns**: `List[str]` -> the compiled list of commands to be used directly in `subprocess.run`\n\n**raises**: `RemotesError` when both `source_ssh` and `target_ssh` are set. Normally linux rsync distribution disallows source and destination to be both remotes.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gchamon/sysrsync", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sysrsync", "package_url": "https://pypi.org/project/sysrsync/", "platform": "any", "project_url": "https://pypi.org/project/sysrsync/", "project_urls": { "Homepage": "https://github.com/gchamon/sysrsync" }, "release_url": "https://pypi.org/project/sysrsync/0.1.2/", "requires_dist": null, "requires_python": ">3.6", "summary": "Python module that wraps system calls to rsync", "version": "0.1.2" }, "last_serial": 4728482, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f9a183f3320c6b901a2c0b65b6c743fc", "sha256": "5053e10add156213ad59be166f309c858f5aa03a57c33a7ef91fbe6809cef992" }, "downloads": -1, "filename": "sysrsync-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f9a183f3320c6b901a2c0b65b6c743fc", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 4154, "upload_time": "2019-01-22T20:32:22", "url": "https://files.pythonhosted.org/packages/40/88/c852b8cb2b61e0a1d63309da963adf2fa5147b69570e522675c24c77d676/sysrsync-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "24e49eb7ca55aa465ce11bb176c040c6", "sha256": "f87d5f070808b6372dd53b3c5648d0c27327b645029cf2716507d23aa5fdb9af" }, "downloads": -1, "filename": "sysrsync-0.1.2.tar.gz", "has_sig": false, "md5_digest": "24e49eb7ca55aa465ce11bb176c040c6", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 4746, "upload_time": "2019-01-23T00:11:06", "url": "https://files.pythonhosted.org/packages/30/dd/82f47334726edc5a1001b3b61f60e0db0c38ada0685befd7891112ad3dfb/sysrsync-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24e49eb7ca55aa465ce11bb176c040c6", "sha256": "f87d5f070808b6372dd53b3c5648d0c27327b645029cf2716507d23aa5fdb9af" }, "downloads": -1, "filename": "sysrsync-0.1.2.tar.gz", "has_sig": false, "md5_digest": "24e49eb7ca55aa465ce11bb176c040c6", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 4746, "upload_time": "2019-01-23T00:11:06", "url": "https://files.pythonhosted.org/packages/30/dd/82f47334726edc5a1001b3b61f60e0db0c38ada0685befd7891112ad3dfb/sysrsync-0.1.2.tar.gz" } ] }