{ "info": { "author": "Matt Luongo", "author_email": "mhluongo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python" ], "description": "jexp\n====\n\n:synopsis: A silly little JS expression builder to let you use native Python to build Javascript expression strings.\n\nThis package only allows the creation of simple (that is, non-assignment) Javascript expressions using an intuitive Python DSL.\n\nLogical Expressions\n===================\n\n >>> from jexp import J\n\n >>> e = J('var_1') & J('var_2')\n\n >>> str(e)\n\n '(var_1&&var_2)'\n\n >>> str(e | 'abc')\n\n '((var_1&&var_2)||\"abc\")'\n\nThe argument to the J class will be output as a str in the resulting JS- so ``J('my_var')`` is a good way to refer to a var, and ``J(5)`` to the number literal 5. If you need an actual string, you can either add the quotes yourself in the J call - ``J('\"my string\"')`` - or otherwise combine the J object with a str, as shown above.\n\nMathematical Expressions\n========================\n\n >>> str(J(5) + 28)\n\n '(5+28)'\n\n >>> str(J('my_var') + 28)\n\n '(my_var+28)'\n\nDivision hasn't been implemented, but other things you expect are there.\n\nComparisons\n===========\n\n >>> e = J(5) <= 6\n\n >>> str(e)\n\n '(5<=6)'\n\n >>> str(e == \"test_string\")\n\n '((5<=6)==\"test_string\")'\n\nAttribute Access\n================\n\n >>> e = J('my_var').attribute\n \n >>> str(e)\n\n 'my_var.attribute'\n\nThis should work for any attribute that doesn't start with an underscore (and some that do).\n\nFunction Calling\n================\n\n >>> e = J('func')('a','b')\n\n >>> str(e)\n\n 'func(\"a\",\"b\")'\n\nYou can also try this with other J objects.\n\n >>> str(J('func')(J('arg1'),J('arg2')))\n\n 'func(arg1,arg2)'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/jexp", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "jexp", "package_url": "https://pypi.org/project/jexp/", "platform": "posix", "project_url": "https://pypi.org/project/jexp/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://packages.python.org/jexp" }, "release_url": "https://pypi.org/project/jexp/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A simple Javascript expression builder written for Python.", "version": "0.1.2" }, "last_serial": 793614, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5fa309c507891277253efd96cc5ad448", "sha256": "91ceffbdb40054373247a890cdf9f2013f2c7e2629e9bc5808e24ccff81d3691" }, "downloads": -1, "filename": "jexp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5fa309c507891277253efd96cc5ad448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3712, "upload_time": "2011-08-13T15:13:12", "url": "https://files.pythonhosted.org/packages/02/53/c4e863b1e8a083b6d7bcf4d46b3456d41478ed6a44b8b5507417e0bddb46/jexp-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "34a6e57dbdd425b54a85ba356a0eac78", "sha256": "13e799f9b74c6aeaa825f99d049db47128274ec20bad9bd5c66dae72f1c779c4" }, "downloads": -1, "filename": "jexp-0.1.1.tar.gz", "has_sig": false, "md5_digest": "34a6e57dbdd425b54a85ba356a0eac78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3755, "upload_time": "2011-09-02T02:03:17", "url": "https://files.pythonhosted.org/packages/55/37/331131b2832830a5ba947613c2b41b822b0f812178cc716f03ae9d878283/jexp-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c6ad2e3f5611bec987e5069a0441c723", "sha256": "980daba6f53013f2af27800e88954b81e841ecda3c85fb9f4fcdc5e2c227f19f" }, "downloads": -1, "filename": "jexp-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c6ad2e3f5611bec987e5069a0441c723", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3772, "upload_time": "2011-09-02T02:13:53", "url": "https://files.pythonhosted.org/packages/37/b5/f424ca5f1f0dffc6a2ccc1a03fb72a308e877af9f886370234a8cebe46d8/jexp-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c6ad2e3f5611bec987e5069a0441c723", "sha256": "980daba6f53013f2af27800e88954b81e841ecda3c85fb9f4fcdc5e2c227f19f" }, "downloads": -1, "filename": "jexp-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c6ad2e3f5611bec987e5069a0441c723", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3772, "upload_time": "2011-09-02T02:13:53", "url": "https://files.pythonhosted.org/packages/37/b5/f424ca5f1f0dffc6a2ccc1a03fb72a308e877af9f886370234a8cebe46d8/jexp-0.1.2.tar.gz" } ] }