pansi


Namepansi JSON
Version 2024.11.0 PyPI version JSON
download
home_pagehttps://github.com/technige/pansi
SummaryText mode rendering library
upload_time2024-11-03 23:48:17
maintainerNone
docs_urlNone
authorNigel Small
requires_python>=3.6
licenseApache-2.0
keywords ansi terminal text graphics unicode
VCS
bugtrack_url
requirements pillow
Travis-CI No Travis.
coveralls test coverage
            # Pansi

Pansi is a text mode rendering library. It provides a clean and simple
interface for working with text and graphics in the terminal, using ANSI escape
sequences for rendering. The library provides the following modules:

- `pansi.text` -- text colouring and styling
- `pansi.image` -- terminal-based image rendering
- `pansi.screen` -- full screen layout handling

Most modern terminals support ANSI rendering, but the exact feature sets
available do vary. Bear in mind that not every listed function might work in
every terminal, and check the documentation for your terminal software to make
sure.


## `pansi.text`

The `pansi.text` module provides a suite of functions for colouring and styling
terminal text, using ANSI escape sequences. Functions are designed to align as
closely as possible to CSS rules and properties, for ease of use.

### Colours

Let's start with something simple. The following example will render the word
"world" in green:

<pre style="color:silver;background-color:black"><code>&gt;&gt;&gt; from pansi.text import green
&gt;&gt;&gt; print(f"Hello, {green}world{~green}!")
Hello, <span style="color:green">world</span>!
</code></pre>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/technige/pansi",
    "name": "pansi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "ANSI, terminal, text, graphics, unicode",
    "author": "Nigel Small",
    "author_email": "technige@nige.tech",
    "download_url": "https://files.pythonhosted.org/packages/b2/93/2583b4b709707cc3b3dffc6ae49d6e96031eae46bd71c047b48417bac66d/pansi-2024.11.0.tar.gz",
    "platform": null,
    "description": "# Pansi\n\nPansi is a text mode rendering library. It provides a clean and simple\ninterface for working with text and graphics in the terminal, using ANSI escape\nsequences for rendering. The library provides the following modules:\n\n- `pansi.text` -- text colouring and styling\n- `pansi.image` -- terminal-based image rendering\n- `pansi.screen` -- full screen layout handling\n\nMost modern terminals support ANSI rendering, but the exact feature sets\navailable do vary. Bear in mind that not every listed function might work in\nevery terminal, and check the documentation for your terminal software to make\nsure.\n\n\n## `pansi.text`\n\nThe `pansi.text` module provides a suite of functions for colouring and styling\nterminal text, using ANSI escape sequences. Functions are designed to align as\nclosely as possible to CSS rules and properties, for ease of use.\n\n### Colours\n\nLet's start with something simple. The following example will render the word\n\"world\" in green:\n\n<pre style=\"color:silver;background-color:black\"><code>&gt;&gt;&gt; from pansi.text import green\n&gt;&gt;&gt; print(f\"Hello, {green}world{~green}!\")\nHello, <span style=\"color:green\">world</span>!\n</code></pre>\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Text mode rendering library",
    "version": "2024.11.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/technige/pansi/issues",
        "Homepage": "https://github.com/technige/pansi",
        "Source Code": "https://github.com/technige/pansi"
    },
    "split_keywords": [
        "ansi",
        " terminal",
        " text",
        " graphics",
        " unicode"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b818d19773a1da754e6c9342ca7801d0d75775425ea729e127e4851de63d8da",
                "md5": "35e7905644c1848d1b7122f8bb2e5050",
                "sha256": "79275348a03e022d4482d0bbd9fe7fae7741eb2de84dbe560631d48a9fa522e5"
            },
            "downloads": -1,
            "filename": "pansi-2024.11.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "35e7905644c1848d1b7122f8bb2e5050",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 26371,
            "upload_time": "2024-11-03T23:48:16",
            "upload_time_iso_8601": "2024-11-03T23:48:16.094735Z",
            "url": "https://files.pythonhosted.org/packages/0b/81/8d19773a1da754e6c9342ca7801d0d75775425ea729e127e4851de63d8da/pansi-2024.11.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2932583b4b709707cc3b3dffc6ae49d6e96031eae46bd71c047b48417bac66d",
                "md5": "b3d23cf310807b9e84a9b02dfa82b8f3",
                "sha256": "018186294f012ae48e207d9446b1bd22b0f2ebb2de60a6c4fb079abfacdf4a37"
            },
            "downloads": -1,
            "filename": "pansi-2024.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b3d23cf310807b9e84a9b02dfa82b8f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 24753,
            "upload_time": "2024-11-03T23:48:17",
            "upload_time_iso_8601": "2024-11-03T23:48:17.732238Z",
            "url": "https://files.pythonhosted.org/packages/b2/93/2583b4b709707cc3b3dffc6ae49d6e96031eae46bd71c047b48417bac66d/pansi-2024.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-03 23:48:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "technige",
    "github_project": "pansi",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "pillow",
            "specs": []
        }
    ],
    "lcname": "pansi"
}
        
Elapsed time: 0.83939s