{ "info": { "author": "deathbeds", "author_email": "tony.fast@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: IPython", "Framework :: Jupyter", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "\n# `composites` compose complex functions\n\n`composites` are untyped functional programming objects in Python _with all the side effects_. `composites` make it easier to compose/pipeline/chain callables, classes, and other objects into higher-order functions.\n\n pip install git+https://github.com/tonyfast/composites\n\n# compose functions with `a`, `an`, `the`, or `\u03bb`\n\n\n from composites import *; assert a is an is the\n\nA basic example, __enumerate__ a __range__ and create a __dict__ionary.\n\n f = the[range][reversed][enumerate][dict]\n f(3), f\n---\n\n\n\n\n\n ({0: 2, 1: 1, 2: 0}, )\n\n\n\n\nEach [bracket] may accept a __callable__ or __iterable__. In either case,\na __callable__ is appended to the composition. Compositions are immutable and may have\narbitrary complexity.\n\n g = f.copy() # copy f from above so it remains unchanged.\n g[type, len]\n g[{'foo': a.do(print).len(), 'bar': the.identity()}]\n\n\n\n\n\n \n\n\n\n\nBrackets juxtapose iterable objects.\n\n the[range, type], the[[range, type]], the[{range, type}], the[{'x': range, 'y': type}]\n\n\n\n\n\n (,\n ,\n ,\n )\n\n\n\n\nEach each composition is immutable.\n\n assert f[len] is f; f\n\n\n\n\n\n \n\n\n\n\n# compose functions with attributes\n\nEach composition has an extensible attribution system. Attributes can be accessed in a shallow or verbose way.\n\n a.range() == a.builtins.range() == a[range]\n\n\n\n\n\n False\n\n\n\n\n# compose functions with symbols\n\n assert a / range == a.map(range)\n assert a // range == a.filter(range)\n assert a @ range == a.groupby(range)\n assert a % range == a.reduce(range)\n\n\n#### combine item getters, attributes, symbols, and other compositions to express complex ideas.\n\n f = a['test', 5, {42}] \\\n / (a**str&[str.upper, str.capitalize]|a**int&a.range().map(\n a.range(2).len()\n ).list()|a**object&type) \\\n * list\n f()\n\n\n#### use compositions recursively\n\n f = a[:]\n f[a**a.gt(5)*range | a**a.le(5)*a.add(1)[f]](4)\n\n\n\n\n\n False\n\n\n\n\n# Why functional programming with `composites`?\n\n[Functional programming](https://en.wikipedia.org/wiki/Functional_programming) _often_ generates less code, or text, to express operations on complex data structures. A declarative, functional style of programming approach belies Python's imperative, object-oriented (OO) \nnature. Python provides key [functional programming elements](https://docs.python.org/3/library/functional.html) that are used interchangeably with OO code. \n\n[`toolz`](https://toolz.readthedocs.io), the nucleus for `composites`, extends Python's functional programming with a set of \nun-typed, lazy, pure, and composable functions. The functions in `toolz` look familiar \nto [__pandas.DataFrame__](https://tomaugspurger.github.io/method-chaining.html) methods, or [__underscorejs__](http://underscorejs.org/) and [__d3js__](https://d3js.org/) in Javascript.\n\nAn intermediate user of [`toolz`](https://toolz.readthedocs.io) will use \n[`toolz.pipe`](https://toolz.readthedocs.ioen/latest/api.html#toolz.functoolz.pipe),\n[`toolz.juxt`](https://toolz.readthedocs.ioen/latest/api.html#toolz.functoolz.juxt), \nand [`toolz.compose`](https://toolz.readthedocs.ioen/latest/api.html#toolz.functoolz.compose) to create reusable, \nhigher-order functions. These patterns allow the programmer to express complex concepts \nwith less typing/text over a longer time. Repetitive patterns should occupy \nless screen space; `composites;` helps compose functions with less text. \n\nA successful implementation of __composites__ should compose __un-typed__, __lazy__, and __serializable__ Python functions that allow\nrecursion.\n\n\n\n# Syntax\n\nA core property of `composites` is that it will not modify Python's abstract syntax tree, rather it expresses \na large portion of Python's magic methods in the [data model](https://docs.python.org/3/reference/datamodel.html). It considers Python's \n[order of operations](https://docs.python.org/3/reference/expressions.html#operator-precedence) in the api design. `composites` provides symbolic expressions for common higher-order \nfunction operations like `map`, `filter`, `groupby`, and `reduce`. The attributes can access any of the `sys.modules;` with tab completion.\n\nThe efficiency of computing will continue to improve. In modern collaborative development environments \nwe must consider the efficiency of the programmer. Programming is a repetitive process requiring physical work from a person. \n__composites__ speed up the creation and reading repetitive and complex tasks.\n\n\n## `composites` structure\n\n![](classes_composites.min.png)\n\n\n# Development\n if __name__== '__main__':\n !jupyter nbconvert --to markdown --TemplateExporter.exclude_input=True readme.ipynb\n !jupyter nbconvert --to markdown --execute composites.ipynb\n !python -m doctest composites.py\n !echo complete\n\n\n [NbConvertApp] Converting notebook readme.ipynb to markdown\n [NbConvertApp] Writing 5152 bytes to readme.md\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/deathbeds/importnb", "keywords": "", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "poser", "package_url": "https://pypi.org/project/poser/", "platform": "", "project_url": "https://pypi.org/project/poser/", "project_urls": { "Homepage": "https://github.com/deathbeds/importnb" }, "release_url": "https://pypi.org/project/poser/0.1.2/", "requires_dist": [ "dataclasses", "toolz", "requests", "joblib" ], "requires_python": ">=3.6", "summary": "Dysfunctional programming in Python with all the side effects.", "version": "0.1.2" }, "last_serial": 3800536, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "134be7b3c522c62516560240ac99ba0a", "sha256": "23455705b99db23da138d85de266f4a4c1812899e970cca48d73ab9b9dbbaef5" }, "downloads": -1, "filename": "poser-0.0.2.tar.gz", "has_sig": false, "md5_digest": "134be7b3c522c62516560240ac99ba0a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13095, "upload_time": "2018-04-23T20:50:13", "url": "https://files.pythonhosted.org/packages/77/67/72d738abcfb98fb2cce1d83944e3d9889d3a6f7e6570169ef1a47318fae5/poser-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "aa7b238f3426671198d3f7ea9cd75c9c", "sha256": "c259b95ebbbdd3b5db6b07cf7a495b72b31adca71a3a007113541ebaa19bf848" }, "downloads": -1, "filename": "poser-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "aa7b238f3426671198d3f7ea9cd75c9c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12695, "upload_time": "2018-04-23T20:53:15", "url": "https://files.pythonhosted.org/packages/41/95/382a73bfb1d04d6767790bf9d59b7f8f51ec4909a05eb4408f0ac170c889/poser-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74401b29004b5086bb3be3ceda017f52", "sha256": "9a54c5030079deb45e2266b35fb0a08995b0e81d98831009687d524ecfcf0eca" }, "downloads": -1, "filename": "poser-0.0.3.tar.gz", "has_sig": false, "md5_digest": "74401b29004b5086bb3be3ceda017f52", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13102, "upload_time": "2018-04-23T20:53:16", "url": "https://files.pythonhosted.org/packages/4e/d6/aa66d59968560105fd650df731b48f3aa2a1aa38c721088e322661a0b527/poser-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "09ee585a9af9266fcfed6a5236c45e67", "sha256": "9cc64580cabf67b8b63730c1e298da98ee334cb933016a53fc34e5d22d5a9444" }, "downloads": -1, "filename": "poser-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "09ee585a9af9266fcfed6a5236c45e67", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 12689, "upload_time": "2018-04-23T21:00:08", "url": "https://files.pythonhosted.org/packages/b4/0c/dd7f290fca120c1c3b5195de66f62b37bec2bdae1aead6a1737aefcf9933/poser-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4564935f14de90905a1c912e257202b3", "sha256": "87f6916e300dee8dc4ee91c06e351c862019e40c5e8aa9747576320af91d1a45" }, "downloads": -1, "filename": "poser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4564935f14de90905a1c912e257202b3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 13094, "upload_time": "2018-04-23T21:00:09", "url": "https://files.pythonhosted.org/packages/cd/ee/56abb17c86899dd5d6f10519f35821fe0d5424d25d1f7cc0ab683acbbe15/poser-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1710728c53b7c05e3fd4683d4a1fcade", "sha256": "eb368a525dc6a5bfd00198703a1620fb033ffb9e827d797590b6d2b86ec1ed1f" }, "downloads": -1, "filename": "poser-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1710728c53b7c05e3fd4683d4a1fcade", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12689, "upload_time": "2018-04-23T21:04:32", "url": "https://files.pythonhosted.org/packages/7b/1f/38db065fcd2b5c9eaa75a44cfa63ad85444f1110d91f1578e8a163dfdf9e/poser-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71d5eed7ec48285d9160d2425038f7e1", "sha256": "53e10e00fb50adf06216dc1aaff963631c7e378b18c86ed04550e0d89d557249" }, "downloads": -1, "filename": "poser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "71d5eed7ec48285d9160d2425038f7e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13088, "upload_time": "2018-04-23T21:04:34", "url": "https://files.pythonhosted.org/packages/cf/51/80f40740653f28f225a6d95106abd5b701d1cd29c9035a84691455fd96bb/poser-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "88fc695c34e209553ab3ae869a42591a", "sha256": "249b800a68632daea8537097b0db39aaf6c9be9d61ebe7c53cd18ddc8f962b08" }, "downloads": -1, "filename": "poser-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "88fc695c34e209553ab3ae869a42591a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12671, "upload_time": "2018-04-23T21:22:27", "url": "https://files.pythonhosted.org/packages/49/10/2d7b1ab41a980e7ea3bcbd1e82ba2b7db718f3918fed03eb0b323972f01b/poser-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "392abad66dc06a0ac77b8c1f7e141e7c", "sha256": "6d685e16a1f3c64d013b1004e3af7f48a28ef7e0f082a24b247229b217d9f0ff" }, "downloads": -1, "filename": "poser-0.1.2.tar.gz", "has_sig": false, "md5_digest": "392abad66dc06a0ac77b8c1f7e141e7c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13074, "upload_time": "2018-04-23T21:22:28", "url": "https://files.pythonhosted.org/packages/9f/0f/2a300b46f60838eeade4852ac073ecfd0d1fb65ffcd558c1de1e0ca6d023/poser-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "88fc695c34e209553ab3ae869a42591a", "sha256": "249b800a68632daea8537097b0db39aaf6c9be9d61ebe7c53cd18ddc8f962b08" }, "downloads": -1, "filename": "poser-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "88fc695c34e209553ab3ae869a42591a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12671, "upload_time": "2018-04-23T21:22:27", "url": "https://files.pythonhosted.org/packages/49/10/2d7b1ab41a980e7ea3bcbd1e82ba2b7db718f3918fed03eb0b323972f01b/poser-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "392abad66dc06a0ac77b8c1f7e141e7c", "sha256": "6d685e16a1f3c64d013b1004e3af7f48a28ef7e0f082a24b247229b217d9f0ff" }, "downloads": -1, "filename": "poser-0.1.2.tar.gz", "has_sig": false, "md5_digest": "392abad66dc06a0ac77b8c1f7e141e7c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13074, "upload_time": "2018-04-23T21:22:28", "url": "https://files.pythonhosted.org/packages/9f/0f/2a300b46f60838eeade4852ac073ecfd0d1fb65ffcd558c1de1e0ca6d023/poser-0.1.2.tar.gz" } ] }