{"id":13711053,"url":"https://github.com/savioxavier/pyboxen","last_synced_at":"2026-01-17T22:54:18.945Z","repository":{"id":62150421,"uuid":"543606428","full_name":"savioxavier/pyboxen","owner":"savioxavier","description":"Incredibly customizable terminal boxes for Python","archived":false,"fork":false,"pushed_at":"2024-02-05T21:09:51.000Z","size":42,"stargazers_count":34,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T22:48:15.856Z","etag":null,"topics":["ascii","boxen","boxes","hacktoberfest","pip","python","rich","terminal","unicode"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyboxen/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/savioxavier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-30T13:10:38.000Z","updated_at":"2024-09-26T13:39:33.000Z","dependencies_parsed_at":"2023-02-01T03:45:46.695Z","dependency_job_id":null,"html_url":"https://github.com/savioxavier/pyboxen","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savioxavier%2Fpyboxen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savioxavier%2Fpyboxen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savioxavier%2Fpyboxen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savioxavier%2Fpyboxen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savioxavier","download_url":"https://codeload.github.com/savioxavier/pyboxen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224528333,"owners_count":17326343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii","boxen","boxes","hacktoberfest","pip","python","rich","terminal","unicode"],"created_at":"2024-08-02T23:01:03.952Z","updated_at":"2026-01-17T22:54:18.894Z","avatar_url":"https://github.com/savioxavier.png","language":"Python","funding_links":["https://www.buymeacoffee.com/savioxavier"],"categories":["ORM"],"sub_categories":["Utilities"],"readme":"# pyboxen\n\u003c!-- markdownlint-disable MD010 MD033 MD001 MD003 --\u003e\n\n\u003e **Create beautiful boxes in the terminal using Python**\n\n[![release](https://badge.fury.io/py/pyboxen.svg)](https://pypi.org/project/pyboxen)\n[![downloads](https://img.shields.io/pypi/dm/pyboxen.svg)](https://pypistats.org/packages/pyboxen)\n[![github](https://img.shields.io/github/license/savioxavier/pyboxen.svg)](https://github.com/savioxavier/pyboxen/blob/master/LICENSE)\n[![total downloads](https://static.pepy.tech/personalized-badge/pyboxen?period=total\u0026units=none\u0026left_color=grey\u0026right_color=blue\u0026left_text=total%20downloads)](https://pepy.tech/project/pyboxen)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nThis package is a Python \"port\" of the popular NPM package [boxen](https://github.com/sindresorhus/boxen/).\n\nIt's built on top of [Rich](https://github.com/Textualize/rich/), and features an API that would be familiar to the users of the NPM boxen package.\n\n## 🛠️ Install\n\nUsing [pip](https://pypi.org/)\n\n```text\npip install pyboxen\n```\n\n---\n\n## 🔗 Usage\n\n- Simplest of simple boxes\n\n```py\nfrom pyboxen import boxen\n\nprint(boxen(\"Python is cool!\"))\n```\n\n\u003e ![image](https://user-images.githubusercontent.com/38729705/198232802-e41575c6-abd6-416d-9ba6-d1b1c31a2660.png)\n\n- Define options\n\n```py\nfrom pyboxen import boxen\n\nprint(\n    boxen(\n        \"Python is cool!\",\n        padding=1,\n        margin=1,\n        color=\"cyan\",\n    )\n)\n```\n\n\u003e ![image](https://user-images.githubusercontent.com/38729705/198233490-52feeeba-efd3-4fe4-93cf-641d0f58fbf4.png)\n\n- Multiple texts and [Rich Renderables](https://github.com/Textualize/rich#rich-library)\n\n\u003e You can even use Rich's special color style syntax for the text, title and subtitle as well\n\u003e\n\u003e Example: `[red]Hello[/red] [bold italic]World[/]`\n\n```py\nfrom pyboxen import boxen\n\n# Multiple texts\n\nprint(\n    boxen(\n        \"Python is cool!\",\n        \"Yeah it totally is!\",\n        \"I [red]:heart:[/red]  [yellow bold]Python[/]!\",  # You can even use Rich syntax here too!\n        padding=1,\n        margin=1,\n        color=\"cyan\",\n    )\n)\n\n# Rich renderables, with a mix of strings and renderables\n\nfrom rich.table import Table\n\ntable = Table(show_header=True, header_style=\"bold magenta\")\n\ntable.add_column(\"Date\", style=\"dim\", width=12)\ntable.add_column(\"Title\")\ntable.add_column(\"Production Budget\", justify=\"right\")\ntable.add_column(\"Box Office\", justify=\"right\")\ntable.add_row(\n    \"Dec 20, 2019\", \"Star Wars: The Rise of Skywalker\", \"$275,000,000\", \"$375,126,118\"\n)\ntable.add_row(\n    \"May 25, 2018\",\n    \"[red]Solo[/red]: A Star Wars Story\",\n    \"$275,000,000\",\n    \"$393,151,347\",\n)\ntable.add_row(\n    \"Dec 15, 2017\",\n    \"Star Wars Ep. VIII: The Last Jedi\",\n    \"$262,000,000\",\n    \"[bold]$1,332,539,889[/bold]\",\n)\n\nprint(\n    boxen(\n        \"Python is cool!\",\n        table\n    )\n)\n```\n\n\u003e ![image](https://user-images.githubusercontent.com/38729705/198234218-0a4ccfd8-a858-4f84-a99d-f804b926f684.png)\n\n- Title and subtitles\n\n```py\nfrom pyboxen import boxen\n\nprint(\n    boxen(\n        \"Titles and subtitles!\",\n        title=\"Hello, [black on cyan] World [/]\",\n        subtitle=\"Cool subtitle goes here\",\n        subtitle_alignment=\"center\",\n        color=\"yellow\",\n        padding=1,\n    )\n)\n```\n\n\u003e ![image](https://user-images.githubusercontent.com/38729705/198237935-d01857b8-f61a-42de-b7e5-9fdff59a9739.png)\n---\n\n## 🔮 API\n\n### `boxen(*text, **kwargs)`\n\n#### text\n\nA variable (infinite) amount of text strings or [Rich Renderables](https://github.com/Textualize/rich#rich-library), or a mix of both.\n\n#### kwargs\n\nCustomize options for the box\n\nAvailable options include:\n\n```py\ncolor: str = \"white\",\nstyle: Literal[\"ascii\", \"ascii2\", \"ascii_double_head\", \"square\", \"square_double_head\", \"minimal\", \"horizontals\", \"rounded\", \"heavy\", \"double\"] = \"rounded\"\npadding: Union[int, tuple[int]] = 0,\nmargin: Union[int, tuple[int]] = 0,\ntext_alignment: Literal[\"left\", \"center\", \"right\"] = \"center\",\nbox_alignment: Literal[\"left\", \"center\", \"right\"] = \"left\",\ntitle: str = None,\ntitle_alignment: Literal[\"left\", \"center\", \"right\"] = \"left\",\nsubtitle: str = None,\nsubtitle_alignment: Literal[\"left\", \"center\", \"right\"] = \"left\",\nfullwidth: bool = False,\n```\n\n#### color\n\nThe color of the box in color or hex code starting with #, defaults to white\n\n#### style\n\nThe style of the box, defaults to rounded\n\n#### padding\n\nThe padding between the text and the box in int or tuple of ints, defaults to 0\n\n#### margin\n\nThe margin around the box in int or tuple of ints, defaults to 0\n\n#### text_alignment\n\nThe alignment of the text inside the box, defaults to center\n\n#### box_alignment\n\nThe alignment of the box in the terminal, defaults to left\n\n#### title\n\nThe title of the box, displayed on the top of the box, if provided\n\n#### title_alignment\n\nThe alignment of the title, defaults to left\n\n#### subtitle\n\nThe subtitle of the box, displayed on the bottom of the box, if provided\n\n#### subtitle_alignment\n\nThe alignment of the subtitle, defaults to left\n\n#### fullwidth\n\nIf True, the box will expand to fill the entire terminal width, defaults to False\n\n\u003e **Note**\n\u003e `padding` and `margin` attributes can be either an int, a tuple of ints (with a total of either 2 elements or 4 elements)\n\u003e Example:\n\u003e\n\u003e `2` - all of top, right, bottom, left\n\u003e\n\u003e `(2, 4)` - (top = bottom, right = left)\n\u003e\n\u003e `(2, 4, 6, 8)` - (top, right, bottom, left)\n\n---\n\n## ❤️ Support\n\nYou can support further development of this project by **giving it a 🌟** and help me make even better stuff in the future by **buying me a ☕**\n\n\u003ca href=\"https://www.buymeacoffee.com/savioxavier\"\u003e\n\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\" height=\"50px\"\u003e\n\u003c/a\u003e\n\n\u003cbr\u003e\n\n**Also, if you liked this repo, consider checking out my other projects, that would be real cool!**\n\n---\n\n## 💫 Attributions and special thanks\n\n- [boxen](https://github.com/sindresorhus/boxen/) - the NPM package I was inspired from\n- [rich](https://github.com/Textualize/rich) - for making such an incredibly powerful text customization tool\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavioxavier%2Fpyboxen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavioxavier%2Fpyboxen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavioxavier%2Fpyboxen/lists"}