{"id":15969906,"url":"https://github.com/thombashi/msgfy","last_synced_at":"2025-05-07T06:21:59.813Z","repository":{"id":57443698,"uuid":"130549009","full_name":"thombashi/msgfy","owner":"thombashi","description":"msgfy is a Python library for convert Exception instance to a human-readable error message.","archived":false,"fork":false,"pushed_at":"2023-09-17T06:35:31.000Z","size":90,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-27T07:36:04.954Z","etag":null,"topics":["logging","python-library"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/msgfy/","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/thombashi.png","metadata":{"files":{"readme":"README.rst","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,"governance":null}},"created_at":"2018-04-22T08:28:22.000Z","updated_at":"2024-05-16T12:56:58.000Z","dependencies_parsed_at":"2022-09-10T18:41:22.263Z","dependency_job_id":null,"html_url":"https://github.com/thombashi/msgfy","commit_stats":{"total_commits":152,"total_committers":2,"mean_commits":76.0,"dds":0.02631578947368418,"last_synced_commit":"e9ffdfd40dda4a325dfdb73e713354d8c87c0f28"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fmsgfy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fmsgfy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fmsgfy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fmsgfy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thombashi","download_url":"https://codeload.github.com/thombashi/msgfy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252825100,"owners_count":21809894,"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":["logging","python-library"],"created_at":"2024-10-07T19:42:19.801Z","updated_at":"2025-05-07T06:21:59.789Z","avatar_url":"https://github.com/thombashi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. contents:: **msgfy**\n   :backlinks: top\n   :depth: 2\n\n\nSummary\n====================================\nmsgfy is a Python library for convert Exception instance to a human-readable error message.\n\n\n.. image:: https://badge.fury.io/py/msgfy.svg\n    :target: https://badge.fury.io/py/msgfy\n    :alt: PyPI package version\n\n.. image:: https://img.shields.io/pypi/pyversions/msgfy.svg\n    :target: https://pypi.org/project/msgfy\n    :alt: Supported Python versions\n\n.. image:: https://github.com/thombashi/msgfy/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/thombashi/msgfy/actions/workflows/ci.yml\n    :alt: CI status of Linux/macOS/Windows\n\n.. image:: https://coveralls.io/repos/github/thombashi/msgfy/badge.svg?branch=master\n    :target: https://coveralls.io/github/thombashi/msgfy?branch=master\n    :alt: Test coverage\n\n.. image:: https://github.com/thombashi/msgfy/actions/workflows/github-code-scanning/codeql/badge.svg\n    :target: https://github.com/thombashi/msgfy/actions/workflows/github-code-scanning/codeql\n    :alt: CodeQL\n\n\nUsage\n====================================\n\nConvert from Exception instance to an error message\n------------------------------------------------------------------------\n:Sample Code:\n    .. code:: python\n\n        import msgfy\n\n        def error_message_example():\n            try:\n                raise ValueError(\"example message\")\n            except ValueError as e:\n                print(msgfy.to_error_message(e))\n\n        error_message_example()\n\n:Output:\n    ::\n\n        ValueError: example error message\n\nSpecify message format\n------------------------------------\n:Sample Code:\n    .. code:: python\n\n        import msgfy\n\n        def error_message_format_example():\n            try:\n                raise ValueError(\"example error message\")\n            except ValueError as e:\n                print(msgfy.to_error_message(e, \"{exception} {func_name}: {error_msg}\"))\n\n        error_message_format_example()\n\n:Output:\n    ::\n\n        ValueError error_message_format_example: example error message\n\n\nConvert from Exception instance to a debug message\n------------------------------------------------------------------------\n:Sample Code:\n    .. code:: python\n\n        import msgfy\n\n        def debug_message_example():\n            try:\n                raise ValueError(\"example debug message\")\n            except ValueError as e:\n                print(msgfy.to_debug_message(e))\n\n        debug_message_example()\n\n:Output:\n    ::\n\n        ValueError \u003cipython-input-4-bdd569af197b\u003e(5) debug_message_example: example debug message\n\n\nAvailable keywords for message formats\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n+---------------------+-----------------------------------------------+\n| Keyword             | Replaced to                                   |\n+=====================+===============================================+\n| ``\"{exception}\"``   | Exception class name                          |\n+---------------------+-----------------------------------------------+\n| ``\"{file_name}\"``   | File name that exception raised               |\n+---------------------+-----------------------------------------------+\n| ``\"{line_no}\"``     | Line number where the exception raised        |\n+---------------------+-----------------------------------------------+\n| ``\"{func_name}\"``   | Function name that exception raised           |\n+---------------------+-----------------------------------------------+\n| ``\"{error_msg}\"``   | Message that passed to the exception instance |\n+---------------------+-----------------------------------------------+\n\n\nInstallation\n====================================\n\nInstall from PyPI\n------------------------------\n::\n\n    pip install msgfy\n\nInstall from PPA (for Ubuntu)\n------------------------------\n::\n\n    sudo add-apt-repository ppa:thombashi/ppa\n    sudo apt update\n    sudo apt install python3-msgfy\n\n\nDependencies\n====================================\nPython 3.7+\nNo external dependencies.\n\nTest dependencies\n-----------------\n- `pytest \u003chttps://docs.pytest.org/en/latest/\u003e`__\n- `tox \u003chttps://testrun.org/tox/latest/\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fmsgfy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthombashi%2Fmsgfy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fmsgfy/lists"}