{ "info": { "author": "Alex Rembish", "author_email": "alex@rembish.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": "====================\n GPDS version 0.4.1\n====================\n\nSimple GET-PUT-DELETE service (*GPDS*) to (temporary) store your files as an alternative to NFS shared folders.\n\nIt uses Gunicorn_ WSGI server as base and pass through all it's options. So you can simply start it using next command ``gpds WORKING-DIRECTORY``, where *working directory* is path to store and read files (by default, it'll be started on 8000 port).\n\n.. _Gunicorn: http://gunicorn.org/\n\nThis server can process only three request types, so try them with ``curl`` from your console::\n\n curl -i -X PUT -T somefile.jpg http://localhost:8000/\n\n HTTP/1.1 201 Created\n Server: gpds/0.3.1\n Date: Mon, 04 Feb 2013 16:06:27 GMT\n Connection: close\n Location: /55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg\n Content-Length: 0\n\nSo, what can we see here. GPDS created new file on yours file system (201 Created HTTP response) and this file is accessible on next address ``http://localhost:8000/55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg``. This big string *551...551* is SHA1 hash from uploaded file content. So we can do next trick::\n\n curl -i -X PUT -T somefile.txt http://localhost:8000/\n\n HTTP/1.1 200 OK\n Server: gpds/0.3.1\n Date: Mon, 04 Feb 2013 16:17:12 GMT\n Connection: close\n Location: /55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg\n Content-Length: 0\n\nAs you can see, ``Location`` is the same as in previous request. GPDS won't rewrite uploaded file.\n\nOK, let's try to access this file::\n\n curl -i http://localhost:8000/55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg\n\n HTTP/1.1 200 OK\n Server: gpds/0.3.1\n Date: Mon, 04 Feb 2013 16:38:26 GMT\n Connection: close\n Content-Length: 56737\n Content-Type: image/jpeg\n\n ...file content...\n\nCool, our service sent our image for us properly. Now we'll delete this file and try to access it one more time::\n\n curl -i -X DELETE http://localhost:8000/55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg\n\n HTTP/1.1 204 No Content\n Server: gpds/0.3.1\n Date: Mon, 04 Feb 2013 16:40:49 GMT\n Connection: close\n Content-Length: 0\n\n curl -i http://localhost:8001/55/1c/551ced9e9d54658155ae8b4197afd32087a1c551.jpg\n\n HTTP/1.1 404 Not Found\n Server: gpds/0.3.1\n Date: Mon, 04 Feb 2013 16:41:09 GMT\n Connection: close\n Content-Length: 0\n\nAs you can see GPDS successfully erased your file from disk and next time sent not found response for you.\n\nOk, now we'll try to do previous work with Python:\n\n.. code-block:: python\n\n from requests import put, get, delete\n\n filename = 'somefile.jpg'\n server = 'http://localhost:8000'\n r = put('%s/%s' % (server, filename), data=open(filename, 'rb'))\n result = ''.join([server, r.headers['Location']])\n print result # http://localhost:8000/2c/f3/2cf3af58d2416d40e18ca5e38f5baabc8a092765.jpg\n\n r = get(result)\n print r.headers['Content-Type'] # image/jpeg (our image sent for us)\n\n for _ in range(2):\n r = delete(result)\n print r.status_code # 1st time - 204 (No Content = deleted), \n # 2nd time - 404 (Not Found = already deleted)\n\nAs you can see, we used requests_ library, best way to do HTTP request in Python.\n\n.. _requests: http://docs.python-requests.org/en/latest/", "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/rembish/gpds", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "gpds", "package_url": "https://pypi.org/project/gpds/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gpds/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rembish/gpds" }, "release_url": "https://pypi.org/project/gpds/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "Simple GET-PUT-DELETE service to (temporary) store your files as an alternative to NFS shared folders.", "version": "0.4.1" }, "last_serial": 792639, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7fa5b9992e86d5b1df54468a6b994806", "sha256": "f20adfd785ca59ef0e60946ac5bc401cdbd40250ebed41d3645b7f591f7f6295" }, "downloads": -1, "filename": "gpds-0.1.tar.gz", "has_sig": false, "md5_digest": "7fa5b9992e86d5b1df54468a6b994806", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1727, "upload_time": "2013-02-04T16:12:07", "url": "https://files.pythonhosted.org/packages/ed/a5/b92fb751ee84639b14b661d09c7c7846721b857825c76b056eccd438e557/gpds-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "9f9cfb864a33af9dd46cf8ed2f984b22", "sha256": "5d9546f256e220bbdc63118cb0818d1c99b83a85cc38c7b542c98835a8d534e3" }, "downloads": -1, "filename": "gpds-0.2.tar.gz", "has_sig": false, "md5_digest": "9f9cfb864a33af9dd46cf8ed2f984b22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1730, "upload_time": "2013-02-04T16:45:02", "url": "https://files.pythonhosted.org/packages/b5/9c/654404cbc2c902220ee40ad0a57584b32fa6f3130ee843af0ed6c762e01c/gpds-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e6697d6fe4019b67863ec611b4b01b63", "sha256": "78020890f2e00c0e3c27e46c95b52a10f5d0d56239cf9f3b727f4d995a431cd0" }, "downloads": -1, "filename": "gpds-0.3.tar.gz", "has_sig": false, "md5_digest": "e6697d6fe4019b67863ec611b4b01b63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2270, "upload_time": "2013-02-05T09:08:41", "url": "https://files.pythonhosted.org/packages/bf/81/68b308fe96ec9a2422101f21284e02bbe09d1c1d648e2c5650aa8099342c/gpds-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "40eb474be83bed297a5f400f82d82416", "sha256": "a329fcc38a74f8d9c69dc5ee540ccba8f01a34ea0b69c6bba3c2cd1b3f6e2ff8" }, "downloads": -1, "filename": "gpds-0.3.1.tar.gz", "has_sig": false, "md5_digest": "40eb474be83bed297a5f400f82d82416", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3611, "upload_time": "2013-02-05T09:56:48", "url": "https://files.pythonhosted.org/packages/b4/86/fc81540b5c9a1988f15c914e2292afd722de250e69ddfc0e250f98214325/gpds-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "bbe73eb18ba6eb04e85d8feba017892a", "sha256": "e67ccbbcde6d5c2aaa83dc31cfc9b8b3a670ddd339b08f02dda4f615d3b2f18b" }, "downloads": -1, "filename": "gpds-0.4.0.tar.gz", "has_sig": false, "md5_digest": "bbe73eb18ba6eb04e85d8feba017892a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3672, "upload_time": "2013-02-06T10:02:18", "url": "https://files.pythonhosted.org/packages/5c/ce/e036bbf17aa79cd9f4afe024b3967963b43d0007b19dfd849b264f238e0b/gpds-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f7bb68acbc483b36813153fd650858be", "sha256": "481c558570f221dddc808354ac16726e26cd1f5f2392cd7fa767f5d3d72ad1df" }, "downloads": -1, "filename": "gpds-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f7bb68acbc483b36813153fd650858be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4195, "upload_time": "2013-02-06T16:12:51", "url": "https://files.pythonhosted.org/packages/4a/10/969fce6742ed1e9f6eb509ade0766bdcff6df8a710cc781ff58146fef05a/gpds-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7bb68acbc483b36813153fd650858be", "sha256": "481c558570f221dddc808354ac16726e26cd1f5f2392cd7fa767f5d3d72ad1df" }, "downloads": -1, "filename": "gpds-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f7bb68acbc483b36813153fd650858be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4195, "upload_time": "2013-02-06T16:12:51", "url": "https://files.pythonhosted.org/packages/4a/10/969fce6742ed1e9f6eb509ade0766bdcff6df8a710cc781ff58146fef05a/gpds-0.4.1.tar.gz" } ] }