{ "info": { "author": "Tianshu Huang", "author_email": "thetianshuhuang@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Print\n\n![Print It!](https://github.com/thetianshuhuang/print/blob/master/print.png)\n\nOverloads Python's ```print``` function to add new and exciting functionality.\n\n## Dependencies\n- Python3 (Python2 does not allow overloading of the print statement)\n- PyFiglet (ASII art, anyone?)\n\n## Installation\nInstall with\n```shell\npip install printtools\n```\n\nFor the latest version, clone this repository and use\n```shell\npython3 setup.py install\n```\n\n## Usage\nFirst, ```import *``` from print to get access to all constants. Then, call the print statement. The first argument is the object to print; all other arguments are treated as modifiers. For example:\n```\n>>> from print import *\n>>> print(\"You can print normally\")\nYou can print normally\n>>> print(12345678)\n12345678\n>>> print(\"or with ASCII art\", SM)\n _ _ _ _ ___ ___ ___ ___ _\n ___ _ _ __ __ _(_) |_| |_ /_\\ / __|/ __|_ _|_ _| __ _ _ _| |_\n/ _ \\ '_| \\ V V / | _| ' \\ / _ \\\\__ \\ (__ | | | | / _` | '_| _|\n\\___/_| \\_/\\_/|_|\\__|_||_| /_/ \\_\\___/\\___|___|___| \\__,_|_| \\__|\n\n>>> print(\"you can combine attributes\", RED, BLUE+BG, BOLD)\nyou can combine attributes\n\n\n\n```\n\n## Logging\n```Print``` comes with built-in logging. Use ```set_log``` to set the desired file, and lines will be appended:\n```python\nfrom print import *\n\nset_log('log.txt')\nprint('asdf') # is appended to log.txt\nprint('Test', SLANT) # is also appended to log.txt as ASCII art\nprint('Red', RED) # ANSI escape sequences not written\n```\n\nTo disable logging, ```set_log``` to None with ```set_log()``` or ```set_log(None)```.\n\n## Dividers\nThe ```div``` module can be used to create nice looking dividers:\n```\n>>> div.div('-')\n----------------------------------------- # stretches all the way across the terminal\n>>> div.div('*', 'Example')\n** Example ******************************\n>>> div.div('= =', 'Example')\n=========================================\n\n Example\n\n=========================================\n```\nPatterns include:\n- single character: repeats that character across the screen. If a message is provided, two characters are displayed, followed by a space, the message, a space, then characters occupying the remainder of the screen\n- character repeated, with spaces in between: draws two horizontal lines across the screens with that character; in between the two lines, the label text is drawn at the center. Blank lines equal to the number of spaces are added on top and below the label text.\n\n## Tables\nUse the ```table``` module to print out tables. Tables consist of two-dimensional arrays:\n```\n>>> from print import *\n>>> t = [[\"Entry 1\", 0.0001, \"Value 1\"], [\"Entry 2\", 12345, \"Value 2\"]]\n>>> table.table(t)\n+-------+------+-------+\n|Entry 1|0.0001|Value 1|\n+-------+------+-------+\n|Entry 2|12345 |Value 2|\n+-------+------+-------+\n```\n\n```table.render``` and ```render``` can be combined to add formatting:\n\n```\n>>> from print import *\n>>> t = [\n\t[render(\"Entry 1\", RED), 0.0001, \"Value 1\"],\n\t[render(\"Entry 2\", GREEN), 12345, \"Value 2\"]]\n>>> print(table.render(t), BOLD)\n```\n\n\n## Custom Exception\nUse the ```RenderedException``` class to provide a more colorful base exception class.\n```\n>>> class YouFuckedUpError(RenderedException):\n... pass\n...\n>>> raise YouFuckedUpError(\"You've really fucked it up this time. Yeah you.\")\nTraceback (most recent call last):\n File \"\", line 1, in \n__main__.YouFuckedUpError:\n__ __ ___ _ _ _ _ ___\n\\ \\ / /__ _ _| __| _ __| |_____ __| | | | |_ __| __|_ _ _ _ ___ _ _\n \\ V / _ \\ || | _| || / _| / / -_) _` | |_| | '_ \\ _|| '_| '_/ _ \\ '_|\n |_|\\___/\\_,_|_| \\_,_\\__|_\\_\\___\\__,_|\\___/| .__/___|_| |_| \\___/_|\n |_|\nYou've really fucked it up this time. Yeah you.\n```\n\n## Constants\nAll constants are accessible with ```from print import *``` or by by calling ```print.```.\n\n### Basic formatting\n```python\nRESET = 0\nBOLD = 1\nFAINT = 2\nITALIC = 3\nUNDERLINE = 4\nREVERSE = 7\nCONCEAL = 8\nSTRIKEOUT = 9\n```\n\n### Colors\n```python\nBLACK = 30\nRED = 31\nGREEN = 32\nYELLOW = 33\nBLUE = 34\nMAGENTA = 35\nCYAN = 36\nWHITE = 37\n```\n\n### Modifiers\n```python\nBRIGHT = 60\nBR = 60\nBACKGROUND = 10\nBG = 10\n```\n- ```BRIGHT``` / ```BR```: use the brighter version of the color (not available on all terminals; your mileage may vary)\n- ```BACKGROUND``` / ```BG```: set the background color instead of the text color\n\n### Fonts\nOnly these fonts are included as constants. Other Figlet fonts (see Figlet's [website](http://www.figlet.org/)) can be passed as a string argument.\n```python\n# Standard fonts\nSM = \"small\"\nSTD = \"standard\"\nBIG = \"big\"\n\n# Isometric fonts\nISO1 = \"isometric1\"\nISO2 = \"isometric2\"\nISO3 = \"isometric3\"\nISO4 = \"isometric4\"\n\n# Other fonts\nSA = \"contessa\"\nDOOM = \"doom\"\nDP = \"drpepper\"\nL3D = \"larry3d\"\nSMISO = \"smisome1\"\nKB = \"smkeyboard\"\nSLANT = \"slant\"\nSMSLANT = \"smslant\"\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thetianshuhuang/print", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "printtools", "package_url": "https://pypi.org/project/printtools/", "platform": "", "project_url": "https://pypi.org/project/printtools/", "project_urls": { "Homepage": "https://github.com/thetianshuhuang/print" }, "release_url": "https://pypi.org/project/printtools/1.2/", "requires_dist": [ "pyfiglet" ], "requires_python": "", "summary": "Collection of print utilities making heavy use of ANSI escape sequences with PyFiglet integration", "version": "1.2" }, "last_serial": 4867272, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "14086642fb78a1e790db2d1d671119ea", "sha256": "9e7a4821522f4c5ed4f0adbf766f3aa8608f56611c666c42687bc2a798abd5e0" }, "downloads": -1, "filename": "printtools-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "14086642fb78a1e790db2d1d671119ea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8374, "upload_time": "2018-12-15T22:52:09", "url": "https://files.pythonhosted.org/packages/64/10/1d4d52a46f2f072faa8bbd8a4db313dd226e6f34a8b72fc9e66a7c5b71cd/printtools-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "941b2b8bb73cca589e123e4474efe09b", "sha256": "3378975530641741e168dbfda24a8207d6d13d1626fe5b9862ce78cdcbb37575" }, "downloads": -1, "filename": "printtools-1.0.tar.gz", "has_sig": false, "md5_digest": "941b2b8bb73cca589e123e4474efe09b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6257, "upload_time": "2018-12-15T22:52:11", "url": "https://files.pythonhosted.org/packages/2d/bb/fcd73695c92743e13e294cec2cd71efc7eda6f8725d95d5f99bd7e3e923c/printtools-1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "9025f8fda960268bbd0248bc5797dc71", "sha256": "2db27a238b67a37854532abdd5de1476bcdb44976b261c7b36ca03337f6aed0d" }, "downloads": -1, "filename": "printtools-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9025f8fda960268bbd0248bc5797dc71", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9580, "upload_time": "2018-12-19T19:35:34", "url": "https://files.pythonhosted.org/packages/ed/39/8e27bc82e031064fe8e050f7be47818960ab997188ddde53647bafed0625/printtools-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46857585fbb5602414f14a767c7d229b", "sha256": "95aee9106b1ef6938ce9360a6f56b82e5f311bfd460efc09102c6a0f202978c5" }, "downloads": -1, "filename": "printtools-1.1.1.tar.gz", "has_sig": false, "md5_digest": "46857585fbb5602414f14a767c7d229b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7052, "upload_time": "2018-12-19T19:35:35", "url": "https://files.pythonhosted.org/packages/08/d4/0aa215a4c97ac11e790133dfa06adadaf78314f3eb0cb43818b5a4f7563e/printtools-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "c054d2b5788083cdc4e338d7c7dc2dd6", "sha256": "ed177aa9e09b8ce89c02aaa99dd01732d660293cbb88fd113493ffc9f932edca" }, "downloads": -1, "filename": "printtools-1.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c054d2b5788083cdc4e338d7c7dc2dd6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9583, "upload_time": "2018-12-20T18:58:47", "url": "https://files.pythonhosted.org/packages/84/76/21a5a25ef20367060bd3c5ffe7f4f89f7e036dc2e7e5d25e16abc69edace/printtools-1.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e905b96fb7440b1b21bacc2c0987941c", "sha256": "15fb6b4e22e2ea585b6e1216c528847f34968251b72f1d486b5c4c100703a599" }, "downloads": -1, "filename": "printtools-1.1.2.tar.gz", "has_sig": false, "md5_digest": "e905b96fb7440b1b21bacc2c0987941c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7066, "upload_time": "2018-12-20T18:58:48", "url": "https://files.pythonhosted.org/packages/76/77/e99fef7435e639537e71808f89ddc4ca57c8d88f7aee9351a042ba8884b2/printtools-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "d0af58a9c1b782f0316bc87e916e3c36", "sha256": "5d0a0a51a1dbc5c4b64a51e91f4602ea4d0137ee9f14529512acf6eee7e3a821" }, "downloads": -1, "filename": "printtools-1.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d0af58a9c1b782f0316bc87e916e3c36", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9609, "upload_time": "2018-12-20T19:24:53", "url": "https://files.pythonhosted.org/packages/7c/ea/153eec6d468751a3f0aadd27660589e948b61680598fed85870e08517dd6/printtools-1.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31f146bbf4a2978bfae2cc53b1b0f73d", "sha256": "71296ee4b753cd9291fdd562393a84f5f6b98809a07f1394b7df1143db19a05f" }, "downloads": -1, "filename": "printtools-1.1.3.tar.gz", "has_sig": false, "md5_digest": "31f146bbf4a2978bfae2cc53b1b0f73d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2018-12-20T19:24:55", "url": "https://files.pythonhosted.org/packages/fc/73/11282fe01e9d160acd81f6b626818b1dde3c2ae2ac5033f77973a30a3de9/printtools-1.1.3.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "f628c0cc04280a91e419d8e9126dc9a1", "sha256": "f0e010a9e9d691d60651ba9dbf7ce968946ac000d697880c51f1e3cff6894c3f" }, "downloads": -1, "filename": "printtools-1.2-py2.7.egg", "has_sig": false, "md5_digest": "f628c0cc04280a91e419d8e9126dc9a1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 10268, "upload_time": "2019-02-25T23:24:40", "url": "https://files.pythonhosted.org/packages/ec/df/1b42eec8f2717eb674c39495bb2b4011093eec35ef3d760bdcb0009bd810/printtools-1.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "25a2cc696d4ead614d84a3d0bae0c577", "sha256": "53b5e089e1fad658b96f3039b3f4473b1901d365b57e1004610bf70feec4a1f0" }, "downloads": -1, "filename": "printtools-1.2-py3.6.egg", "has_sig": false, "md5_digest": "25a2cc696d4ead614d84a3d0bae0c577", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 17289, "upload_time": "2019-02-25T23:24:41", "url": "https://files.pythonhosted.org/packages/85/a6/0e540f4da1f67111d88ef070dfd98663ac6cc2696ab718d152565927d270/printtools-1.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "ad950a8ea0bbea9323f18572b5d892ab", "sha256": "30c707339e3950ae3cbd5cba4933a47b09a67eee8babe7931569e38e30e1e930" }, "downloads": -1, "filename": "printtools-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ad950a8ea0bbea9323f18572b5d892ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9770, "upload_time": "2019-02-25T23:24:38", "url": "https://files.pythonhosted.org/packages/bf/22/3dc3c5a1c51a6e57f26131d184be6d5f8998864126dd35d4ee448b90a0c4/printtools-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46ad6dc9e3a8857b1a24880fa3fd7988", "sha256": "6d851da3e79d93d2ae38736b6d2f9fee30cc4d1d18f7ed4a306d2bd1f7c4c05c" }, "downloads": -1, "filename": "printtools-1.2.tar.gz", "has_sig": false, "md5_digest": "46ad6dc9e3a8857b1a24880fa3fd7988", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7433, "upload_time": "2019-02-25T23:24:42", "url": "https://files.pythonhosted.org/packages/93/e2/f67622c29a262c5222f59f43c707a395f71b5bfa375a3816db12273d4836/printtools-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f628c0cc04280a91e419d8e9126dc9a1", "sha256": "f0e010a9e9d691d60651ba9dbf7ce968946ac000d697880c51f1e3cff6894c3f" }, "downloads": -1, "filename": "printtools-1.2-py2.7.egg", "has_sig": false, "md5_digest": "f628c0cc04280a91e419d8e9126dc9a1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 10268, "upload_time": "2019-02-25T23:24:40", "url": "https://files.pythonhosted.org/packages/ec/df/1b42eec8f2717eb674c39495bb2b4011093eec35ef3d760bdcb0009bd810/printtools-1.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "25a2cc696d4ead614d84a3d0bae0c577", "sha256": "53b5e089e1fad658b96f3039b3f4473b1901d365b57e1004610bf70feec4a1f0" }, "downloads": -1, "filename": "printtools-1.2-py3.6.egg", "has_sig": false, "md5_digest": "25a2cc696d4ead614d84a3d0bae0c577", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 17289, "upload_time": "2019-02-25T23:24:41", "url": "https://files.pythonhosted.org/packages/85/a6/0e540f4da1f67111d88ef070dfd98663ac6cc2696ab718d152565927d270/printtools-1.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "ad950a8ea0bbea9323f18572b5d892ab", "sha256": "30c707339e3950ae3cbd5cba4933a47b09a67eee8babe7931569e38e30e1e930" }, "downloads": -1, "filename": "printtools-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ad950a8ea0bbea9323f18572b5d892ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9770, "upload_time": "2019-02-25T23:24:38", "url": "https://files.pythonhosted.org/packages/bf/22/3dc3c5a1c51a6e57f26131d184be6d5f8998864126dd35d4ee448b90a0c4/printtools-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46ad6dc9e3a8857b1a24880fa3fd7988", "sha256": "6d851da3e79d93d2ae38736b6d2f9fee30cc4d1d18f7ed4a306d2bd1f7c4c05c" }, "downloads": -1, "filename": "printtools-1.2.tar.gz", "has_sig": false, "md5_digest": "46ad6dc9e3a8857b1a24880fa3fd7988", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7433, "upload_time": "2019-02-25T23:24:42", "url": "https://files.pythonhosted.org/packages/93/e2/f67622c29a262c5222f59f43c707a395f71b5bfa375a3816db12273d4836/printtools-1.2.tar.gz" } ] }