{ "info": { "author": "James Gill", "author_email": "jamesagill@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Chainz\n======\n\nChainz is a lightweight library to provide chaining, functional methods\nto iterables.\n\nTo install: ``pip install chainz``\n\nBasic example:\n\n.. code:: python\n\n from chainz import Chain\n\n Chain(xrange(10))\\\n .map(lambda x: x + 1)\\\n .filter(lambda x: x % 2 == 0)\\\n .omit(lambda x: x % 3 == 0)\\\n .reduce(lambda x, y: x + y)\n # 30\n\nChain\n-----\n\nThe fundamental class in ``chainz`` is ``Chain``, which accepts an\niterable as an argument to its constructor. It is itself an iterable,\njust exposing the supplied iterable. It exposes functional methods like\n``map``, ``filter``, and ``flatten``, which return the chain so as to be\nchainable. These methods alter the chain; ``chain.map(f)`` is the same\nas ``chain = chain.map(f)``.\n\nSome methods, such as ``reduce`` and ``for_each``, are \"sinks\", in that\nthey consume the iterable. These methods do not return the chain, to\nmake it clear that once they are called, the chain is done.\n\nAll non-sink methods are lazy, so they don't result in any evaluation.\nOnly by using a sink method, or consuming the iterable in another way\n(such as ``list(chain)`` or ``[x for x in chain]``), do you actually\nevaluate the iterable.\n\nYou can think of ``Chain`` as a way to wrap ``itertools`` in a more\nchainable fashion.\n\nErrors\n------\n\nBy default, a ``Chain`` will stop whenever there's an exception. Often\nthat is not what you want. When you are processing a long list of items\n(something for which ``Chain`` was specifically created for), you just\nwant to note what went wrong, and move on to the next item. The method\n``on_error`` allows just that. It takes a function\n``f(exception, object)`` which itself takes two parameter. The first\nparameter is the raised exception. The second parameter is the object\nthat caused the exception.\n\nExample\n~~~~~~~\n\n.. code:: python\n\n def handle_error(exception, obj):\n print(\"%s caused exception: %s\" % (obj, exception))\n\n def double(x):\n if x == 1:\n raise Exception('Bad')\n return x*2\n\n chain = Chain(xrange(3)).on_error(handle_error).map(double)\n list(chain)\n # \"1 caused exception: Exception('Bad')\"\n # [0, 2]\n\nAPI\n---\n\nPlease see the ``docs/`` directory for auto-generated (and thus\nup-to-date) documentation. This is generated from the doc strings, so\nintrospection can also be helpful (eg, ``print Chain.reduce.__doc__``).", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jagill/python-chainz", "keywords": "iterable generators functional map filter reduce", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "chainz", "package_url": "https://pypi.org/project/chainz/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/chainz/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jagill/python-chainz" }, "release_url": "https://pypi.org/project/chainz/0.14/", "requires_dist": null, "requires_python": null, "summary": "Lightweight chaining functional methods for iterables", "version": "0.14" }, "last_serial": 2041822, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cece7f46e8bcd348597b1ffc2c994799", "sha256": "a3c32b3eeeaec63a302bad0a15b58cd1751681c36d32672cad6c1d4edc588095" }, "downloads": -1, "filename": "chainz-0.1.tar.gz", "has_sig": false, "md5_digest": "cece7f46e8bcd348597b1ffc2c994799", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3474, "upload_time": "2016-01-05T06:57:50", "url": "https://files.pythonhosted.org/packages/c9/9f/0d89251142195e7c7d79f5eee7f7d4ea9bdb3fac6ccd108af1713c8dd833/chainz-0.1.tar.gz" } ], "0.10": [ { "comment_text": "", "digests": { "md5": "77cb7eae5bd9e42f864cbdd4bca1cdd8", "sha256": "497419f8db51cadfe500d3d53e8389785c0331ac82d5ff682dffd5237d0edf9b" }, "downloads": -1, "filename": "chainz-0.10.tar.gz", "has_sig": false, "md5_digest": "77cb7eae5bd9e42f864cbdd4bca1cdd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7042, "upload_time": "2016-02-25T06:22:53", "url": "https://files.pythonhosted.org/packages/31/35/58366c1b20a13660812cd43b7d31e59a13535fd64c461d23ab98b96c849c/chainz-0.10.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "2549e31a4cfc6436bd1f84e7601d3d8c", "sha256": "c83639ab6794b7e5a8fddc8df3521460468e9edab6f6ef16cf028c8fdb347ad5" }, "downloads": -1, "filename": "chainz-0.11.tar.gz", "has_sig": false, "md5_digest": "2549e31a4cfc6436bd1f84e7601d3d8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7061, "upload_time": "2016-02-26T06:12:23", "url": "https://files.pythonhosted.org/packages/01/83/0f40e9f9ed30503bf74d47575f408e7561acf80bd3c1b98e6cdfac77a316/chainz-0.11.tar.gz" } ], "0.12": [ { "comment_text": "", "digests": { "md5": "2e892e11adb172345ab00759366ad741", "sha256": "d00ad7e13797cc3a1494c1c19c44383011878864b627b7cd03031aaccb2e26a4" }, "downloads": -1, "filename": "chainz-0.12.tar.gz", "has_sig": false, "md5_digest": "2e892e11adb172345ab00759366ad741", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7253, "upload_time": "2016-03-23T05:43:19", "url": "https://files.pythonhosted.org/packages/ba/9f/0919499a2d6f085167e9dfbc453b6782adbd2b8078ca16465f2e1dcf92b0/chainz-0.12.tar.gz" } ], "0.13": [ { "comment_text": "", "digests": { "md5": "d130b86a4adc37d4f86173c3499d0540", "sha256": "9e6829dbd7be76fb8ddb4fc89d3f43dacaa2d9dd0587755599b3e1b26d028346" }, "downloads": -1, "filename": "chainz-0.13.tar.gz", "has_sig": false, "md5_digest": "d130b86a4adc37d4f86173c3499d0540", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7512, "upload_time": "2016-04-02T13:22:36", "url": "https://files.pythonhosted.org/packages/76/59/6576124722681f7a1274d7e9f78c7e08f7bcf64b3b26c61ffdd5ce8ff06d/chainz-0.13.tar.gz" } ], "0.14": [ { "comment_text": "", "digests": { "md5": "031f087d075b48732627e444ede2c682", "sha256": "7ba5aa7d880ca3eca01d594159e439e953b27519b3242a698bcf5a1606ba2bab" }, "downloads": -1, "filename": "chainz-0.14.tar.gz", "has_sig": false, "md5_digest": "031f087d075b48732627e444ede2c682", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7685, "upload_time": "2016-04-02T13:31:08", "url": "https://files.pythonhosted.org/packages/a1/b9/65b24e7f6531451e9e9b1db6bacd5f3312b8ad3f84aee70425d2a4f4ab05/chainz-0.14.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "7fdc0f6d5ab6744368cdc791283d90e2", "sha256": "d4de1ab90c937898056c227299a839d2f9582f03159b39d7b662d7cd74f872e2" }, "downloads": -1, "filename": "chainz-0.2.tar.gz", "has_sig": false, "md5_digest": "7fdc0f6d5ab6744368cdc791283d90e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4635, "upload_time": "2016-01-07T01:38:32", "url": "https://files.pythonhosted.org/packages/d1/55/9b914e41493eecbd4671ff3346e190f7196fdb58df05cd8fdc34f030ef8b/chainz-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "5273abf4ac7d4684c6228b2f2b99f72f", "sha256": "91ba177b1abc294ce3747fdce05b073a319f469bd09e6a47bc1637e56b446504" }, "downloads": -1, "filename": "chainz-0.3.tar.gz", "has_sig": false, "md5_digest": "5273abf4ac7d4684c6228b2f2b99f72f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4931, "upload_time": "2016-01-08T22:31:03", "url": "https://files.pythonhosted.org/packages/ac/f9/579a811a2d9b3bc38ccfda93dacb5ce5c5a6f90d7f7dd83729e36680dbed/chainz-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "c012b0c7167f1f690093caa79f34b902", "sha256": "cc629eedbea8a1ad1424ddbb496255cdf8e81609e3046395eea98e3558647f45" }, "downloads": -1, "filename": "chainz-0.4.tar.gz", "has_sig": false, "md5_digest": "c012b0c7167f1f690093caa79f34b902", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4915, "upload_time": "2016-01-13T23:50:43", "url": "https://files.pythonhosted.org/packages/2a/23/8573c6e16c7be290dc87169c36062bb901d23826a327ca5a7d9a0e9c98f9/chainz-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "e1b94a9b267f978d66fd606035c4bb0c", "sha256": "dea6e3886d910e173985e1d50dfb190f27479822c530b7ff0b324d52d0069415" }, "downloads": -1, "filename": "chainz-0.5.tar.gz", "has_sig": false, "md5_digest": "e1b94a9b267f978d66fd606035c4bb0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5249, "upload_time": "2016-01-20T18:57:01", "url": "https://files.pythonhosted.org/packages/43/43/15b709dfdab920de5d12a4a27c291e6a5a9a267424688f700ac6b8351f92/chainz-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "f7d0a396a653bd3fd71562f4f9f9bcd6", "sha256": "56699b86d710f09c01ac0ec9e8b18d99c60aa81c722d22c6b8e559448e08fa60" }, "downloads": -1, "filename": "chainz-0.6.tar.gz", "has_sig": false, "md5_digest": "f7d0a396a653bd3fd71562f4f9f9bcd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5429, "upload_time": "2016-01-21T03:39:37", "url": "https://files.pythonhosted.org/packages/cd/e5/de874efa5c0306df48b940f1cbecc538d222848e702b55b3da51e202e068/chainz-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "7e75229568277ccc2079617147dec1e1", "sha256": "b3b70da381e5c060d29c2077e4cb776307983872de18445f55ba694a3f7d78a4" }, "downloads": -1, "filename": "chainz-0.7.tar.gz", "has_sig": false, "md5_digest": "7e75229568277ccc2079617147dec1e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5658, "upload_time": "2016-01-21T11:32:04", "url": "https://files.pythonhosted.org/packages/6f/2d/212cf2fde347a009f1c1b663fcd8ab10ab5cfc3eb70620196a5964a74558/chainz-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "1b71a8393f8f2eeaf9ba7e2f13f11311", "sha256": "e0fd6416e062670fd3008966ec8abe0a1ba4aef3207a906bb6c4edb1e827ece7" }, "downloads": -1, "filename": "chainz-0.8.tar.gz", "has_sig": false, "md5_digest": "1b71a8393f8f2eeaf9ba7e2f13f11311", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6808, "upload_time": "2016-02-01T07:59:11", "url": "https://files.pythonhosted.org/packages/83/aa/afcabb999cc04d66cdb91499a1c1bd9cec50e5ef9842439ccd24dc086f1e/chainz-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "fb90ccc9e863b529d8fb846960001139", "sha256": "dece67d21f2190ee4bd19a868b838503cec65aeb808f92c46a341b84f36e513a" }, "downloads": -1, "filename": "chainz-0.9.tar.gz", "has_sig": false, "md5_digest": "fb90ccc9e863b529d8fb846960001139", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6859, "upload_time": "2016-02-18T17:15:43", "url": "https://files.pythonhosted.org/packages/89/5d/194209c7a54f7b4c0f198082efc1363e7e915c342ae66b5d06c621123bdc/chainz-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "031f087d075b48732627e444ede2c682", "sha256": "7ba5aa7d880ca3eca01d594159e439e953b27519b3242a698bcf5a1606ba2bab" }, "downloads": -1, "filename": "chainz-0.14.tar.gz", "has_sig": false, "md5_digest": "031f087d075b48732627e444ede2c682", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7685, "upload_time": "2016-04-02T13:31:08", "url": "https://files.pythonhosted.org/packages/a1/b9/65b24e7f6531451e9e9b1db6bacd5f3312b8ad3f84aee70425d2a4f4ab05/chainz-0.14.tar.gz" } ] }