{ "info": { "author": "Aleksander Dzier\u017canowski", "author_email": "a.dzierzanowski1@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Terminals", "Topic :: Text Processing :: General" ], "description": "# afmt\n\nThis module provides an easy way to format text in CLI environment.\nIt is designed for use in **f-strings** but regular string formatting with\n`format` method is also supported.\n\nThe module takes care of stripping ANSI escape sequences from piped output\nand puts the sequences only if they're supported by the output device.\n\n# Setup \n\n`$ pip install afmt`\n\n# Usage and examples\n\n```python\nfrom afmt import Formatter\n\nf = Formatter()\n\n# You can use inline styling\nprint(f'{f:bold}bold text{f:e}')\n\n# You can define specs outside of an f-string\nwarning = 'bold bg(yellow) fg(black) italic'\nerror = 'bold bg(red) fg(white) underline'\nprint(f'{f:{warning}}Warning: you shouldn\\'t do it{f:e}')\nprint(f'{f:{error}}Error: you can\\'t do it{f:e}')\n\n# You can define custom styles in the formatter instance\nf.add_style('important', 'b fg(red)')\nprint(f'{f:important}important text{f:e}')\n\n# Or you can pass a dict of styles in the initializer \nf = Formatter(styles={\n 'important': 'bold fg(255,0,0)',\n 'unimporant': 'faint'\n})\nprint(f'{f:important}important text{f:e}')\nprint(f'{f:unimportant}not so important text{f:e}')\n\n# Move cursor to 4th row and 6th column and print text in reverse video mode \nprint(f'{f:reverse goto(4,6)}hello, world{f:e}')\n\n# Make text bold and underlined and unset bold in the middle\nprint(f'{f:bold italic}hello,{f:!bold} world{f:e}')\n```\n\n[![asciicast](https://asciinema.org/a/bDlnVRmdRpgq1cvTIRwawYswL.svg)](https://asciinema.org/a/bDlnVRmdRpgq1cvTIRwawYswL)\n\n# Development status\n\nThis module is in the early stage of development.\nMore features are coming hopefully soon.\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/adzierzanowski/afmt", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "afmt", "package_url": "https://pypi.org/project/afmt/", "platform": "", "project_url": "https://pypi.org/project/afmt/", "project_urls": { "Homepage": "https://github.com/adzierzanowski/afmt" }, "release_url": "https://pypi.org/project/afmt/0.0.5/", "requires_dist": null, "requires_python": ">=3.6", "summary": "ANSI escape code formatter", "version": "0.0.5" }, "last_serial": 5902719, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "cdbbdf2c36e8cbdb70886f161a431c84", "sha256": "575d018d36eb2ebd3a65d1b71ba05ded83aea1bee6438cbe7d2917967cedf9f2" }, "downloads": -1, "filename": "afmt-0.0.1.macosx-10.9-x86_64.tar.gz", "has_sig": false, "md5_digest": "cdbbdf2c36e8cbdb70886f161a431c84", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5652, "upload_time": "2019-09-28T23:45:50", "url": "https://files.pythonhosted.org/packages/4c/67/fa4f20e47b61dd0a640b5733cbd9e2de1ce03c45abf39af81ef8de5df483/afmt-0.0.1.macosx-10.9-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "f8f7491bfc3d50eee7967de90b292902", "sha256": "a7799cdd8a1fff45a91fb04ad86d3a0fef65118b0fd82ab39aedc877401cc59a" }, "downloads": -1, "filename": "afmt-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f8f7491bfc3d50eee7967de90b292902", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4337, "upload_time": "2019-09-28T23:45:47", "url": "https://files.pythonhosted.org/packages/fb/22/ad7b7ad1b73ce1d976b5cbba143d88df5ac3bdeed80651c5459e3fd972bc/afmt-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2b1588fa0a0ba635da62c5715b9e47ef", "sha256": "848ac8b4cf000cfb1a8089a7a4a0cee2ce03d04f9cf8ed5ae4065bb7bdd9cc74" }, "downloads": -1, "filename": "afmt-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2b1588fa0a0ba635da62c5715b9e47ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4869, "upload_time": "2019-09-29T12:37:34", "url": "https://files.pythonhosted.org/packages/35/75/741187eb2d144f10df1b798a8c2e4b9be330f3032cd7fc97e0e604fb9fa6/afmt-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfee9a2686c781e0763f4b7de3849b51", "sha256": "3958aaae9d01ac1bbbddfd3a02587c5583fddf95d8c65bc2bd22275f1f77efd0" }, "downloads": -1, "filename": "afmt-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cfee9a2686c781e0763f4b7de3849b51", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3690, "upload_time": "2019-09-29T12:37:36", "url": "https://files.pythonhosted.org/packages/73/c8/7eed48b124124bd9723beed08eec103fc15078641e414ca04549dbfe5dcf/afmt-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f0ed0c713ab2d2ac2a7db9511f9109d3", "sha256": "52c7fadcb90600f9cb30e0c9ada95a972cd101afad8fc6b26e74900f5669c1ae" }, "downloads": -1, "filename": "afmt-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f0ed0c713ab2d2ac2a7db9511f9109d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4863, "upload_time": "2019-09-29T12:44:23", "url": "https://files.pythonhosted.org/packages/42/c5/cb508f5f7ab1502d77f7861519fbe279f1e135b4b5cb51f2eb5790c395fd/afmt-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6efa7cf2e6b5c4823b0133ec49e6ab02", "sha256": "1f7ba97281775e4c23db4eda47346e3f6bb0cdd509654e3839653206e0e7980f" }, "downloads": -1, "filename": "afmt-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6efa7cf2e6b5c4823b0133ec49e6ab02", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3687, "upload_time": "2019-09-29T12:44:25", "url": "https://files.pythonhosted.org/packages/80/b6/13cb00ce8f7aa094f011ab4f41739cd026ff9d4e5e03f3cd9733cf0a587d/afmt-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "1a8ae379e6a9d8e18cceb5a3d8d78aba", "sha256": "18885a7173ac2624e8e6c206e130fb6c8dbd9365c33a24fd8091f0fd660e97f2" }, "downloads": -1, "filename": "afmt-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "1a8ae379e6a9d8e18cceb5a3d8d78aba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5525, "upload_time": "2019-09-29T13:34:43", "url": "https://files.pythonhosted.org/packages/25/d8/ba8701c1f5db7dc97c22195cbc0652e400e38552e31aa43806fdf4191fe8/afmt-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b0a5576bab6dddcc2334104a4610cb5b", "sha256": "312ffe1a298801a0fe763037ee92d5452edaf87ef2ee8c2814aa45074bfb008d" }, "downloads": -1, "filename": "afmt-0.0.4.tar.gz", "has_sig": false, "md5_digest": "b0a5576bab6dddcc2334104a4610cb5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4229, "upload_time": "2019-09-29T13:34:45", "url": "https://files.pythonhosted.org/packages/8f/2c/62ece8bdb3dd205fa2607b088506b3ecfbaa2b828db4f8ce215e937496e9/afmt-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "d1bd49977be9a9bdb4af53196db920b3", "sha256": "58755892581134fc4ed99d0f65c45d54cfc403e42bb22cbdc880a85315dcd8f3" }, "downloads": -1, "filename": "afmt-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "d1bd49977be9a9bdb4af53196db920b3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5549, "upload_time": "2019-09-29T14:05:48", "url": "https://files.pythonhosted.org/packages/b2/d8/6a50e1de2f727a5c214882e88a499a5d0b33a5149592583868529f8ed664/afmt-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0ea9b33bb0b1447ffc4e99328fc3037", "sha256": "25585bbe199291a818e7e2082217dcb7e52a8127451c24afc80c971139bf5e39" }, "downloads": -1, "filename": "afmt-0.0.5.tar.gz", "has_sig": false, "md5_digest": "d0ea9b33bb0b1447ffc4e99328fc3037", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4261, "upload_time": "2019-09-29T14:05:50", "url": "https://files.pythonhosted.org/packages/05/9a/de8aa0efa397f3f1cb0a965f929cdd6855755176465b45f6bff2d4b3d80d/afmt-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d1bd49977be9a9bdb4af53196db920b3", "sha256": "58755892581134fc4ed99d0f65c45d54cfc403e42bb22cbdc880a85315dcd8f3" }, "downloads": -1, "filename": "afmt-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "d1bd49977be9a9bdb4af53196db920b3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5549, "upload_time": "2019-09-29T14:05:48", "url": "https://files.pythonhosted.org/packages/b2/d8/6a50e1de2f727a5c214882e88a499a5d0b33a5149592583868529f8ed664/afmt-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0ea9b33bb0b1447ffc4e99328fc3037", "sha256": "25585bbe199291a818e7e2082217dcb7e52a8127451c24afc80c971139bf5e39" }, "downloads": -1, "filename": "afmt-0.0.5.tar.gz", "has_sig": false, "md5_digest": "d0ea9b33bb0b1447ffc4e99328fc3037", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4261, "upload_time": "2019-09-29T14:05:50", "url": "https://files.pythonhosted.org/packages/05/9a/de8aa0efa397f3f1cb0a965f929cdd6855755176465b45f6bff2d4b3d80d/afmt-0.0.5.tar.gz" } ] }