Name | HiddenPrint JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | A small package to block print statements |
upload_time | 2024-10-12 17:20:57 |
maintainer | None |
docs_url | None |
author | Luke |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# HiddenPrints
![workflow](https://github.com/AdmiralLuke/HiddenPrints/actions/workflows/python-package.yml/badge.svg)
Sick of unnecessary prints from other libraries? Simply block them of with this small package
## Install
### via pip
```bash
pip install hiddenprint
```
## Usage
### 1) ``with``-Wrapper
To use the blocking mechanisms inside of methods for one or more lines of code, just wrap it in a ``with``-statement
```py
from hiddenprint import *
with HiddenPrints():
# code where prints should not be visible in the console
print("This won't be printed")
# code where prints should be visible in the console
print("Hello World!")
```
### 2) Function Decorator Flag
To block prints right up for a self defined function, decorator annotations can be used to block all prints within the function.
```py
from hiddenprint import *
@hide
def print_nothing_and_sum(a: int, b: int):
print("something nobody can see")
return a + b
result = print_nothing_and_sum(4, 3)
print(result) # prints 7
```
## Contribution
This is only a very small package and project. If you have some ideas to improve the quality of life, feel free to make a pull request.
Raw data
{
"_id": null,
"home_page": null,
"name": "HiddenPrint",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Luke",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/de/21/dc25e1b71f490e1a422f74e6805c7b3dfec244b5a89ce64c503afaa5201c/hiddenprint-0.0.2.tar.gz",
"platform": null,
"description": "# HiddenPrints\n\n![workflow](https://github.com/AdmiralLuke/HiddenPrints/actions/workflows/python-package.yml/badge.svg)\n\nSick of unnecessary prints from other libraries? Simply block them of with this small package\n\n## Install\n\n### via pip\n\n```bash\npip install hiddenprint\n```\n\n## Usage\n\n### 1) ``with``-Wrapper\nTo use the blocking mechanisms inside of methods for one or more lines of code, just wrap it in a ``with``-statement\n\n```py\nfrom hiddenprint import *\n\nwith HiddenPrints():\n # code where prints should not be visible in the console\n print(\"This won't be printed\")\n\n# code where prints should be visible in the console\nprint(\"Hello World!\")\n```\n\n### 2) Function Decorator Flag\n\nTo block prints right up for a self defined function, decorator annotations can be used to block all prints within the function.\n\n```py\nfrom hiddenprint import *\n\n@hide\ndef print_nothing_and_sum(a: int, b: int):\n print(\"something nobody can see\")\n return a + b\n\nresult = print_nothing_and_sum(4, 3) \nprint(result) # prints 7\n```\n\n## Contribution\n\nThis is only a very small package and project. If you have some ideas to improve the quality of life, feel free to make a pull request.\n",
"bugtrack_url": null,
"license": null,
"summary": "A small package to block print statements",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/AdmiralLuke/HiddenPrints",
"Issues": "https://github.com/AdmiralLuke/HiddenPrints/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d2beaf698986654c113326b421bf32c0a6e4219dfb6b40402414482f9a083ff8",
"md5": "434c04de1c549374fa50b1e48a621fe0",
"sha256": "eaab21d6269b21405f4e2d5d96dde507b35ebd0a12f4b9a35ac88755fb9dd6a6"
},
"downloads": -1,
"filename": "hiddenprint-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "434c04de1c549374fa50b1e48a621fe0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2946,
"upload_time": "2024-10-12T17:20:56",
"upload_time_iso_8601": "2024-10-12T17:20:56.955370Z",
"url": "https://files.pythonhosted.org/packages/d2/be/af698986654c113326b421bf32c0a6e4219dfb6b40402414482f9a083ff8/hiddenprint-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "de21dc25e1b71f490e1a422f74e6805c7b3dfec244b5a89ce64c503afaa5201c",
"md5": "8d005cda730c7dfe82d0100181f82124",
"sha256": "6823aaa6b46d8bbfe4bad84e1577df7bc672e14f40f00603f0f81b47c822d297"
},
"downloads": -1,
"filename": "hiddenprint-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "8d005cda730c7dfe82d0100181f82124",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3080,
"upload_time": "2024-10-12T17:20:57",
"upload_time_iso_8601": "2024-10-12T17:20:57.756623Z",
"url": "https://files.pythonhosted.org/packages/de/21/dc25e1b71f490e1a422f74e6805c7b3dfec244b5a89ce64c503afaa5201c/hiddenprint-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-12 17:20:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AdmiralLuke",
"github_project": "HiddenPrints",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hiddenprint"
}