{ "info": { "author": "Benjamin Einaudi", "author_email": "antechrestos@gmail.com", "bugtrack_url": null, "classifiers": [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Communications" ], "description": "Orange Cloud python client\n==========================\n.. image:: https://img.shields.io/pypi/v/orangecloud-client.svg\n :target: https://pypi.python.org/pypi/orangecloud-client\n.. image:: https://img.shields.io/github/license/antechrestos/orangecloud-client.svg\n\t:target: https://raw.githubusercontent.com/antechrestos/orangecloud-client/master/LICENSE\n\nThis library is a python implementation of the `orange cloud api `_\nIt brings:\n\n- an `api <#api>`_ to build other api around the orange cloud\n- a `command line interface <#cli>`_ to directly interact with the cloud\n\nDependencies\n------------\nIt is based on:\n\n- `oauth2 client library `_, itself based on `requests `_.\n- `requests toolbelts `_\n\n\nInstalling\n----------\n\nFrom pip\n~~~~~~~~\n.. code-block:: bash\n\n\t$ pip install orangecloud-client\n\nFrom sources\n~~~~~~~~~~~~\n\nTo build the library run :\n\n.. code-block:: bash\n\n\t$ python setup.py install\n\nRun the OAuth Grant code process\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nTo start using it you must create a **developer** account on the\n`orange partner platform `_.\nThen create an application. But beware on one things: the **redirect url** must differ from any `localhost` or local url.\nSince we want to trick it, do as follow:\n\n- pick a domain name such `http://my-own-cloud.io:8080` (**do not use https as it cannot be handled later**)\n- create the application\n- map the **domain** `my-own-cloud.io` on `localhost` in your **host file** ( `/etc/hosts` for linux,\n `%systemroot%\\\\system32\\\\drivers\\\\etc\\\\` for windows)\n- run the following code\n\n\n.. code-block:: python\n\n # provide the client id and client secret got on your application page\n api_manager = ApiManager(client_id, client_secret)\n # in this example the redirect url is http://myowncloud.io:8080 and /etc/hosts contains the line\n # 127.0.0.1 myowncloud.io\n redirect_uri = 'http://myowncloud.io:8080'\n url_to_open = api_manager.init_authorize_code_process(redirect_uri=redirect_uri, state='1234')\n print 'Open this URL: %s' % url_to_open\n code = api_manager.wait_and_terminate_authorize_code_process()\n api_manager.init_with_authorize_code(redirect_uri=redirect_uri, code=code)\n print 'refresh_token got %s' % api_manager.refresh_token\n\nThis will run a **local http server listening to your domain**, print an url to open. **Open it in your browser**,\nlog in using your cloud account, consent the access for your application.\nYou will be then redirected to your **local http server**. The code will be then extracted and exchanged for a token.\nYou can save your `refresh token`. Next time you can instantiate the `ApiManager` as follows:\n\n.. code-block:: python\n\n api_manager = ApiManager(client_id, client_secret)\n api_manager.init_with_token(refresh_token)\n\nYou are now fully able to use the api.\n\nAPI\n---\nThe api brings the following *domains*.\n\nFreeespace\n~~~~~~~~~~\nThe only operation on this endpoint is the `get` one that returns the available free space.\n\nFolders\n~~~~~~~\nThis endpoint let you:\n\n- `get` the information about a **folder** (*See the `documentation `_ about the `query parameters`*)\n- `create` a **folder** in the cloud\n- `delete` a **folder** from the cloud\n- `move` a **folder** from one **folder** to another\n- `rename` a **folder**\n- `copy` a **folder** in another **folder**\n\nFiles\n~~~~~\nThis endpoint let you:\n\n- `get` the information about a **file**.\n- `delete` a **file** from the cloud\n- `move` a **file** from one **folder** to another\n- `rename` a **file**\n- `copy` a **file** in another **folder**\n- `upload` a **file** on the cloud\n- `download` a **file** from the cloud\n\nCommand Line interface\n----------------------\nTo run the client, enter the following command :\n\n.. code-block:: bash\n\n\t$ orangecloud-client\n\nAt first execution, it will ask you ask.\nPlease note that your credentials won't be saved on your disk: only tokens will be kept for further use.\nPlease not that the command `shell` runs an interactive shell to interact with the cloud.\nOther commands are single command and return after finished.\n\nIssues and contributions\n------------------------\nPlease submit issue/pull request.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/antechrestos/orangecloud-client", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "orangecloud-client", "package_url": "https://pypi.org/project/orangecloud-client/", "platform": "", "project_url": "https://pypi.org/project/orangecloud-client/", "project_urls": { "Homepage": "http://github.com/antechrestos/orangecloud-client" }, "release_url": "https://pypi.org/project/orangecloud-client/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A client library for Orange cloud", "version": "0.0.2" }, "last_serial": 2475815, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1526fe6f5be075209d2fff69c6af88fd", "sha256": "1d23b82e74e14c24f1778595f63c1380b6c6d3e2cff80058189cfb141b39f3f7" }, "downloads": -1, "filename": "orangecloud-client-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1526fe6f5be075209d2fff69c6af88fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12027, "upload_time": "2016-11-22T09:25:42", "url": "https://files.pythonhosted.org/packages/b3/fe/42c152488267ded8461a2c427ed8ca673d12bb4e1d9b343d687b6c88d0a9/orangecloud-client-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1526fe6f5be075209d2fff69c6af88fd", "sha256": "1d23b82e74e14c24f1778595f63c1380b6c6d3e2cff80058189cfb141b39f3f7" }, "downloads": -1, "filename": "orangecloud-client-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1526fe6f5be075209d2fff69c6af88fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12027, "upload_time": "2016-11-22T09:25:42", "url": "https://files.pythonhosted.org/packages/b3/fe/42c152488267ded8461a2c427ed8ca673d12bb4e1d9b343d687b6c88d0a9/orangecloud-client-0.0.2.tar.gz" } ] }