{ "info": { "author": "Alex Pereverzyev", "author_email": "pereverzev.alex@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://travis-ci.org/AlexPereverzyev/repack.svg\n :target: https://travis-ci.org/AlexPereverzyev/repack\n\n==================\nWelcome to Repack!\n==================\n\nRepack is a collection of well known utilities nicely packed together.\nTo illustrate the idea, imagine, you need to pass an object via URL query\nstring, with Repack it looks like::\n \n import repack\n\n token1 = (repack\n .json_encode()\n .bytify()\n .deflate()\n .base64_encode()\n .url_encode() \n .converter()\n .send({'id': 10001, 'desc':'this is a token' }))\n\nBut normally, you would do::\n\n import json\n import zlib\n import base64\n import urllib.parse\n \n string = json.dumps({'id': 10001, 'desc':'this is a token' })\n stream = bytes(string, 'utf-8')\n stream = zlib.compress(stream)\n string = base64.b64encode(stream)\n token1 = urllib.parse.quote(string)\n\nFeel the difference :) Also you want it to be lasy, so you can make a converter\nonce and use it later::\n\n urlit = (repack\n .json_encode()\n .bytify()\n .deflate()\n .base64_encode()\n .url_encode() \n .converter())\n \nLike this::\n\n token1 = urlit.send({'id': 10001, 'desc':'this is a token' })\n \nOr like this::\n\n token2 = urlit.send('another token lol') \n token3 = urlit.send('one more yay')\n token4 = urlit.send('yay!!!')\n\nYou can chain the utilities as filter, meaning, values interpreted as `False`\nwill not pass::\n\n with (repack\n .reverse()\n .printout()\n .filter()) as f:\n \n f.send('olleH')\n f.send(None)\n f.send('!dlroW')\n f.send(None)\n \nPrints::\n\n Hello\n World!\n \nAnother example is iterator, which allows to set source later::\n\n with (repack\n .trim()\n .integer()\n .iterator()) as iterator:\n \n results = []\n for v in iterator.send(iter(['1 ','\\t2', '\\n3'])):\n results.append(v)\n \nResults in::\n\n [1, 2, 3]\n\nOr vice versa, using accumulator::\n\n with (repack\n .trim()\n .integer()\n .accumulator()) as acc:\n \n acc.send('1 ')\n acc.send('\\t2')\n acc.send('\\n3')\n \n results = []\n for v in acc:\n results.append(v)\n\nThe package is under development. Everyone is welcome to contribute.\nFor TODOs, please see the current TODO list in the root folder.\n\nRequirements\n============\n\n- Python 3.4.2\n\nInstall\n=======\n\nsudo pip install repack \n\nExtension\n=========\n\nAs easy as adding more filters to `filters/__init__.py` or more flows\nto `flows/__init__.py`.", "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/alexpereverzyev/repack", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Repack", "package_url": "https://pypi.org/project/Repack/", "platform": "Mac OS,Linux,Windows", "project_url": "https://pypi.org/project/Repack/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/alexpereverzyev/repack" }, "release_url": "https://pypi.org/project/Repack/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Repack is a collection of well known Python utilities nicely packed together.", "version": "0.1.1" }, "last_serial": 1447990, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "50ba9357964bb036afddda0741a65071", "sha256": "c2683f886433a35c554c80ef266d2838a12ab30f5971560424d484ab61b68533" }, "downloads": -1, "filename": "Repack-0.1.tar.gz", "has_sig": false, "md5_digest": "50ba9357964bb036afddda0741a65071", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6736, "upload_time": "2015-02-08T12:27:29", "url": "https://files.pythonhosted.org/packages/40/07/5ce0a85649dfe1b32273eb72f65f43bbe00af056ce95bea44fdfed2ffb64/Repack-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8b5339f796ba8822ae59c33c77e52a04", "sha256": "482d57136577f26dccb5ff29a1ed240b841ec3155f8f2e36362b80df53efd0b7" }, "downloads": -1, "filename": "Repack-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8b5339f796ba8822ae59c33c77e52a04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7544, "upload_time": "2015-03-04T17:09:49", "url": "https://files.pythonhosted.org/packages/57/3c/3769da66435d45f881e99b3c439950e863e275b01f12dfe491886da5dfc3/Repack-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b5339f796ba8822ae59c33c77e52a04", "sha256": "482d57136577f26dccb5ff29a1ed240b841ec3155f8f2e36362b80df53efd0b7" }, "downloads": -1, "filename": "Repack-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8b5339f796ba8822ae59c33c77e52a04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7544, "upload_time": "2015-03-04T17:09:49", "url": "https://files.pythonhosted.org/packages/57/3c/3769da66435d45f881e99b3c439950e863e275b01f12dfe491886da5dfc3/Repack-0.1.1.tar.gz" } ] }