new-print-function


Namenew-print-function JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryThe New Python Print Function.
upload_time2025-01-02 23:48:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.0
licenseNone
keywords new print function color print background color font style foreground color terminal color
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# The New Python Print Function

**The New Python Print Function** is a powerful library that extends Python's built-in `print` function with support for customizable text and background colors, as well as advanced font styles, using ANSI escape sequences.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
  - [Function Signatures](#function-signatures)
  - [Using the `print` Function](#using-the-print-function)
  - [Using the `format` Function](#using-the-format-function)
- [Features](#features)
  - [Colors](#colors)
  - [Font Styles](#font-styles)
- [Contributing](#contributing)
- [License](#license)
- [Author](#author)

## Installation

Install via pip:

```bash
pip install new-print-function
```

---

## Usage

The library consists of two main functions: `print` and `format`.

### Function Signatures

#### `format` Function

Applies colors and font styles to a string and returns the styled text.

```python
format(text: str, fg=None, bg=None, fs=None)
```

- `text` (str): The text to format.
- `fg` (str): Foreground color.
- `bg` (str): Background color.
- `fs` (str): Font style.

#### `print` Function

An enhanced version of Python's `print` function, fully compatible with its default parameters while adding support for styles.

```python
print(*objects, sep=' ', end='\n', file=None, flush=False, fg=None, bg=None, fs=None)
```

- Additional Parameters:
  - `fg` (str): Foreground color.
  - `bg` (str): Background color.
  - `fs` (str): Font style.

---

### Using the `print` Function

#### Example Usage

```python
import new_print_function as npf

npf.print("Hello, world!", fg="red", bg="yellow", fs="bold")
```

#### Overriding Built-in `print`

```python
from new_print_function import print

print("Styled text!", fg="blue", fs="underline")
```

---

### Using the `format` Function

```python
import new_print_function as npf

styled_text = npf.format("Hello, world!", fg="green", bg="black", fs="bold")
print(styled_text)
```

---

## Features

### Colors

Supports **140+ colors**, derived from HTML color names, for both foreground and background. Below is a categorized list of supported colors:

#### Blues

- cyan
- aqua
- lightcyan
- paleturquoise
- aquamarine
- turquoise
- mediumturquoise
- darkturquoise
- cadetblue
- steelblue
- lightsteelblue
- powderblue
- lightblue
- skyblue
- lightskyblue
- deepskyblue
- dodgerblue
- cornflowerblue
- mediumslateblue
- royalblue
- blue
- mediumblue
- darkblue
- navy
- midnightblue

#### Reds

- indianred
- lightcoral
- salmon
- darksalmon
- lightsalmon
- crimson
- red
- firebrick
- darkred

#### Greens

- greenyellow
- chartreuse
- lawngreen
- lime
- limegreen
- palegreen
- lightgreen
- mediumspringgreen
- springgreen
- mediumseagreen
- seagreen
- forestgreen
- green
- darkgreen

#### And More...

### Font Styles

Supports **10 font styles**, including:

- bold
- dim
- italic
- underline
- double-underline
- inverse
- hidden
- strikethrough
- frame
- overline

---

## Contributing

Contributions are welcome! Follow these steps:

1. Fork the repository.
2. Create a branch for your feature or fix.
3. Commit your changes.
4. Open a pull request.

For significant changes, open an issue first to discuss your proposal.

---

## License

The MIT License

Copyright (c) 2025 Haripo Wesley T.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

1. The above copyright notice and this permission notice shall be included in all
   copies or substantial portions of the Software.

2. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.

---

## Author

- **Wesley Tadiwanashe Haripo**  
  - Email: [haripowesleyt@proton.me](mailto:haripowesleyt@proton.me)  
  - GitHub: [haripowesleyt](https://github.com/haripowesleyt)

---

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "new-print-function",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "\"Haripo Wesley T.\" <haripowesleyt@proton.me>",
    "keywords": "new print function, color print, background color, font style, foreground color, terminal color",
    "author": null,
    "author_email": "\"Haripo Wesley T.\" <haripowesleyt@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/79/77/99b998f8f561f716e90d2c4a2377defc39bb67ba8bda54c244f78f6404ec/new_print_function-1.0.0.tar.gz",
    "platform": null,
    "description": "\n# The New Python Print Function\n\n**The New Python Print Function** is a powerful library that extends Python's built-in `print` function with support for customizable text and background colors, as well as advanced font styles, using ANSI escape sequences.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Function Signatures](#function-signatures)\n  - [Using the `print` Function](#using-the-print-function)\n  - [Using the `format` Function](#using-the-format-function)\n- [Features](#features)\n  - [Colors](#colors)\n  - [Font Styles](#font-styles)\n- [Contributing](#contributing)\n- [License](#license)\n- [Author](#author)\n\n## Installation\n\nInstall via pip:\n\n```bash\npip install new-print-function\n```\n\n---\n\n## Usage\n\nThe library consists of two main functions: `print` and `format`.\n\n### Function Signatures\n\n#### `format` Function\n\nApplies colors and font styles to a string and returns the styled text.\n\n```python\nformat(text: str, fg=None, bg=None, fs=None)\n```\n\n- `text` (str): The text to format.\n- `fg` (str): Foreground color.\n- `bg` (str): Background color.\n- `fs` (str): Font style.\n\n#### `print` Function\n\nAn enhanced version of Python's `print` function, fully compatible with its default parameters while adding support for styles.\n\n```python\nprint(*objects, sep=' ', end='\\n', file=None, flush=False, fg=None, bg=None, fs=None)\n```\n\n- Additional Parameters:\n  - `fg` (str): Foreground color.\n  - `bg` (str): Background color.\n  - `fs` (str): Font style.\n\n---\n\n### Using the `print` Function\n\n#### Example Usage\n\n```python\nimport new_print_function as npf\n\nnpf.print(\"Hello, world!\", fg=\"red\", bg=\"yellow\", fs=\"bold\")\n```\n\n#### Overriding Built-in `print`\n\n```python\nfrom new_print_function import print\n\nprint(\"Styled text!\", fg=\"blue\", fs=\"underline\")\n```\n\n---\n\n### Using the `format` Function\n\n```python\nimport new_print_function as npf\n\nstyled_text = npf.format(\"Hello, world!\", fg=\"green\", bg=\"black\", fs=\"bold\")\nprint(styled_text)\n```\n\n---\n\n## Features\n\n### Colors\n\nSupports **140+ colors**, derived from HTML color names, for both foreground and background. Below is a categorized list of supported colors:\n\n#### Blues\n\n- cyan\n- aqua\n- lightcyan\n- paleturquoise\n- aquamarine\n- turquoise\n- mediumturquoise\n- darkturquoise\n- cadetblue\n- steelblue\n- lightsteelblue\n- powderblue\n- lightblue\n- skyblue\n- lightskyblue\n- deepskyblue\n- dodgerblue\n- cornflowerblue\n- mediumslateblue\n- royalblue\n- blue\n- mediumblue\n- darkblue\n- navy\n- midnightblue\n\n#### Reds\n\n- indianred\n- lightcoral\n- salmon\n- darksalmon\n- lightsalmon\n- crimson\n- red\n- firebrick\n- darkred\n\n#### Greens\n\n- greenyellow\n- chartreuse\n- lawngreen\n- lime\n- limegreen\n- palegreen\n- lightgreen\n- mediumspringgreen\n- springgreen\n- mediumseagreen\n- seagreen\n- forestgreen\n- green\n- darkgreen\n\n#### And More...\n\n### Font Styles\n\nSupports **10 font styles**, including:\n\n- bold\n- dim\n- italic\n- underline\n- double-underline\n- inverse\n- hidden\n- strikethrough\n- frame\n- overline\n\n---\n\n## Contributing\n\nContributions are welcome! Follow these steps:\n\n1. Fork the repository.\n2. Create a branch for your feature or fix.\n3. Commit your changes.\n4. Open a pull request.\n\nFor significant changes, open an issue first to discuss your proposal.\n\n---\n\n## License\n\nThe MIT License\n\nCopyright (c) 2025 Haripo Wesley T.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\n1. The above copyright notice and this permission notice shall be included in all\n   copies or substantial portions of the Software.\n\n2. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n   SOFTWARE.\n\n---\n\n## Author\n\n- **Wesley Tadiwanashe Haripo**  \n  - Email: [haripowesleyt@proton.me](mailto:haripowesleyt@proton.me)  \n  - GitHub: [haripowesleyt](https://github.com/haripowesleyt)\n\n---\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The New Python Print Function.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/pypa/new_print_function",
        "Issues": "https://github.com/pypa/new_print_function/issues",
        "Repository": "https://github.com/haripowesleyt/new_print_function/"
    },
    "split_keywords": [
        "new print function",
        " color print",
        " background color",
        " font style",
        " foreground color",
        " terminal color"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75c39c6d4837e0a7370b8d38b7e677d7ac930bb9739ae0193163d796b1e730f3",
                "md5": "30a5efc78ccfe1538cd8029a917dbc6a",
                "sha256": "105385900e394b0f965fca4c4744f6a6d875b33a95daa4f64d0c37f0057961be"
            },
            "downloads": -1,
            "filename": "new_print_function-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30a5efc78ccfe1538cd8029a917dbc6a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 14662,
            "upload_time": "2025-01-02T23:48:35",
            "upload_time_iso_8601": "2025-01-02T23:48:35.289171Z",
            "url": "https://files.pythonhosted.org/packages/75/c3/9c6d4837e0a7370b8d38b7e677d7ac930bb9739ae0193163d796b1e730f3/new_print_function-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "797799b998f8f561f716e90d2c4a2377defc39bb67ba8bda54c244f78f6404ec",
                "md5": "3bccc33e16abbac82df5d60be6f8df46",
                "sha256": "1be45d595d8ad4bd3ecc4fa66539485b9b52d5d655fd3d6f1111ce411011931e"
            },
            "downloads": -1,
            "filename": "new_print_function-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3bccc33e16abbac82df5d60be6f8df46",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 11164,
            "upload_time": "2025-01-02T23:48:38",
            "upload_time_iso_8601": "2025-01-02T23:48:38.740036Z",
            "url": "https://files.pythonhosted.org/packages/79/77/99b998f8f561f716e90d2c4a2377defc39bb67ba8bda54c244f78f6404ec/new_print_function-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-02 23:48:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pypa",
    "github_project": "new_print_function",
    "github_not_found": true,
    "lcname": "new-print-function"
}
        
Elapsed time: 0.48733s