{ "info": { "author": "Olivier Breuleux", "author_email": "breuleux@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "\nBuche\n=====\n\nHelper package to pretty-print and interact with Python objects using the Buche_ logger.\n\nThe package includes a repl and a debugger.\n\nRequires Python >= 3.6\n\n\nUsage\n-----\n\nYou must install Buche_ first, either from the release_ or through npm (``npm install -g buche``). This package helps interact with Buche, but it is not the application itself. Once you have written your script, use it as follows:\n\n.. code:: bash\n\n python -m buche yourscript.py\n\nAlternatively, using ``buche`` directly:\n\n.. code:: bash\n\n buche python -u yourscript.py\n\n.. _Buche: https://github.com/breuleux/buche\n.. _release: https://github.com/breuleux/buche/releases\n\n\n\nDisplay\n-------\n\nHere's an example of what you can do with Buche. You can run this code using `buche python3 examples/demo.py`.\n\n.. code:: python\n\n from buche import buche, H\n\n # You don't have to set a template, but if you do, it must be the\n # very first command you emit, before any printing.\n # You can also give `src=` instead of `content=...`\n buche.command_template(content=H.div['my-template'](address=\"/\"))\n\n # Use this command to add styles, stylesheets, scripts, etc.\n buche.command_resource(content=H.style(\n \"\"\"\n .my-template {\n background-color: #eee;\n padding: 5px;\n display: flex;\n flex-direction: column;\n align-items: start;\n }\n \"\"\"\n ))\n\n # Display simple HTML\n buche.html.h3('Welcome!')\n\n # Display objects\n buche(1234)\n buche([x * x for x in range(100)])\n buche.dict(avocado=\"green\", banana=\"yellow\", cherry=\"red\")\n\n # Open automatically creates an address for an element\n div1 = buche.open.div(style=\"border: 3px solid red\")\n\n # You can also set an address explicitly\n buche.html.div(address='/two', style=\"border: 3px solid blue\")\n\n # Get a printer for the given address\n div2 = buche['/two']\n\n # These objects will go in the divs\n div1('One')\n div2('Two')\n div1('One again')\n\n # Handy tabs component\n grocery_list = buche.open.boxTabs()\n fruit = grocery_list.open.tabEntry(\n label='Fruits',\n active=True,\n )\n vegetable = grocery_list.open.tabEntry(\n label='Veggies',\n )\n\n fruit.html.div(H.s(\"Pineapple\"))\n fruit.html.div(\"Raspberry\")\n fruit.html.div(\"Grape\")\n\n vegetable.html.div(\"Carrot\")\n vegetable.html.div(\"Potato\")\n vegetable.html.div(\"Yam\")\n\n # Customize the representation of a class\n class Color:\n def __init__(self, r, g, b):\n self.r = r\n self.g = g\n self.b = b\n\n def __hrepr__(self, H, hrepr):\n sz = hrepr.config.swatch_size or 20\n return H.div(\n style=f'display:inline-block;width:{sz}px;height:{sz}px;margin:2px;'\n f'background-color:rgb({self.r},{self.g},{self.b});'\n )\n\n # This will call __hrepr__\n buche(Color(255, 0, 0))\n\n # Configuration values can be anything and are propagated recursively\n buche(Color(0, 0, 255), swatch_size=50)\n\n # You can evaluate JavaScript on elements\n button = buche.open.button(\"Tickle me\")\n button.command_eval(expression=\"this.onclick = () => alert('Hihihihi!')\")\n\n\nRepl\n----\n\nYou can start an interactive evaluator very easily:\n\n.. code:: python\n\n # repl.py\n from buche import repl\n repl.start()\n\nRun ``buche python3 repl.py`` and you will get an empty window and an input box at the bottom. You can evaluate Python expressions in the input box and get very pretty output, and you can also click on the representations of the objects in order to put them in temporary variables.\n\nNote: ``start`` is non-blocking. For a blocking version you can do this:\n\n.. code:: python\n\n from buche import repl\n repl.start(synchronous=True)\n repl.query() # Processes a single command, blocking\n\n\nDebugger\n--------\n\nBy setting the environment variable ``PYTHONBREAKPOINT`` to ``buche.breakpoint``, calls to the builtin ``breakpoint()`` will use Buche's repl for debugging. You can use it essentially the same way as ``pdb``, but you get pretty HTML printing.\n\n.. code:: bash\n\n PYTHONBREAKPOINT=buche.breakpoint buche python3 mycode.py\n\nThis variable is automatically set when you run a script with ``python -m buche``.\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/breuleux/buche", "keywords": "buche repr pprint html development", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "buche", "package_url": "https://pypi.org/project/buche/", "platform": "", "project_url": "https://pypi.org/project/buche/", "project_urls": { "Homepage": "https://github.com/breuleux/buche" }, "release_url": "https://pypi.org/project/buche/0.2.0/", "requires_dist": [ "hrepr" ], "requires_python": ">=3.6", "summary": "Pretty-print Python objects to Buche logger.", "version": "0.2.0" }, "last_serial": 5041123, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4579f377cd8d1de711bb3c09c5418544", "sha256": "7ca75ad93e931f6d323a2505437819242a3774b3a39ac1b7c778dac4bb8103ac" }, "downloads": -1, "filename": "buche-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4579f377cd8d1de711bb3c09c5418544", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8283, "upload_time": "2017-09-20T18:33:48", "url": "https://files.pythonhosted.org/packages/8a/03/e3145f816a5a21b4d7735b0475ed12158c245fbc3a60e811a4a514105c44/buche-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b56fe0ad6fec254ff20713c236451cc6", "sha256": "c00a9275c96efcae1ccc297552e051890f54f6f5e2cbf30660b0abeab4204e43" }, "downloads": -1, "filename": "buche-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b56fe0ad6fec254ff20713c236451cc6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6240, "upload_time": "2017-09-20T18:33:51", "url": "https://files.pythonhosted.org/packages/84/bf/f44dbf9f20bb8d3a6fea7d13f1d7a2ab67eab21a382344dc7476ed3ebf8d/buche-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5ddf27a907d2e478ed1ccbdccd4bbd53", "sha256": "d7b514aa04808af9ebdfea5c824e56e7047857745879be1ef979b47478732926" }, "downloads": -1, "filename": "buche-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5ddf27a907d2e478ed1ccbdccd4bbd53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8335, "upload_time": "2017-09-20T18:56:13", "url": "https://files.pythonhosted.org/packages/b7/14/30370b0b2380a34526b006db5b7b9ac846a30656dcfd40433749a6312339/buche-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c5592d1389ce2d5699ab5f15c285a99", "sha256": "4262149b53e278315bcaf297859fa7a0a191ed78b8074eb7dadc8736e20a2cf5" }, "downloads": -1, "filename": "buche-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0c5592d1389ce2d5699ab5f15c285a99", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6280, "upload_time": "2017-09-20T18:56:15", "url": "https://files.pythonhosted.org/packages/91/0a/025accd38d8313d1fadd672c7158071d8e9e315c7bc821e81ab7d7d2e0dd/buche-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a83c72a068db815c14681803537f7af8", "sha256": "5f3ce00ab91360c416a14b57c15ee251687820ea11364365689e3dd8178d3bf3" }, "downloads": -1, "filename": "buche-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a83c72a068db815c14681803537f7af8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8333, "upload_time": "2017-09-25T21:38:43", "url": "https://files.pythonhosted.org/packages/5c/fa/8ad97b52de85b2a2fab042502f48580fc246c6e3eb5bd0f5e7ed03e70810/buche-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "653bc738d6a034d14651977993800910", "sha256": "a01f0c00f5ac707064ca4e50ebe517245c8b5e68fce71a6103f60f543d4a99d5" }, "downloads": -1, "filename": "buche-0.1.2.tar.gz", "has_sig": false, "md5_digest": "653bc738d6a034d14651977993800910", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6281, "upload_time": "2017-09-25T21:38:44", "url": "https://files.pythonhosted.org/packages/07/09/6fa6f9169c0431681940f2b58d6f5e48859a2796dd155b1fb4a4cf8c384b/buche-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "705726fd9632ab3e9fa963e496524a80", "sha256": "579f4c439a8e51df03c263a607eb6bb217ef503a2020c75619062db0ce2229d5" }, "downloads": -1, "filename": "buche-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "705726fd9632ab3e9fa963e496524a80", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9629, "upload_time": "2017-11-14T23:08:59", "url": "https://files.pythonhosted.org/packages/c6/72/451818ff2355478c5bde32969aeb0a18f86c1e5a517c7c416717afe2a82d/buche-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2dc64d0eefdf38133f30d9a04670338", "sha256": "20a991c01a5cdbf0f16e72315d1ba8f2f347e0d35f98a0f23772bfd3f5d323c4" }, "downloads": -1, "filename": "buche-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c2dc64d0eefdf38133f30d9a04670338", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7312, "upload_time": "2017-11-14T23:09:01", "url": "https://files.pythonhosted.org/packages/ce/5e/df5d6fcc4327687f2b8f654384b0ba3899bec0190463a26dd9592f5dd250/buche-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8115209d99550485ad5cd8056f838d0c", "sha256": "52562a9589e80d623f69eb0573c8a533ac2edd149e9ae5b89367c4cff5de0e79" }, "downloads": -1, "filename": "buche-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "8115209d99550485ad5cd8056f838d0c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9694, "upload_time": "2017-11-17T19:45:06", "url": "https://files.pythonhosted.org/packages/17/1e/9ff6694dd8c5deee3a6f8f42f48c98bb939c5c6cb5e4a8dca841a9b53a97/buche-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed43f3d7bc3f9e2288eabf719808fad4", "sha256": "c289e4b16e3d73e9b48bb0412fd1e6f99c1dd98f885c0825ae673d029d3e234f" }, "downloads": -1, "filename": "buche-0.1.4.tar.gz", "has_sig": false, "md5_digest": "ed43f3d7bc3f9e2288eabf719808fad4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7372, "upload_time": "2017-11-17T19:45:07", "url": "https://files.pythonhosted.org/packages/b1/3e/4e4884aa712520a33e2e47818a8615e2020f2405f52585b0606b3c21e1e9/buche-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "2a156731e6b10b5c02eaf9177ca9d384", "sha256": "8196c6ade28906c88b9b77c079b1ba298101b88ba9f308318f0f44c0a8f1a251" }, "downloads": -1, "filename": "buche-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "2a156731e6b10b5c02eaf9177ca9d384", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9801, "upload_time": "2018-01-12T21:44:29", "url": "https://files.pythonhosted.org/packages/fb/ce/b081a190f3a01dabcd586d5441d61d09affaaab67daab00fb968c53ebd2f/buche-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ab7eb15a756acbd6c5caa7de3747c967", "sha256": "5663ce64dcb828252354b51c39dfceab09ac0114607b9bcc76932506c3bec015" }, "downloads": -1, "filename": "buche-0.1.5.tar.gz", "has_sig": false, "md5_digest": "ab7eb15a756acbd6c5caa7de3747c967", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7821, "upload_time": "2018-01-12T21:44:29", "url": "https://files.pythonhosted.org/packages/07/92/87c0bf511ebd79c09f032d45c4aa0ce9f6bd9595c01301bbd902e9bcc33d/buche-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "0d43b7a5d94c8c5d433a4b985f6a280d", "sha256": "fa98e7dfc9a54dabfe444bfaa1aa9d1997bbc98fc90bb665a5b764d3fa5055d3" }, "downloads": -1, "filename": "buche-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "0d43b7a5d94c8c5d433a4b985f6a280d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9818, "upload_time": "2018-01-25T20:17:01", "url": "https://files.pythonhosted.org/packages/b0/c1/b9b7b2aec462584492fc0c3951625053e23ba14a4c548b61a78e937e345c/buche-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffc46ea1d1f7521a99487d4217484445", "sha256": "c0b1c7b1fcd267fa62347ae3c41a76b81aad0f7904818142d8fb1b4ab9466b21" }, "downloads": -1, "filename": "buche-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ffc46ea1d1f7521a99487d4217484445", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7841, "upload_time": "2018-01-25T20:17:03", "url": "https://files.pythonhosted.org/packages/0b/ea/90544ba91514b4f877c362315de99ce3b588aaf0991e3e819362fc5f8397/buche-0.1.6.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3cdd3b3f707b8c016fd83450f99a9175", "sha256": "ea963eb89cbe96545fe3a033e7bb97cfe7ffe169a56c3e3def7baf52bbe5eb0c" }, "downloads": -1, "filename": "buche-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3cdd3b3f707b8c016fd83450f99a9175", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 15688, "upload_time": "2019-04-01T21:43:55", "url": "https://files.pythonhosted.org/packages/91/e7/4c27ed4b02b6903100438b008f70cbf46766da73a5e76a1c6e470a60f919/buche-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94c116971a6698ecb463915e60a69f4a", "sha256": "3c63ba6c885b6fd4e15103dd5bed660443e7efdaeb92ad43a1e0657a4e5c1a65" }, "downloads": -1, "filename": "buche-0.2.0.tar.gz", "has_sig": false, "md5_digest": "94c116971a6698ecb463915e60a69f4a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16118, "upload_time": "2019-04-01T21:43:56", "url": "https://files.pythonhosted.org/packages/28/36/8d98a5b7dafbceb8f1c62001ec8e1ec1c4f8709996e341f26406a2b90ce3/buche-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cdd3b3f707b8c016fd83450f99a9175", "sha256": "ea963eb89cbe96545fe3a033e7bb97cfe7ffe169a56c3e3def7baf52bbe5eb0c" }, "downloads": -1, "filename": "buche-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3cdd3b3f707b8c016fd83450f99a9175", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 15688, "upload_time": "2019-04-01T21:43:55", "url": "https://files.pythonhosted.org/packages/91/e7/4c27ed4b02b6903100438b008f70cbf46766da73a5e76a1c6e470a60f919/buche-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94c116971a6698ecb463915e60a69f4a", "sha256": "3c63ba6c885b6fd4e15103dd5bed660443e7efdaeb92ad43a1e0657a4e5c1a65" }, "downloads": -1, "filename": "buche-0.2.0.tar.gz", "has_sig": false, "md5_digest": "94c116971a6698ecb463915e60a69f4a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16118, "upload_time": "2019-04-01T21:43:56", "url": "https://files.pythonhosted.org/packages/28/36/8d98a5b7dafbceb8f1c62001ec8e1ec1c4f8709996e341f26406a2b90ce3/buche-0.2.0.tar.gz" } ] }