{ "info": { "author": "Silvio Mayolo", "author_email": "mercerenies@comcast.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Alakazam\n========\n\nFunctional programming sugar for Python.\n\nInstalling\n----------\n\nA simple ``pip`` command should do the trick. (In some cases, you may\nneed to use ``sudo``) ::\n\n pip install alakazam\n\nThe Alakazam library does not, as of now, have any additional\ndependencies and is designed for Python 2 and 3.\n\nUsing\n-----\n\nTo use the stream functionality of Alakazam, import the ``alakazam``\npackage. It is recommended that you alias the package as something\nlike ``zz`` for easier typing.\n\nTo use the Alakazam lambda syntax, import the placeholders from\n``alakazam`` explicitly. ::\n\n import alakazam as zz\n from alakazam import _1, _2, _3, _4, _5\n\nThis library aims to make functional-style, and specifically\nstream-oriented programming in Python prettier, more pleasant, and\neasier on the eyes. Python has been capable of many functional\nprogramming tasks, but it has always been a little bit awkward to use\nthose features for anything nontrivial. For instance, suppose we had\nsome list ``arr``, and we wanted to square every element of the list\nand then keep only the even squares. This is how we might approach\nthis problem using Python's built-in functional tools. ::\n\n list(filter(lambda x: x % 2 == 0, map(lambda x: x ** 2, arr)))\n\nThere's a lot of cruft here, with having to explicitly declare that\nwe're using lambdas every time we need to make a\nfunction. Additionally, we have to read the code almost backward to\nunderstand what it's doing. While this backward sequencing of\noperations is fine in a language like Haskell (where pointfree\nnotation hides the messy bracketing), in Python it would make much\nmore sense if we could read our code in the normal order. This is\nwhere Alakazam comes in. ::\n\n zz.of(arr).map(_1 ** 2).filter(_1 % 2 == 0).list()\n\nNow the code reads left-to-right, and the lambdas are not nearly as\nbulky. The ``zz.ZZ`` (which is an alias for the class\n``alakazam.Alakazam``) is the entry point to any stream-based\noperations you might want to perform with Alakazam. The ``of`` method\nwraps any iterable in an Alakazam instance. Then the ``map`` and\n``filter`` do the same thing as their global function\nequivalents. Finally, the ``list`` method converts the Alakazam\niterable into an ordinary Python list. The important thing is that,\nnow, a cursory left-to-right reading of the code yields \"arr -> map ->\nfilter -> list\", which is the sequence of operations we're actually\nperforming.\n\nThe lambda syntax is also significantly shortened. In cases where your\nanonymous function merely uses operators, element access, and\nattribute access, you can shorten it by using the placeholder\nlambdas. The placeholder constants ``_1, _2, _3, _4, _5``, based\nloosely on the C++ Boost placeholders with the same names, are each\ndefined as callable objects which return their nth argument. If you\nneed more than five arguments, you can use `zz.arg(n)` directly, which\nis how the placeholders are implemented in the first place. These\nplaceholders can be used with (almost) any built-in Python operator,\nand they can also be subscripted and have arbitrary attributes\naccessed on them. All of these operations will be translated into an\nanonymous function that performs the corresponding operation on its\narguments. So ``_1 ** 2`` is a function that squares its first (and\nonly) argument, ``_1 + _2`` is a function that adds two arguments\ntogether, and ``_1.name == \"Alakazam\"`` is a function which checks\nwhether its argument's name attribute is equal to \"Alakazam\".\n\nReference Material\n------------------\n\nThe `Alakazam Wiki`_ lists the functions available to user\n\n.. _`Alakazam Wiki`: https://github.com/Mercerenies/alakazam/wiki\n\nLicense\n-------\n\nPlease see ``LICENSE.txt`` for licensing information.\n\nAuthor\n------\n\nAlakazam was written by Silvio Mayolo.\n\nRelease Notes (0.6.0)\n---------------------\n\n* ``intersperse`` and ``intertwine`` transformers added.\n\n* ``string`` reducer added.\n\n* ``assign`` as a synonym for ``set``.\n\n* All classes are now new-style in Python 2 as well as Python 3.\n\nRelease Notes (0.5.0)\n---------------------\n\n* ``accumulate`` can take an initial value now.\n\n* ``accumulate``, ``filterfalse``, and ``zip_longest`` now work\n correctly on Python 2.\n\n* ``sum`` now works on any type that has ``__add__``, including\n strings.\n\n* ``compose`` works correctly when the argument list is empty now.\n\n* Several functions that used to raise Python errors now raise\n ``AlakazamError``.\n\n* Several bugfixes having to do with lazy evaluation in Python 2.\n\nRelease Notes (0.4.0)\n---------------------\n\n* Trace functions ``trace``, ``traceid``, and ``tracestack``, for\n debugging help.\n\n* New convenience syntax for invoking ``bind``.\n\n* ``map`` can take multiple arguments now (Issue #1).\n\n* ``withobject`` transformer method.\n\n* ``zipup`` producer method.\n\n* ``absorb`` and ``consume`` reduction methods.\n\n* ``swap`` convenience function for tuples.\n\n* Terminology change: \"Generator\" to \"Producer\" to avoid confusion\n with the Python \"generator\" concept.\n\nRelease Notes (0.3.0)\n---------------------\n\n* New convenience function ``id``.\n\n* Boolean functions ``not``, ``and_``, ``or_``, and ``xor``.\n\n* ``min`` and ``max`` methods on ``Alakazam`` objects.\n\n* New ``flatten`` and ``iterate`` methods.\n\n* ``length`` and ``null`` reduction methods.\n\n* ``None`` is now permitted as an argument to some functions where its\n behavior would have caused issues before.\n\nRelease Notes (0.2.0)\n---------------------\n\n* Alakazam now uses Python 3 semantics for division (``from __future__\n import division``) for consistency.\n\n* New functions ``setindex``, ``getindex``, and ``delindex``, for\n subscripted access and manipulation.\n\n* New utility function ``raise_``.\n\n* Assignment lambdas with ``set``, binder lambdas with ``bind``, and\n deletion lambdas with ``delete``.\n\n* Errors are reported through ``AlakazamError`` now.\n\n* Changed ``zip_longest`` and ``cross_product`` argument order to\n better match the ``itertools`` equivalents.\n\n* Static methods on the ``Alakazam`` class can now be called globally.\n\n* Function ``of_dict`` provided to load dictionaries into Alakazam as\n lists of key-value 2-tuples.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/Mercerenies/alakazam/archive/0.6.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Mercerenies/alakazam", "keywords": "functional,sugar,syntax,lambda,stream,alakazam", "license": "BSD3", "maintainer": "", "maintainer_email": "", "name": "alakazam", "package_url": "https://pypi.org/project/alakazam/", "platform": "", "project_url": "https://pypi.org/project/alakazam/", "project_urls": { "Download": "https://github.com/Mercerenies/alakazam/archive/0.6.0.tar.gz", "Homepage": "https://github.com/Mercerenies/alakazam" }, "release_url": "https://pypi.org/project/alakazam/0.6.0/", "requires_dist": null, "requires_python": "", "summary": "Functional programming sugar for Python", "version": "0.6.0" }, "last_serial": 3618986, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "78bd5d4cff6d4a5129817ae92ded401b", "sha256": "909e17590f57277b57e904bb1cdcb8aee3822a479bd4d70aca861ffa3d3ac54d" }, "downloads": -1, "filename": "alakazam-0.1.0.tar.gz", "has_sig": false, "md5_digest": "78bd5d4cff6d4a5129817ae92ded401b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7960, "upload_time": "2017-07-30T23:08:10", "url": "https://files.pythonhosted.org/packages/c6/07/2fcfbdabcf075d81321d75c0239035b0d9a10e81d3ac1a41d7d382bd4723/alakazam-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0543a4f3a68604137c0bf16a210cc5c5", "sha256": "29b13d2c9790cb3db7d85109b07fc1019256a80fe612168a1a619f05cc4d86be" }, "downloads": -1, "filename": "alakazam-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0543a4f3a68604137c0bf16a210cc5c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7989, "upload_time": "2017-07-30T23:10:50", "url": "https://files.pythonhosted.org/packages/5c/c0/b2931dbf35368b204a19f891edb118bde27d05ca185a890a84bfdccad189/alakazam-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "608678eddc5ed1cec877ba680ad97888", "sha256": "d73a5d2be5c85e9e7e7a2e893f8faf1171003a26be0c2114a635d4db883271a4" }, "downloads": -1, "filename": "alakazam-0.1.2.tar.gz", "has_sig": false, "md5_digest": "608678eddc5ed1cec877ba680ad97888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7964, "upload_time": "2017-07-30T23:14:19", "url": "https://files.pythonhosted.org/packages/32/62/9347d74379dd57b475224709bc1ef43eafe609992aba7d4b76e009b1c0f2/alakazam-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6688c78c3c7ce31ba023916846bc71bd", "sha256": "194e1156040c7408d4697a3a442bad749d39bbf1bd83568d5fef92e62e7d479e" }, "downloads": -1, "filename": "alakazam-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6688c78c3c7ce31ba023916846bc71bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8370, "upload_time": "2017-07-30T23:28:00", "url": "https://files.pythonhosted.org/packages/ce/71/ed775ffa1c39c90e6de18a3f5bbac1c7aed9924c28ee9053e4a5e7ee3434/alakazam-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "353352cb270b16e73dae49016910125e", "sha256": "b46f589f7b6b8884d456c56946ae68006a5e8ef5b4645f4fc0ba1052cf925b4a" }, "downloads": -1, "filename": "alakazam-0.2.0.tar.gz", "has_sig": false, "md5_digest": "353352cb270b16e73dae49016910125e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10574, "upload_time": "2017-08-06T01:16:00", "url": "https://files.pythonhosted.org/packages/20/3b/604202b7481d55b1497fbea565797b72f7fbea2372722647699122cbc5a4/alakazam-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "43edea3076c16b1fc92c32da15f517ad", "sha256": "df61b20a51ac2f4600311eb376fcd25fcc91a969533f7bd84284f957a4f087be" }, "downloads": -1, "filename": "alakazam-0.2.1.tar.gz", "has_sig": false, "md5_digest": "43edea3076c16b1fc92c32da15f517ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10559, "upload_time": "2017-08-14T21:05:36", "url": "https://files.pythonhosted.org/packages/ae/62/13bcee62cc1c6c8a2da2dab7cd4dc1f3fdabc154abc4e5829bc2067d813e/alakazam-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "73c0185b51b41ccb2b18f97e1f01f14f", "sha256": "963d40dff391aba27a31dd5caf2924dc773a561dcb16a8818acd9bb502e7640b" }, "downloads": -1, "filename": "alakazam-0.2.2.tar.gz", "has_sig": false, "md5_digest": "73c0185b51b41ccb2b18f97e1f01f14f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10560, "upload_time": "2017-08-14T21:09:14", "url": "https://files.pythonhosted.org/packages/53/04/bb384c352359c587fc0ccf64bc42a5d1a79646738daa8b335dfbc419cc3e/alakazam-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "2b072c76756f080ab32bd90d75e6dbe2", "sha256": "b39c4718aa60f0a13584241a8b3141c03b241d32bf95c260c4c8ab64b2670e64" }, "downloads": -1, "filename": "alakazam-0.2.3.tar.gz", "has_sig": false, "md5_digest": "2b072c76756f080ab32bd90d75e6dbe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10584, "upload_time": "2017-08-15T02:13:14", "url": "https://files.pythonhosted.org/packages/ef/1d/54b3f425b10009953053966512bf093ee18d06604433b9c39abfc7054836/alakazam-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "91063a954039a97d0750f096e5fbe6a2", "sha256": "743c6a7369e0151a84d83fbdacd426cfade5e9739c17cd94cdb2a92dd80d4056" }, "downloads": -1, "filename": "alakazam-0.3.0.tar.gz", "has_sig": false, "md5_digest": "91063a954039a97d0750f096e5fbe6a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11592, "upload_time": "2017-11-05T01:49:13", "url": "https://files.pythonhosted.org/packages/26/e8/e6750c622281bfc6c5197012a775741466d9ef340128be858f262398b709/alakazam-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "3d294a8fbc9cbab41a0c61facd605ade", "sha256": "cd6bb47f3b063c7b67c92b94dce0073f176704d63f76a7d234c3315642881a41" }, "downloads": -1, "filename": "alakazam-0.4.0.tar.gz", "has_sig": false, "md5_digest": "3d294a8fbc9cbab41a0c61facd605ade", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12382, "upload_time": "2018-01-19T21:55:15", "url": "https://files.pythonhosted.org/packages/83/ae/db688bd85364d87a6af2eff89f4efe2e9be494c98222340697a8c01b4db0/alakazam-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "73a02a9627b651e885f5b095f4a3741a", "sha256": "a9740cd248c66906d759c65f3be1ebe4344d9b2e23edbfc19c36eb6e64cc0fba" }, "downloads": -1, "filename": "alakazam-0.4.1.tar.gz", "has_sig": false, "md5_digest": "73a02a9627b651e885f5b095f4a3741a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12354, "upload_time": "2018-01-19T22:01:48", "url": "https://files.pythonhosted.org/packages/1c/0b/7892257f34f2a52503259cfac324cc7a261436f84b82f1b9ee1a0c67b721/alakazam-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "563ab20e86263cb0f5f895a0b4f9638e", "sha256": "a2b8864dbceed437dea5b8d09b39f15ad4eca114b6cc47d1c972c71971a8e5ab" }, "downloads": -1, "filename": "alakazam-0.5.0.tar.gz", "has_sig": false, "md5_digest": "563ab20e86263cb0f5f895a0b4f9638e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16955, "upload_time": "2018-01-20T05:11:07", "url": "https://files.pythonhosted.org/packages/00/64/da3d6b0e20d6cc2d49bc75f859dcaf19e0e93fb9bcd97c03f58c60641f44/alakazam-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "f04cf595ee125d5b19b4256f70a799cd", "sha256": "21bf94838c0bafee126df9bfececa691c13f60d7827bc6907851f3ec26a19bf2" }, "downloads": -1, "filename": "alakazam-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f04cf595ee125d5b19b4256f70a799cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17622, "upload_time": "2018-02-26T22:37:16", "url": "https://files.pythonhosted.org/packages/99/bd/258f7af9a6b24f776f520c0038bfda7f706288f143aa3e0048fa24c8533a/alakazam-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f04cf595ee125d5b19b4256f70a799cd", "sha256": "21bf94838c0bafee126df9bfececa691c13f60d7827bc6907851f3ec26a19bf2" }, "downloads": -1, "filename": "alakazam-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f04cf595ee125d5b19b4256f70a799cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17622, "upload_time": "2018-02-26T22:37:16", "url": "https://files.pythonhosted.org/packages/99/bd/258f7af9a6b24f776f520c0038bfda7f706288f143aa3e0048fa24c8533a/alakazam-0.6.0.tar.gz" } ] }