{ "info": { "author": "Ludvig Ericson", "author_email": "ludvig@lericson.se", "bugtrack_url": null, "classifiers": [], "description": "`simples3` is a fairly simple, decently quick interface to Amazon's S3 storage\nservice.\n\nIt grew out of frustration with other libraries that were either written too\npragmatically (slow), too bloatedly, or just half-done.\n\nThe module aims for:\n\n * simplicity,\n * decent speed,\n * non-intrusiveness.\n\nIt really is designed to fit into programmer memory. The three basic operations\nare as easy as with dictionaries.\n\nOut of simplicity comes no dependencies - the code relies solely on Python\nstandard libraries.\n\n`simples3` requires Python 2.5+ and nose for running tests. Python 3 support is not yet available.\n\nIRC\n---\n\n``#sendapatch`` on ``chat.freenode.net``.\n\nUsage\n-----\n\nA simple Amazon AWS S3 interface\n\nAccess to a bucket is done via the ``S3Bucket`` class. It has three required\narguments::\n\n >>> s = S3Bucket(bucket,\n ... access_key=access_key,\n ... secret_key=secret_key)\n ... \n >>> print s # doctest: +ELLIPSIS\n \n\nor if you'd like to use the use-any-domain-you-want stuff, set *base_url* to\nsomething like ``http://s3.example.com``::\n\n >>> s = S3Bucket(bucket,\n ... access_key=access_key,\n ... secret_key=secret_key,\n ... base_url=base_url)\n >>> print s # doctest: +ELLIPSIS\n \n\nNote that missing slash above, it's important. Think of it as\n\"The prefix to which all calls are made.\" Also the scheme can be `https` or\nregular `http`, or any other urllib2-compatible scheme (as in you could\nregister your own scheme.)\n\nNow, let's start doing something useful. Start out by putting a simple file\nonto there::\n\n >>> s.put(\"my file\", \"my content\")\n\nAlright, and fetch it back::\n\n >>> f = s.get(\"my file\")\n >>> f.read()\n 'my content'\n\nNice and tidy, but what if we want to know more about our fetched file? Easy::\n\n >>> f.s3_info[\"modify\"] # doctest: +ELLIPSIS\n datetime.datetime(...)\n >>> f.s3_info[\"mimetype\"]\n 'application/octet-stream'\n >>> f.s3_info.keys()\n ['mimetype', 'modify', 'headers', 'date', 'size', 'metadata']\n >>> f.close()\n\nNote that the type was octet stream. That's simply because we didn't specify\nanything else. Do that using the `mimetype` keyword argument::\n\n >>> s.put(\"my new file!\", \"Improved content!\\nMultiple lines!\",\n ... mimetype=\"text/plain\")\n\nLet's be cool and use the very Pythonic API to do fetch::\n\n >>> f = s[\"my new file!\"]\n >>> print f.read()\n Improved content!\n Multiple lines!\n >>> f.s3_info[\"mimetype\"]\n 'text/plain'\n >>> f.close()\n\nGreat job, huh. Now, let's delete it::\n\n >>> del s[\"my new file!\"]\n\nCould've used the `delete` method instead, but we didn't.\n\nIf you just want to know about a key, ask and ye shall receive::\n\n >>> from pprint import pprint\n >>> s[\"This is a testfile.\"] = S3File(\"Hi!\", metadata={\"hairdo\": \"Secret\"})\n >>> pprint(s.info(\"This is a testfile.\")) # doctest: +ELLIPSIS\n {'date': datetime.datetime(...),\n 'headers': {'content-length': '3',\n 'content-type': 'application/octet-stream',\n 'date': '...',\n 'etag': '\"...\"',\n 'last-modified': '...',\n 'server': 'AmazonS3',\n 'x-amz-id-2': '...',\n 'x-amz-meta-hairdo': 'Secret',\n 'x-amz-request-id': '...'},\n 'metadata': {'hairdo': 'Secret'},\n 'mimetype': 'application/octet-stream',\n 'modify': datetime.datetime(...),\n 'size': 3}\n\nNotable is that you got the metadata parsed out in the `metadata` key. You\nmight also have noticed how the file was uploaded, using an `S3File` object\nlike that. That's a nicer way to do it, in a way.\n\nThe `S3File` simply takes its keyword arguments, and passes them on to `put`\nlater. Other than that, it's a str subclass.\n\nAnd the last dict-like behavior is in tests::\n\n >>> \"This is a testfile.\" in s\n True\n >>> del s[\"This is a testfile.\"]\n >>> \"This is a testfile.\" in s\n False\n\nYou can also set a canned ACL using `put`, which is very simple::\n\n >>> s.put(\"test/foo\", \"test\", acl=\"public-read\")\n >>> s.put(\"test/bar\", \"rawr\", acl=\"public-read\")\n\nBoom. What's more? Listing the bucket::\n\n >>> for (key, modify, etag, size) in s.listdir(prefix=\"test/\"):\n ... print \"%r (%r) is size %r, modified %r\" % (key, etag, size, modify)\n ... # doctest: +ELLIPSIS\n 'test/bar' ('\"...\"') is size 4, modified datetime.datetime(...)\n 'test/foo' ('\"...\"') is size 4, modified datetime.datetime(...)\n\nThat about sums the basics up.\n\nChanges in simples3 1.0\n-----------------------\n\n* Made simples3 a \"flat package\", imports work as usual.\n* Refactored ``url_for`` to ``make_url_authed``, ``make_url``.\n* Added an optional timeout argument to the ``S3Bucket`` class.\n* Added nose-based testing.\n* Added support for streaming with ``poster.streaminghttp``.\n* Added support for Google App Engine.\n\nChanges in simples3 0.5\n-----------------------\n\n* Add S3-to-S3 copy method.\n\nChanges in simples3 0.4\n-----------------------\n\n* Minor fixes, released as 0.4 mostly because the previous version naming\n scheme was a bad idea.\n* 0.4.1: Made the put method retry on HTTP 500.\n* 0.4.1: Fix a critical error in signature generation when metadata is given.\n\nChanges in simples3 0.3\n-----------------------\n\n* Add a ``url_for`` method on buckets which lets you use expiring URLs. Thanks\n to Pavel Repin.\n* Much better test coverage.\n* ``simples3`` now works on Python 2.6's ``mimetypes`` module.\n* r1: Handle HTTP errors in exception parser better, which broke the existence\n test.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://sendapatch.se/projects/simples3/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "simples3", "package_url": "https://pypi.org/project/simples3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/simples3/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://sendapatch.se/projects/simples3/" }, "release_url": "https://pypi.org/project/simples3/1.0/", "requires_dist": null, "requires_python": null, "summary": "Simple, quick Amazon AWS S3 interface", "version": "1.0" }, "last_serial": 799593, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0c29aff60cdc334a72f34ec853887e10", "sha256": "ad949ecee297b368a72a2557ad6744538040e7d42a8d934d6d24d26a0918ca72" }, "downloads": -1, "filename": "simples3-0.1.tar.gz", "has_sig": false, "md5_digest": "0c29aff60cdc334a72f34ec853887e10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7562, "upload_time": "2009-01-08T06:48:41", "url": "https://files.pythonhosted.org/packages/71/8d/0abaa57ec30f96efb13f4b143e023244b0b46255ebefcbcc6bc56342a9c3/simples3-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "42f5b09302042e033868863cae862c83", "sha256": "078641f417db170ede86b09b72e4e1b561b1b43f8527a750b92d9fe90c77c4f9" }, "downloads": -1, "filename": "simples3-0.2.tar.gz", "has_sig": false, "md5_digest": "42f5b09302042e033868863cae862c83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7630, "upload_time": "2009-01-30T10:32:37", "url": "https://files.pythonhosted.org/packages/df/50/0de12fb6ee3ef4de4831db9227d20d896964b312f7398787dead8e274bfa/simples3-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "12ad8e39dddd7c012896617727657542", "sha256": "d28cf8a662d7ba62f4c4d2d4b42978597750d1af7838581935adf7395b7fede2" }, "downloads": -1, "filename": "simples3-0.3.tar.gz", "has_sig": false, "md5_digest": "12ad8e39dddd7c012896617727657542", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8840, "upload_time": "2009-06-14T17:09:25", "url": "https://files.pythonhosted.org/packages/58/cf/5fc5f7954c9dd2522a9c0dda3d0635f1eb82e992ba5a791ea63bd8e03430/simples3-0.3.tar.gz" } ], "0.3-r1": [ { "comment_text": "", "digests": { "md5": "e82061297741b8a15628697521c6b01e", "sha256": "40f41ba2d392e670c8107b4ebe0dbe51683cb10e5443e7764e32bb175365dbf5" }, "downloads": -1, "filename": "simples3-0.3-r1.tar.gz", "has_sig": false, "md5_digest": "e82061297741b8a15628697521c6b01e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8972, "upload_time": "2009-06-14T17:46:41", "url": "https://files.pythonhosted.org/packages/ac/fc/e46d147cee1289972680b7d46c932527d3de17b817e24a87b3514afa33ed/simples3-0.3-r1.tar.gz" } ], "0.3-r2": [ { "comment_text": "", "digests": { "md5": "76823209f630ed84904d5f8e2e89a2a4", "sha256": "cd96282bb15dbd798f71997eaa05f4a881e2d831b430e2efc6c263c917f37fd2" }, "downloads": -1, "filename": "simples3-0.3-r2.tar.gz", "has_sig": false, "md5_digest": "76823209f630ed84904d5f8e2e89a2a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9034, "upload_time": "2009-06-14T17:49:21", "url": "https://files.pythonhosted.org/packages/62/64/6685aaa3221d0344d710dc57c7b7c0f5828c1339fc69a03ed339b65d0d39/simples3-0.3-r2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "892192f9fc784eb5d9045866bf9ae8c8", "sha256": "6eb25978dff2163bb73598cb992472841d2973c3f592a6bbce27ab37014d3c7d" }, "downloads": -1, "filename": "simples3-0.4.tar.gz", "has_sig": false, "md5_digest": "892192f9fc784eb5d9045866bf9ae8c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9100, "upload_time": "2009-06-16T15:01:49", "url": "https://files.pythonhosted.org/packages/19/c0/9b4a5c1cfdfd49fe6701c0db46cb0d7e9cdc60d4e6ff9995a2956b67de70/simples3-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "2836763e6fd7ec3171cc9a0894a23a5c", "sha256": "d63c713efd9126fae4fbc4b409dc34596310b19193962a0aacafc2be849be594" }, "downloads": -1, "filename": "simples3-0.4.1.tar.gz", "has_sig": false, "md5_digest": "2836763e6fd7ec3171cc9a0894a23a5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9575, "upload_time": "2009-06-30T18:46:10", "url": "https://files.pythonhosted.org/packages/02/3a/105313de9c2919afe7a58546d31cc96e7d087403f152d1c124190b1c486e/simples3-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "e9a7a85db3085486a13dc55c4d436917", "sha256": "c9dfa7161aa9e5b7c2f8717fa680a00a82f663d541966128928b6d313d4c8ce0" }, "downloads": -1, "filename": "simples3-0.5.tar.gz", "has_sig": false, "md5_digest": "e9a7a85db3085486a13dc55c4d436917", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10574, "upload_time": "2009-07-12T18:54:02", "url": "https://files.pythonhosted.org/packages/54/5d/0f669c9fbe0d68ba8308515192ded3fab2b11d67bc63d93887666ce28f9e/simples3-0.5.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "fc8d4c4dae6b068e42f5b2c5d05b0134", "sha256": "2f3d3ef5a691741a489971e292cca2fd69bb11937b542bd1838793da2014f0fc" }, "downloads": -1, "filename": "simples3-1.0.tar.gz", "has_sig": false, "md5_digest": "fc8d4c4dae6b068e42f5b2c5d05b0134", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14630, "upload_time": "2010-09-06T16:43:06", "url": "https://files.pythonhosted.org/packages/e3/7a/6fccad7b7aa621a2f95df3e2a69c977103bd2a73aa1776c66280b73c41dc/simples3-1.0.tar.gz" } ], "1.0-alpha": [ { "comment_text": "", "digests": { "md5": "e0dfd5cf22d5c1dbb162b11a6896cee0", "sha256": "88879eec33acdce42119ba06d29565487b97e53b1e8230e9488e23b797101005" }, "downloads": -1, "filename": "simples3-1.0-alpha.tar.gz", "has_sig": false, "md5_digest": "e0dfd5cf22d5c1dbb162b11a6896cee0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12904, "upload_time": "2010-01-18T15:27:30", "url": "https://files.pythonhosted.org/packages/ed/fe/141f9c65f16124c28a1e5eeb23aab72f62c8b85fac79c969cdbc89b4e258/simples3-1.0-alpha.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fc8d4c4dae6b068e42f5b2c5d05b0134", "sha256": "2f3d3ef5a691741a489971e292cca2fd69bb11937b542bd1838793da2014f0fc" }, "downloads": -1, "filename": "simples3-1.0.tar.gz", "has_sig": false, "md5_digest": "fc8d4c4dae6b068e42f5b2c5d05b0134", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14630, "upload_time": "2010-09-06T16:43:06", "url": "https://files.pythonhosted.org/packages/e3/7a/6fccad7b7aa621a2f95df3e2a69c977103bd2a73aa1776c66280b73c41dc/simples3-1.0.tar.gz" } ] }