{ "info": { "author": "oskarnyqvist", "author_email": "oskarnyqvist@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Barrels, python module for handle many small files\n==================================================\n\nBarrels sticks files into barrels, the barrels look like csv file (tab\nseperated) the meta information is readable, the content of each files\nis gziped and b64 encoded.\n\n.. code:: Python\n\n import barrels\n # new barrel\n b = barrels.Barrel(\"items/demo\")\n # store data in a barrel\n b.add(name=\"filename or key\", data=\"this is the content of the file\")\n\n # get files from barrel, using itterators\n print(\"Content of file - single \")\n for meta, content in b.filter():\n print(meta)\n print(content)\n #BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 25, 16, 826920), mime=u'unspecified', name=u'filename or key', sha1=u'bUaveapRE71+amf66atSKGSNP4E', length=31)\n #this is the content of the file\n\n # add more files\n for i in range(3):\n b.add(name=\"key-%d\"%i, data=\"this is the content of the file%d\"%i)\n\n # the file looks like this (items/demo.barrel):\n # 2015-09-19T06:30:22.753443 unspecified filename or key bUaveapRE71+amf66atSKGSNP4E 31 eJwrycgsVgCikoxUheT8vJLUvBKF/DQwNy0zJxUAta0LRw==\n # 2015-09-19T06:30:22.754352 unspecified key-0 vG5ClVS/bZtnV7BS8f4C2zuQGEM 32 eJwrycgsVgCikoxUheT8vJLUvBKF/DQwNy0zJ9UAAMEkC3c=\n # 2015-09-19T06:30:22.754518 unspecified key-1 74QD32oTnJH4zDY92DneevxVhSc 32 eJwrycgsVgCikoxUheT8vJLUvBKF/DQwNy0zJ9UQAMElC3g=\n # 2015-09-19T06:30:22.754662 unspecified key-2 Dp5K6ogePEZ89pyGLQ0aUbMRhGc 32 eJwrycgsVgCikoxUheT8vJLUvBKF/DQwNy0zJ9UIAMEmC3k=\n\n # you can specifify the mime\n b.add(name=\"mime file\", data=\"this is the content of the file\", mime=\"abc/123\")\n\n print(\"Meta, files\")\n for meta, content in b.filter():\n print(meta)\n # BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 35, 32, 952108), mime=u'unspecified', name=u'filename or key', sha1=u'bUaveapRE71+amf66atSKGSNP4E', length=31)\n # BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 35, 32, 953340), mime=u'unspecified', name=u'key-0', sha1=u'vG5ClVS/bZtnV7BS8f4C2zuQGEM', length=32)\n # BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 35, 32, 953565), mime=u'unspecified', name=u'key-1', sha1=u'74QD32oTnJH4zDY92DneevxVhSc', length=32)\n # BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 35, 32, 953771), mime=u'unspecified', name=u'key-2', sha1=u'Dp5K6ogePEZ89pyGLQ0aUbMRhGc', length=32)\n # BarrelHead(created=datetime.datetime(2015, 9, 19, 6, 35, 32, 953963), mime=u'abc/123', name=u'mime file', sha1=u'bUaveapRE71+amf66atSKGSNP4E', length=31)\n\n\n # You can also partition the barrels,\n b = barrels.PBarrel(\"items/demop\", size=0.1) #partion size 0.1 mb, if larger create new file\n\n #create some partioned barrels\n for i in range(20):\n b.add(name=\"key-%d\"%i, data=str(i)*10000000)\n\n # ls -lah\n # -rw-rw-r-- 1 oskar oskar 635 sep 19 20:20 demo.barrel\n # -rw-rw-r-- 1 oskar oskar 77K sep 19 20:20 demop.barrel\n # -rw-rw-r-- 1 oskar oskar 102K sep 19 20:20 demop.D2bfDRx6EmEMqdlWWUnN8uUmO3U.barrel\n # -rw-rw-r-- 1 oskar oskar 102K sep 19 20:20 demop.fMhB-zM-sOCIaEbbEHrJ7UJnY6k.barrel\n # -rw-rw-r-- 1 oskar oskar 103K sep 19 20:20 demop.NGu0EtXSfKmzGteUbNbD31AHHsM.barrel\n\n # You interface the PBarrel as a Barrel\n # i.e.\n print \"Partioned barrel\"\n heads = b.meta.heads\n for e,h in enumerate(heads):\n print e, h\n\n # Partioned barrel\n # 0 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 38, 689988), mime=u'unspecified', name=u'key-13', sha1=u'ozWQyIn7qxzdljqoElP8XQiPpg4', length=20000000)\n # 1 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 38, 865767), mime=u'unspecified', name=u'key-14', sha1=u'fKghYO3v3fkRul/J3DRt3Dhvpjg', length=20000000)\n # 2 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 39, 41536), mime=u'unspecified', name=u'key-15', sha1=u'frSylobUXdejQ513Kt3UwVvD0+I', length=20000000)\n # 3 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 39, 212197), mime=u'unspecified', name=u'key-16', sha1=u'nEuBg69Hncr6qLnBUqLk77HZQ6Q', length=20000000)\n # 4 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 899957), mime=u'unspecified', name=u'key-8', sha1=u'8RQxNhXMwtw9o/LfSCJqyQge2og', length=10000000)\n # 5 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 983437), mime=u'unspecified', name=u'key-9', sha1=u'evCJQTdqGrJRCoR3iUttvE8vJyQ', length=10000000)\n # 6 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 38, 156672), mime=u'unspecified', name=u'key-10', sha1=u'aCk3ZBUERzPT83oRk7bs5BbcdkA', length=20000000)\n # 7 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 38, 330716), mime=u'unspecified', name=u'key-11', sha1=u'WwWxiRVvkRdHrTlWFBBSqUTq5yE', length=20000000)\n # 8 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 38, 501095), mime=u'unspecified', name=u'key-12', sha1=u'wfm2CUinxhFyTmTkVsTJh0aemN8', length=20000000)\n # 9 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 229069), mime=u'unspecified', name=u'key-0', sha1=u'2l5UvEzMRZox82yko2acd6gd7Ok', length=10000000)\n # 10 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 315726), mime=u'unspecified', name=u'key-1', sha1=u'TgvDs37eBwHcOIw2CoulhJcAc5w', length=10000000)\n # 11 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 400158), mime=u'unspecified', name=u'key-2', sha1=u'ej5G+6Kd01beohkUFdD2eCFCH3s', length=10000000)\n # 12 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 485073), mime=u'unspecified', name=u'key-3', sha1=u'ZdC4EAAagYb1gl35BNemLWDt1Ug', length=10000000)\n # 13 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 568192), mime=u'unspecified', name=u'key-4', sha1=u'BVtkebuI9D6p6eB4W+VGAtyA6yQ', length=10000000)\n # 14 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 650567), mime=u'unspecified', name=u'key-5', sha1=u'Z1WG6zlD3sDaQhyb8jnZvREug6o', length=10000000)\n # 15 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 733357), mime=u'unspecified', name=u'key-6', sha1=u'Dz8v9BhL0y0znHicKSCu1uY/8Dc', length=10000000)\n # 16 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 37, 815705), mime=u'unspecified', name=u'key-7', sha1=u'2VTBk8+BDtw8Ehgdx4+cB0MlNEI', length=10000000)\n # 17 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 39, 385249), mime=u'unspecified', name=u'key-17', sha1=u'+YyOLGARvvvlciwBgNC32wgAxwE', length=20000000)\n # 18 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 39, 560305), mime=u'unspecified', name=u'key-18', sha1=u'OWbZQIb7FArYr0Hd91/YCtC7v/c', length=20000000)\n # 19 BarrelHead(created=datetime.datetime(2015, 9, 19, 18, 23, 39, 735275), mime=u'unspecified', name=u'key-19', sha1=u'5GowG35BpX9NqsSS1Rc4CFSq06U', length=20000000)", "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/oskarnyqvists/barrels", "keywords": null, "license": "The MIT License (MIT)\n\nCopyright (c) 2015 Oskar Nyqvist\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "barrels", "package_url": "https://pypi.org/project/barrels/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/barrels/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/oskarnyqvists/barrels" }, "release_url": "https://pypi.org/project/barrels/0.0.6/", "requires_dist": null, "requires_python": null, "summary": "Instead of tarballs, barrels of files", "version": "0.0.6" }, "last_serial": 1730018, "releases": { "0.0.6": [ { "comment_text": "", "digests": { "md5": "fe34d30ab813857aaec22bea3b328ddf", "sha256": "37b5a31267621c482df08d968bace4ff5ea303dc0c4219c3fe87cf21806dd28c" }, "downloads": -1, "filename": "barrels-0.0.6.tar.gz", "has_sig": false, "md5_digest": "fe34d30ab813857aaec22bea3b328ddf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5433, "upload_time": "2015-09-20T04:32:26", "url": "https://files.pythonhosted.org/packages/6a/3c/bab817474e49a59bc0eaada74d41751425cdc213b9a15607d3b3f8d1ee3a/barrels-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe34d30ab813857aaec22bea3b328ddf", "sha256": "37b5a31267621c482df08d968bace4ff5ea303dc0c4219c3fe87cf21806dd28c" }, "downloads": -1, "filename": "barrels-0.0.6.tar.gz", "has_sig": false, "md5_digest": "fe34d30ab813857aaec22bea3b328ddf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5433, "upload_time": "2015-09-20T04:32:26", "url": "https://files.pythonhosted.org/packages/6a/3c/bab817474e49a59bc0eaada74d41751425cdc213b9a15607d3b3f8d1ee3a/barrels-0.0.6.tar.gz" } ] }