{"id":13419339,"url":"https://github.com/apparebit/konsole","last_synced_at":"2025-05-05T18:32:48.664Z","repository":{"id":60722493,"uuid":"451943831","full_name":"apparebit/konsole","owner":"apparebit","description":"Readable, pleasing console output for Python","archived":false,"fork":false,"pushed_at":"2023-09-16T17:40:29.000Z","size":477,"stargazers_count":51,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"boss","last_synced_at":"2024-09-19T19:44:49.925Z","etag":null,"topics":["ansi-escape-codes","color","console","logger","logging","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apparebit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-25T15:58:52.000Z","updated_at":"2024-04-06T02:46:38.000Z","dependencies_parsed_at":"2024-10-26T16:04:33.616Z","dependency_job_id":"dc031fbb-d4d5-4698-ae6f-adcbe8e2d737","html_url":"https://github.com/apparebit/konsole","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"337604e9aa08456edc3139d034aed65f55cc5136"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparebit%2Fkonsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparebit%2Fkonsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparebit%2Fkonsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apparebit%2Fkonsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apparebit","download_url":"https://codeload.github.com/apparebit/konsole/tar.gz/refs/heads/boss","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224461872,"owners_count":17315116,"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":["ansi-escape-codes","color","console","logger","logging","python"],"created_at":"2024-07-30T22:01:14.603Z","updated_at":"2024-11-13T13:58:24.579Z","avatar_url":"https://github.com/apparebit.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# konsole: readable, pleasing console output\n\n\u003e When you are writing a Python command line tool and your head is on fire\n\u003e because of overly rich frameworks that just don’t click.\n\n![An interactive Python session using\nkonsole](https://raw.githubusercontent.com/apparebit/konsole/boss/session.png)\n\n[konsole](https://github.com/apparebit/konsole) is a simple logger built on top\nof Python's `logging` framework that prints to standard error and, if the\nunderlying terminal is amenable to it, does so with the judicious use of bold\nand light type as well as a dash of color. This package's interface stands on\nits own, no experience or direct interaction with `logging` required. At the\nsame time, this package plays equally well with other loggers, just leave\n~~konsole~~ 🙄 console output to it.\n\n\n## Using konsole\n\nIn order to use konsole, you need to go through the usual motions of installing\n\n```shell\n(venv) project % python3 -m pip install konsole\n```\n\nand then importing the package\n\n```python\nimport konsole\n```\n\nkonsole automatically integrates itself with Python’s logging system the first\ntime the module is imported into an application. Notably, it registers a handler\nthat prints messages to standard error with the root logger, replaces the\ncurrent logger class with a subclass that supports the `detail` keyword\nargument, and enables the capture of Python warnings through the logging system.\n\nkonsole's public API follows below. It consists of one function to update the\nconfiguration, one function to access the `__main__` application logger, and six\nfunctions to print messages at different priority levels. konsole includes type\nannotations, which have been validated with\n[mypy](https://mypy.readthedocs.io/en/stable/).\n\n\n### Configuring konsole\n\n  * Change the minimum level for printing messages and/or the flag for forcing\n    colors on/off.\n\n    ```python\n    def config(\n        *,\n        level: Optional[int] = None,\n        use_color: Optional[bool] = None,\n        volume: Optional[int] = None,\n    ) -\u003e None: ...\n    ```\n\n    konsole starts out with `INFO` as minimum level and uses color if\n    standard error is a TTY. The `volume` argument provides an alternative\n    means for setting the output level, with larger volumes printing more\n    information and 0 corresponding to the `W\n\n\n### Logging Messages\n\n  * Get the `__main__` application logger. konsole uses it for writing messages.\n\n    ```python\n    def logger() -\u003e logging.Logger\n    ```\n\n    The logger, like any other logger created after the initialization of\n    konsole, supports the `detail` keyword argument (see below).\n\n  * Log a message at the given level.\n\n    ```python\n    def critical(msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    def error(msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    def warning(msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    def info(msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    def debug(msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    def log(level: int, msg: str, *args: object, **kwargs: object) -\u003e None: ...\n    ```\n\n    The message string is the first and only mandatory argument. If the message\n    string contains `%` format specifiers, the necessary values must follow as\n    positional arguments.\n\n    Valid keyword arguments include those supported by Python's logging\n    framework, notably `exc_info` for including an exception's stacktrace. They\n    also include `detail` for supplemental data. konsole prints the mapping,\n    sequence, or scalar value on separate, indented lines after the message but\n    before an exception's stacktrace.\n\n    konsole defines ALL CAPS constants, e.g., `WARNING`, for the five levels\n    above. They have the same values as the corresponding constants in Python's\n    logging package.\n\n\n---\n\n© 2022 [Robert Grimm](https://apparebit.com).\nSubject to [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license.\nOn [GitHub](https://github.com/apparebit/konsole).\nOn [PyPI](https://pypi.org/project/konsole/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapparebit%2Fkonsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapparebit%2Fkonsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapparebit%2Fkonsole/lists"}