{ "info": { "author": "Thautwarm", "author_email": "twshere@outlook.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython" ], "description": "\nAdditional Grammar Compatible to CPython \n==========================================\n\n\nHow to Get Flowpython\n-----------------------\n\n- Intsall \n\n.. code:: shell\n \n pip install flowpython\n\n\n- Enable/Disable Flowpython grammar\n\n.. code:: shell\n\n python -m flowpython -m enable/disable\n\n\nVERSION\n----------\nflowpython == 0.2.3\n\nCPython == 3.6.x/3.5.x\n\n\nRequirement\n------------\nCPython == 3.6.x/3.5.x\n\nC/C++ Compiler \n\n- My version was built on clang-3.8.1/GCC-6.3.0 on linux-deepin\n\n\nGrammar\n------------\n\n**with quite few new additional keywords here**\n\n* **Where Syntax**\n\n .. code:: python\n\n (test) where:\n statements\n ...\n # \"test\" is the top one of expressions in Python Grammar.\n\n- Take a look at here:\n the **where** blocks would be **executed before the expression at the head**, \n but it should be **located at the end**.\n- Q :Why did I bring \"where\" syntax into Python?\n- A :For **combining the expressions and statements** in Python and enhanced the readability of procedure. \n\n- See the following codes:\n\n .. code:: python\n\n # \u5706\u67f1\u9762\u79ef / surface area of a cylinder \n from math import pi\n r = 1 # the radius\n h = 10 # the height\n\n S = (2*S_top + S_side) where:\n S_top = pi*r**2\n S_side = C * h where:\n C = 2*pi*r\n\n- And where syntax makes it possible for **Lambda** in Python to do everything that **def** can do.\n\n .. code:: python\n\n # multi-row lambda in python\n \n lambda x: someFunc(x) where:\n def someFunc(var):\n pass\n \n lambda x: ret where:\n def someFunc(var):\n ...\n ret = someFunc(x)\n \nHowever, in Flowpython, there are some other way more interesting supplied to define a \"lambda\" than \"lambda x: f(x)\" :\n\n* **Lambda Syntax**\n\n .. code:: python\n\n # Lambda\n\n lambda x,y,z : lambda a,b,c : x*a + y*b + z*c\n # which equals to \n .x,y,z -> .a,b,c -> x*a + y*b + z*c\n # which equals to \n as-with x,y,z def as a,b,c def x*a + y*b + z*c\n\n #look at this example:\n \n as-with x def as y def as z def x+y+z\n # which equals to \n as-with x def as-with y def as-with z def x+y+z\n\nAnd we know that there are some powerful tools in some FP languages, like \n\n* **Pattern matching**\n\n .. code:: python\n\n condef +[<] 1:\n case a:2 => \n assert a == 1 and a < 2\n +(.x->type(x))\n case a:int =>\n assert a == 1 and type(a) == int\n condef 1:\n +(.x->2*x)\n case a:3 => \n assert a == 1 and a*2 == 3\n +[is not]\n case a:2 =>\n assert a == 1 and a is not 2\n otherwise =>\n ...\n \n # new syntax: matching filter\n condef[] [1,2,3] :\n +(type) \n case (*a,b)->a:list =>\n assert type(a) == list\n otherwise =>\n assert False,\"emmmm\"\n\n\nThere are more optional grammars, just see GitHub `Link `_. \n \nMore about Pattern Matching to see `TestFile `_\nAnd `Distribute History `_\n\nAnother useful tool in Flowpython is **Arrow Transform**, which enhances the readability greatly and makes it possible \nto **Avoid Prolix Parentheses**. \n\n* **Arrow Transform**\n \n .. code:: python\n\n range(100) -> reduce(.x,y->x+y, _) -> print(_) where:\n from functools import reduce\n\n [1,2,3] -> map(.x->x+1, _) -> list(_) -> print(_)\n\nRead `Arrow Transform `_ to get a konwledge of this grammar.\n\n \n \nRevision\n------------\n\nSee `Distribution History `_ here.\n\n\nCompile FlowPython For Yourself\n--------------------------------------\n\n**For Windows User**\n - You'd better use Visual Studio to make the Python project, and it must be the easiest thing in the world, I think.\n \n - I have tried with **Cygwin** but finally failed. \n\n**For Linux User**\n\nFirstly, you should have a C/C++ compiler like: \n \n - https://gcc.gnu.org/\n \n - http://releases.llvm.org/\n\nTo give some advice, you can easily get C/C++ compiler with \n \n - **MinGW/Cygwin** on **windows** (Failed, please have a try with Visual Studio)\n\n - **sudo apt-get install gcc/clang** on **Ubuntu/Debian/Deepin** (maybe it also works for MacOS).\n\nAnd then you should have a CPython distribution like Python-3.6.2, like:\n \n - https://www.python.org/\n\nAnd then you should replace the files of the standard CPython distribution with Flowpython.\n\nIf you change the variable of **pythonDistPath** in the file **config.py** with the path of your Python distribution, \n\njust run this command:\n\n.. code:: shell\n\n ./conf commit -v try_flowPython\n\nEveryting about Flowpython can be found in the directory \"/flowpy\".\n\nFinally open the CMD/Terminal at the root of CPython distribution,\n\nrun the following commands:\n \n.. code:: shell\n\n ./configure CC=\n make regen-gramamr\n make regen-ast\n make\n ./python\n\nIf you change the variable of **pythonDistPath** in the file **config.py** with the path of your Python distribution, \n\njust run this command:\n\n.. code:: shell\n\n ./conf make -m all\n \nAnd then you can enjoy Flowpython!\n\n\nFor Developers\n---------------\n\nI wrote config.py as the project-manage tool of Flowpython.\n\nIt assembled the following modules:\n - make\n - git\n - customer version controler \n - debug&unittest\n\nIt can be used like these way:\n\n.. code:: shell\n\n ./conf commit -v \n ./conf recover \n ./conf test \n ./conf make -m clean\n ./conf make -m ast\n ...\n\nIt seems to be kind of complicated but it's quite easy to understand and operate in fact.\n\n\n\n\n\n\n\n\n\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thautwarm/flowpython", "keywords": "gramamr", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "flowpython", "package_url": "https://pypi.org/project/flowpython/", "platform": "windows", "project_url": "https://pypi.org/project/flowpython/", "project_urls": { "Homepage": "https://github.com/thautwarm/flowpython" }, "release_url": "https://pypi.org/project/flowpython/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "Additional Grammar Compatible to CPython", "version": "0.2.3" }, "last_serial": 3132574, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "faefaeec1025e6f93aebcb7b29a11b79", "sha256": "db1196d730a08cf267affd68c3a3876f25f9fd4590b46577f3e9f54e495f17ea" }, "downloads": -1, "filename": "flowpython-0.1.tar.gz", "has_sig": false, "md5_digest": "faefaeec1025e6f93aebcb7b29a11b79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7614852, "upload_time": "2017-08-12T14:44:53", "url": "https://files.pythonhosted.org/packages/78/3f/55d94f6c40dfc11a67045e440d4c16f175fd945c75f3d6c21ca84a4b11ef/flowpython-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ba735ef9715fc167ddd48a5382907958", "sha256": "d487da50e4fc6f0b56e61795402bd72020d7105cf9d4fc1300e7de301839e17b" }, "downloads": -1, "filename": "flowpython-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ba735ef9715fc167ddd48a5382907958", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7614658, "upload_time": "2017-08-12T15:13:21", "url": "https://files.pythonhosted.org/packages/c2/d4/da83266b2fe5b319c0c2a9cc5e0fc378fc12d8ab6c546b12414569287254/flowpython-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e5fbf9c5b8356f0b2eec5926de976ae9", "sha256": "cf84bb02f55165256bf941deda89b73646712f086176cd9d47fdd61fccede825" }, "downloads": -1, "filename": "flowpython-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e5fbf9c5b8356f0b2eec5926de976ae9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7615013, "upload_time": "2017-08-13T02:58:46", "url": "https://files.pythonhosted.org/packages/83/6e/cb0e1176e096158dfb0144dfb857d2bd4457ac4c7cd04affe0c2db0cb6a1/flowpython-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "0b3bb2eac12ac21f53003c0a37edaa12", "sha256": "0f82fd2f940c0906a516a5a12e7a89f5ef81b75ea754baac2c35ff4438bb5ee4" }, "downloads": -1, "filename": "flowpython-0.2.tar.gz", "has_sig": false, "md5_digest": "0b3bb2eac12ac21f53003c0a37edaa12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7616916, "upload_time": "2017-08-13T08:36:19", "url": "https://files.pythonhosted.org/packages/1a/95/519ad2464f8fecb60748d7fe88f1f335dc1648a45d5d605b2b32cd44e13e/flowpython-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ba522b243755ea61568a2d8f5d3cd83a", "sha256": "8188349e74b8a81ec927d13486177338cd07d2d632f3c6996aeef27a1516f984" }, "downloads": -1, "filename": "flowpython-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ba522b243755ea61568a2d8f5d3cd83a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7622401, "upload_time": "2017-08-18T18:01:58", "url": "https://files.pythonhosted.org/packages/3e/8b/e4eab7212fa64cad8b90e8247f6b1f4af6807af97f13861f46c3d6b28f56/flowpython-0.2.1.tar.gz" } ], "0.2.1.1": [ { "comment_text": "", "digests": { "md5": "97a4e4e807226692bfa36b37f066995b", "sha256": "4168711d9482d18225af7fc49918ade054a9e6fb3fb1c2ee4616d7a4ca48ff77" }, "downloads": -1, "filename": "flowpython-0.2.1.1.tar.gz", "has_sig": false, "md5_digest": "97a4e4e807226692bfa36b37f066995b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8029269, "upload_time": "2017-08-18T20:06:27", "url": "https://files.pythonhosted.org/packages/9f/d2/d05f8fabd2e8aa3a2303f75451bd7fcf4da2f0f7a676fd0490de16c19eab/flowpython-0.2.1.1.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "140c0f61f39adee08cb0b7c9efdb5e98", "sha256": "dcfc1da12199dd10c67ec48858b008434d788fa6310fe2b4ba423831cada7dc3" }, "downloads": -1, "filename": "flowpython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "140c0f61f39adee08cb0b7c9efdb5e98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11839721, "upload_time": "2017-08-29T17:02:28", "url": "https://files.pythonhosted.org/packages/7f/63/f62b7c96a35197481ff864365f8a64e9146600ee2390caed13e2c43e23b0/flowpython-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "140c0f61f39adee08cb0b7c9efdb5e98", "sha256": "dcfc1da12199dd10c67ec48858b008434d788fa6310fe2b4ba423831cada7dc3" }, "downloads": -1, "filename": "flowpython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "140c0f61f39adee08cb0b7c9efdb5e98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11839721, "upload_time": "2017-08-29T17:02:28", "url": "https://files.pythonhosted.org/packages/7f/63/f62b7c96a35197481ff864365f8a64e9146600ee2390caed13e2c43e23b0/flowpython-0.2.3.tar.gz" } ] }