{ "info": { "author": "Eric ALBER", "author_email": "eric.alber@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "Sweech command line interface\n=============================\n\nWhat's this ?\n-------------\n\nIt's a command line tool to interact with `Sweech Wifi file transfer `_.\n\nSweech is an Android app with which you can browse the content of your phone and transfer files. It's based on an HTTP server. This tool interacts with Sweech's HTTP API. You can push and pull files over wifi directly from your favorite shell\n\nOK, show me !\n-------------\n\n.. image:: https://asciinema.org/a/113791.png\n :target: https://asciinema.org/a/113791?speed=2\n\nNice, how do I get it ?\n-----------------------\n\nUse python's ``pip``\n\n.. code::\n\n $ pip install sweech-cli\n\nOr download the python script and add it to your ``$PATH``\n\n.. code::\n\n $ curl -o sweech https://raw.githubusercontent.com/alberthier/sweech-cli/master/sweech.py\n\nOr\n\n.. code::\n\n $ wget -O sweech https://raw.githubusercontent.com/alberthier/sweech-cli/master/sweech.py\n\nHow do I use it ?\n-----------------\n\nThe ``sweech`` tool is totally standalone:\n\n.. code::\n\n $ sweech -u http://192.168.0.65 info\n\n\nIt may be practical to create a config file containing the connection settings: ``~/.config/sweech.json`` on Linux/macOS, ``%APPDATA%/sweech.json`` on Windows\n\nHere is an example file for a phone having ``192.168.0.65`` as IP address\n\n.. code:: json\n\n {\n \"url\": \"http://192.168.0.65:4444\",\n \"user\": \"\",\n \"password\": \"\",\n \"defaultdir\": \"/storage/emulated/0/Downloads\"\n }\n\nIf you define a ``defaultdir``, all relative remote paths will be interpreted relatively to this default directory.\n\nAssuming you have added ``sweech`` to your ``PATH``:\n\n.. code::\n\n $ sweech info\n\nPrints information and default paths of your device\n\n.. code::\n\n $ sweech ls /storage/emulated/0/Download\n\nList the content of a folder or display details of a file\n\n.. code::\n \n $ sweech push testdir\n\nPushes files or directories to a remote path. If no remote file is specified, ``defaultdir`` is used\n\nYou can only create files and directories in the internal storage. External storage (SD card) is writable too if you have granted Sweech this authorisation in the app's settings.\n\nThe ``--keep`` option uploads only missing files on the remote device. Existing files are left untouched.\n\n.. code::\n\n $ sweech pull testdir\n\nPull files and folders from the remote device to a local folder. If remote file path is relative, ``defaultdir`` is used as base\n\nThe ``--keep`` option downloads only missing local files. Existing files are left untouched.\n\n.. code::\n\n $ sweech mkdir testdir\n\nCreates a directory. Missing intermediate directories are created too\n\n.. code::\n\n $ sweech rm /some/path\n\nRemoves a file or a directory (with its content)\n\n.. code::\n\n $ sweech mv /some/path /some/otherpath\n\nMoves a file or a directory (with its content). Moving files between directories may be slow in some circumstances (between different storages, on external SD card on Android pre 7.0)\n\n.. code::\n\n $ sweech cat /path/to/some/file.txt\n\nDisplays the content of a file\n\n.. code::\n\n $ sweech clipboard\n\nDisplays the content of the Android clipboard\n\n.. code::\n\n $ sweech clipboard \"Hello World\"\n\nSets the content of the Android clipboard\n\nAnd what if I want to use it in my Python script ?\n--------------------------------------------------\n\nSimply import the ``sweech`` module and use the ``Connector`` object. All CLI commands have their equivalent method:\n\n.. code:: python\n\n import sweech\n\n c = sweech.Connector('http://192.168.0.11:4444')\n\n print(c.info())\n\n for f in c.ls('/storage/emulated/0/Download'):\n print(f)\n\n with open('test.txt', 'wt') as f:\n f.write('Hello World')\n\n c.push('test.txt', '/storage/emulated/0/Download')\n\n c.pull('/storage/emulated/0/Download/test.txt', '/tmp')\n\n f = c.cat('/storage/emulated/0/Download/test.txt')\n print(f.read().decode('utf-8'))\n f.close()\n\n c.mkdir('/storage/emulated/0/Download/testdir')\n\n c.mv('/storage/emulated/0/Download/testdir', '/storage/emulated/0/Download/testdir2')\n\n c.rm('/storage/emulated/0/Download/testdir2')\n\n txt = c.clipboard()\n c.clipboard(txt + \" hello world\")\n\nDependencies\n------------\n\n* Python 2.7 or Python 3.5+\n\nContributing\n------------\n\nReport issues `here `_\n\nPull-requests welcome !", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alberthier/sweech-cli", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sweech-cli", "package_url": "https://pypi.org/project/sweech-cli/", "platform": "", "project_url": "https://pypi.org/project/sweech-cli/", "project_urls": { "Homepage": "https://github.com/alberthier/sweech-cli" }, "release_url": "https://pypi.org/project/sweech-cli/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "A command-line utility to interact with your Android device through the Sweech app", "version": "1.1.1" }, "last_serial": 5219595, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "cd2f0a32f8b424773528759990a82a1e", "sha256": "3df832bc2d9ba2217fbf6e4f6f307edab000d8c94d013eb2042ad003b956f98d" }, "downloads": -1, "filename": "sweech-cli-1.0.1.tar.gz", "has_sig": false, "md5_digest": "cd2f0a32f8b424773528759990a82a1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7679, "upload_time": "2017-04-16T23:05:44", "url": "https://files.pythonhosted.org/packages/d1/ad/d9c0c69bfcf511e20b071c08e07f4df40b1f0d5baa3a1cdeccd44635672d/sweech-cli-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "16c9d64eaee4d15c5901cb95e4fb1252", "sha256": "971ac123bb8794b64e15d8a3602decf1c4124fe9abab8f7e561b02d5f859aabc" }, "downloads": -1, "filename": "sweech-cli-1.1.0.tar.gz", "has_sig": false, "md5_digest": "16c9d64eaee4d15c5901cb95e4fb1252", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7476, "upload_time": "2017-11-10T00:01:20", "url": "https://files.pythonhosted.org/packages/33/6e/70af5b6ca93d97e263d34065b55ab55e16ba3293e1069c2219e714fbbe42/sweech-cli-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b839f166a7f9c06a2cc6409f65acd872", "sha256": "a72f320827ce90986dd17d5ed26914749b8a9cf678b257f69af6d53cc89580ae" }, "downloads": -1, "filename": "sweech-cli-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b839f166a7f9c06a2cc6409f65acd872", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8018, "upload_time": "2019-05-02T22:34:23", "url": "https://files.pythonhosted.org/packages/87/c1/487be1586470e8081d7821e3c76721b2094e971219df6e2845ef8c74c55a/sweech-cli-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b839f166a7f9c06a2cc6409f65acd872", "sha256": "a72f320827ce90986dd17d5ed26914749b8a9cf678b257f69af6d53cc89580ae" }, "downloads": -1, "filename": "sweech-cli-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b839f166a7f9c06a2cc6409f65acd872", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8018, "upload_time": "2019-05-02T22:34:23", "url": "https://files.pythonhosted.org/packages/87/c1/487be1586470e8081d7821e3c76721b2094e971219df6e2845ef8c74c55a/sweech-cli-1.1.1.tar.gz" } ] }