{
"info": {
"author": "Ben Timby",
"author_email": "tech@smartfile.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": ".. image:: https://d2xtrvzo9unrru.cloudfront.net/brands/smartfile/logo.png\n :alt: SmartFile\n\nA `SmartFile`_ Open Source project. `Read more`_ about how SmartFile\nuses and contributes to Open Source software.\n\n.. image:: https://travis-ci.org/smartfile/client-python.png\n :alt: Travis CI Status\n :target: https://travis-ci.org/smartfile/client-python\n\n.. image:: https://coveralls.io/repos/smartfile/client-python/badge.png?branch=master\n :target: https://coveralls.io/r/smartfile/client-python\n :alt: Code Coverage\n\n.. image:: https://pypip.in/v/smartfile/badge.png\n :target: https://crate.io/packages/smartfile/\n :alt: Latest PyPI version\n\n.. image:: https://pypip.in/d/smartfile/badge.png\n :target: https://crate.io/packages/smartfile/\n :alt: Number of PyPI downloads\n\nSummary\n------------\n\nThis library includes two API clients. Each one represents one of the supported\nauthentication methods. ``BasicClient`` is used for HTTP Basic authentication,\nusing an API key and password. ``OAuthClient`` is used for OAuth (version 1) authentication,\nusing tokens, which will require user interaction to complete authentication with the API.\n\nBoth clients provide a thin wrapper around an HTTP library, taking care of some\nof the mundane details for you. The intended use of this library is to refer to\nthe API documentation to discover the API endpoint you wish to call, then use\nthe client library to invoke this call.\n\nSmartFile API information is available at the\n`SmartFile developer site `_.\n\nInstallation\n------------\n\nYou can install via ``pip``.\n\n::\n\n $ pip install smartfile\n\nOr via source code / GitHub.\n\n::\n\n $ git clone https://github.com/smartfile/client-python.git smartfile\n $ cd smartfile\n $ python setup.py install\n\nMore information is available at `GitHub `_\nand `PyPI `_.\n\nUsage\n-----\n\nChoose between Basic and OAuth authentication methods, then continue to use the SmartFile API.\n\nSome of the details this library takes care of are:\n\n* Encoding and decoding of parameters and return values. You deal with Python\n types only.\n* URLs, using the API version, endpoint, and object ID, the URL is created for\n you.\n* Authentication. Provide your API credentials to this library, it will take\n care of the details.\n\nBasic Authentication\n--------------------\n\nThree methods are supported for providing API credentials using basic authentication.\n\n1. Parameters when instantiating the client.\n\n .. code:: python\n\n >>> from smartfile import BasicClient\n >>> api = BasicClient('**********', '**********')\n >>> api.get('/ping')\n\n2. Environment variables.\n\n Export your credentials via your environment.\n\n ::\n\n $ export SMARTFILE_API_KEY=**********\n $ export SMARTFILE_API_PASSWORD=**********\n\n And then you can use the client without providing any credentials in your\n code.\n\n .. code:: python\n\n >>> from smartfile import BasicClient\n >>> # Credentials are read automatically from environment\n >>> api = BasicClient()\n >>> api.get('/ping')\n\n3. `netrc `_ file (not supported with OAuth).\n\n You can place the following into ``~/.netrc``:\n\n ::\n\n machine app.smartfile.com\n login **********\n password **********\n\n And then you can use the client without providing any credentials in your\n code.\n\n .. code:: python\n\n >>> from smartfile import BasicClient\n >>> # Credentials are read automatically from netrc\n >>> api = BasicClient()\n >>> api.get('/ping')\n\n You can override the default netrc file location, using the optional\n ``netrcfile`` kwarg.\n\n .. code:: python\n\n >>> from smartfile import BasicClient\n >>> # Credentials are read automatically from netrc\n >>> api = BasicClient(netrcfile='/etc/smartfile.keys')\n >>> api.get('/ping')\n\nOAuth Authentication\n--------------------\n\nAuthentication using OAuth authentication is bit more complicated, as it involves tokens and secrets.\n\n.. code:: python\n\n >>> from smartfile import OAuthClient\n >>> api = OAuthClient('**********', '**********')\n >>> # Be sure to only call each method once for each OAuth login\n >>>\n >>> # This is the first step with the client, which should be left alone\n >>> api.get_request_token()\n >>> # Redirect users to the following URL:\n >>> print \"In your browser, go to: \" + api.get_authorization_url()\n >>> # This example uses raw_input to get the verification from the console:\n >>> client_verification = raw_input(\"What was the verification? :\")\n >>> api.get_access_token(None, client_verification)\n >>> api.get('/ping')\n\nCalling endpoints\n-----------------\n\nOnce you instantiate a client, you can use the get/put/post/delete methods\nto make the corresponding HTTP requests to the API. There is also a shortcut\nfor using the GET method, which is to simply invoke the client.\n\n.. code:: python\n\n >>> from smartfile import BasicClient\n >>> api = BasicClient('**********', '**********')\n >>> api.get('/ping')\n >>> # The following is equivalent...\n >>> api('/ping')\n\nSome endpoints accept an ID, this might be a numeric value, a path, or name,\ndepending on the object type. For example, a user's id is their unique\n``username``. For a file path, the id is it's full path.\n\n.. code:: python\n\n >>> import pprint\n >>> from smartfile import BasicClient\n >>> api = BasicClient('**********', '**********')\n >>> # For this endpoint, the id is '/'\n >>> pprint.pprint(api.get('/path/info', '/'))\n {u'acl': {u'list': True, u'read': True, u'remove': True, u'write': True},\n u'attributes': {},\n u'extension': u'',\n u'id': 7,\n u'isdir': True,\n u'isfile': False,\n u'items': 348,\n u'mime': u'application/x-directory',\n u'name': u'',\n u'owner': None,\n u'path': u'/',\n u'size': 220429838,\n u'tags': [],\n u'time': u'2013-02-23T22:49:30',\n u'url': u'http://localhost:8000/api/2/path/info/'}\n\nFile transfers\n--------------\n\nUploading and downloading files is supported.\n\nTo upload a file:\n\n.. code:: python\n\n >>> from smartfile import BasicClient\n >>> api = BasicClient()\n >>> file = open('test.txt', 'rb')\n >>> api.upload('test.txt', file)\n\n\nDownloading is automatic, if the ``'Content-Type'`` header indicates\ncontent other than the expected JSON return value, then a file-like object is\nreturned.\n\n.. code:: python\n\n >>> from smartfile import BasicClient\n >>> api = BasicClient()\n >>> api.download('foobar.png')\n\n\nTasks\n-----\n\nOperations are long-running jobs that are not executed within the time frame\nof an API call. For such operations, a task is created, and the API can be used\nto poll the status of the task.\n\nMove files\n\n.. code:: python\n\n >>> import logging\n >>> from smartfile import BasicClient\n >>>\n >>> api = BasicClient()\n >>>\n >>> LOGGER = logging.getLogger(__name__)\n >>> LOGGER.setLevel(logging.INFO)\n >>>\n >>> api.move('file.txt', '/newFolder')\n >>>\n >>> while True:\n >>> try:\n >>> s = api.get('/task', api['uuid'])\n >>> # Sleep to assure the user does not get rate limited\n >>> time.sleep(1)\n >>> if s['result']['status'] == 'SUCCESS':\n >>> break\n >>> elif s['result']['status'] == 'FAILURE':\n >>> LOGGER.info(\"Task failure: \" + s['uuid'])\n >>> except Exception as e:\n >>> print e\n >>> break\n\n\nDelete files\n\n.. code:: python\n\n >>> from smartfile import BasicClient\n >>> api = BasicClient()\n >>> api.remove('foobar.png')\n\n.. _SmartFile: http://www.smartfile.com/\n.. _Read more: http://www.smartfile.com/open-source.html\n\n\n\nRunning Tests\n--------------\nTo run tests for the test.py file:\n::\n nosetests -v tests.py\n\nTo run tests for the test_smartfile.py file:\n::\n API_KEY='****' API_PASSWORD='****' nosetests test",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/smartfile/client-python/",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "smartfile",
"package_url": "https://pypi.org/project/smartfile/",
"platform": "",
"project_url": "https://pypi.org/project/smartfile/",
"project_urls": {
"Homepage": "http://github.com/smartfile/client-python/"
},
"release_url": "https://pypi.org/project/smartfile/2.19/",
"requires_dist": null,
"requires_python": "",
"summary": "A Python client for the SmartFile API.",
"version": "2.19"
},
"last_serial": 2927191,
"releases": {
"2.1-1": [
{
"comment_text": "",
"digests": {
"md5": "532fa4bac46d151e22be2a227bb05795",
"sha256": "46d1d95303c04b32f1091291b72217a4ba8f8555822719a51670b9b14df63ae3"
},
"downloads": -1,
"filename": "smartfile-2.1-1.tar.gz",
"has_sig": false,
"md5_digest": "532fa4bac46d151e22be2a227bb05795",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7073,
"upload_time": "2013-02-27T20:25:12",
"url": "https://files.pythonhosted.org/packages/3f/4d/cd06a9f85a8c164f8faaa0ce466ace3392101c2175c54e102cf165896eae/smartfile-2.1-1.tar.gz"
}
],
"2.1-2": [
{
"comment_text": "",
"digests": {
"md5": "17eab8a93ac5de8ba9f1e103364ffe07",
"sha256": "997f6f09a3d452c253fda29aebee6122bca97f01e5aa86ad05aaf26d542f39b2"
},
"downloads": -1,
"filename": "smartfile-2.1-2.tar.gz",
"has_sig": false,
"md5_digest": "17eab8a93ac5de8ba9f1e103364ffe07",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10856,
"upload_time": "2013-05-01T21:11:07",
"url": "https://files.pythonhosted.org/packages/0a/cf/126707ef3341d43c388ba7c5b8888ecd71db53b05491e373a9d4e961d546/smartfile-2.1-2.tar.gz"
}
],
"2.1-3": [
{
"comment_text": "",
"digests": {
"md5": "a1002f8f80504455a0eccfca7638a5b6",
"sha256": "e35ac41b27ca6afa2b0c93a8ce0e07bb00106a408a41843ba3bbe7f0d24e43f5"
},
"downloads": -1,
"filename": "smartfile-2.1-3.tar.gz",
"has_sig": false,
"md5_digest": "a1002f8f80504455a0eccfca7638a5b6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12543,
"upload_time": "2013-05-07T12:57:28",
"url": "https://files.pythonhosted.org/packages/48/ff/a9e01c8afbe35f20b30439516b5e010bcffb799e9e8c84dcb2ed404b5c8e/smartfile-2.1-3.tar.gz"
}
],
"2.1-4": [
{
"comment_text": "",
"digests": {
"md5": "edd88843675aa350353f8d7b6f2d7b29",
"sha256": "41a47a5e0b34574018786f24e5f051fe77dd70c22009c4e1a7eb771973d6935d"
},
"downloads": -1,
"filename": "smartfile-2.1-4.tar.gz",
"has_sig": false,
"md5_digest": "edd88843675aa350353f8d7b6f2d7b29",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12572,
"upload_time": "2013-05-13T17:06:46",
"url": "https://files.pythonhosted.org/packages/bd/01/d2f875602c2a792b840b8c7d58377c313bac002b893b3001398c5122258a/smartfile-2.1-4.tar.gz"
}
],
"2.1-5": [
{
"comment_text": "",
"digests": {
"md5": "18ecdfb2e515f2a2679f08fab1958c30",
"sha256": "d966b2de6d5e622ef38cce734b34e597837540f891565c8aee0c695bcf4e8115"
},
"downloads": -1,
"filename": "smartfile-2.1-5.tar.gz",
"has_sig": false,
"md5_digest": "18ecdfb2e515f2a2679f08fab1958c30",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14062,
"upload_time": "2013-05-16T14:16:25",
"url": "https://files.pythonhosted.org/packages/30/65/dc0f27ec1089a3075dccacb0d4f1b6a9d123228340323e17e719098c9ef2/smartfile-2.1-5.tar.gz"
}
],
"2.1-6": [
{
"comment_text": "",
"digests": {
"md5": "7387ff06e1a75db5934d0c1bd1220060",
"sha256": "c9b48cab77c08c22989aa1d07ac7408db4c834227fc8a6226d7b07fd25ffca38"
},
"downloads": -1,
"filename": "smartfile-2.1-6.tar.gz",
"has_sig": false,
"md5_digest": "7387ff06e1a75db5934d0c1bd1220060",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14056,
"upload_time": "2013-05-17T18:54:15",
"url": "https://files.pythonhosted.org/packages/e4/d0/16fb75d4697e73c2d6b9467680b71a8ca61ee4a5e208bcae190b18198bbf/smartfile-2.1-6.tar.gz"
}
],
"2.1-7": [],
"2.1.post7": [
{
"comment_text": "",
"digests": {
"md5": "2279f2f651cd76fa757dc5b79585b8b7",
"sha256": "58ba77057c5015efd624d0b42307aa20c95e2e1d22f26e92ffdf0a5fc4e20acd"
},
"downloads": -1,
"filename": "smartfile-2.1.post7.tar.gz",
"has_sig": false,
"md5_digest": "2279f2f651cd76fa757dc5b79585b8b7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12040,
"upload_time": "2017-06-01T19:21:08",
"url": "https://files.pythonhosted.org/packages/45/fb/f3050c5a04b9956312f7172d07971e94ddf88364da2ae3e1af4b86d721d7/smartfile-2.1.post7.tar.gz"
}
],
"2.18": [
{
"comment_text": "",
"digests": {
"md5": "cda514f6510d0d191cf7b38ef414070b",
"sha256": "5f013207c5b38a3248219f30c7105d4a067a87123b5fcc890b58bd6a3d74578f"
},
"downloads": -1,
"filename": "smartfile-2.18.tar.gz",
"has_sig": false,
"md5_digest": "cda514f6510d0d191cf7b38ef414070b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12142,
"upload_time": "2017-06-01T20:08:34",
"url": "https://files.pythonhosted.org/packages/92/6f/93c73fab5d7c31beeee89fe1ec8f493014e2441dd65598df5a777747f9de/smartfile-2.18.tar.gz"
}
],
"2.19": [
{
"comment_text": "",
"digests": {
"md5": "65bde15fb511d2fa770c3261be03b130",
"sha256": "9c266a4ee8c54061ef79af5f376f993b2d9a03cddf15a286f8e14bf51a7ca881"
},
"downloads": -1,
"filename": "smartfile-2.19.tar.gz",
"has_sig": false,
"md5_digest": "65bde15fb511d2fa770c3261be03b130",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12188,
"upload_time": "2017-06-01T20:41:16",
"url": "https://files.pythonhosted.org/packages/a4/a2/cf1108bd1915bd1bcc041dbaf4eaab6a7199cf4e80dc95d91028432ee4ac/smartfile-2.19.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "65bde15fb511d2fa770c3261be03b130",
"sha256": "9c266a4ee8c54061ef79af5f376f993b2d9a03cddf15a286f8e14bf51a7ca881"
},
"downloads": -1,
"filename": "smartfile-2.19.tar.gz",
"has_sig": false,
"md5_digest": "65bde15fb511d2fa770c3261be03b130",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12188,
"upload_time": "2017-06-01T20:41:16",
"url": "https://files.pythonhosted.org/packages/a4/a2/cf1108bd1915bd1bcc041dbaf4eaab6a7199cf4e80dc95d91028432ee4ac/smartfile-2.19.tar.gz"
}
]
}