Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
msgfy is a Python library for convert Exception instance to a human-readable error message.
.. contents:: msgfy :backlinks: top :depth: 2
msgfy is a Python library for convert Exception instance to a human-readable error message.
.. image:: https://badge.fury.io/py/msgfy.svg :target: https://badge.fury.io/py/msgfy :alt: PyPI package version
.. image:: https://img.shields.io/pypi/pyversions/msgfy.svg :target: https://pypi.org/project/msgfy :alt: Supported Python versions
.. image:: https://github.com/thombashi/msgfy/actions/workflows/ci.yml/badge.svg :target: https://github.com/thombashi/msgfy/actions/workflows/ci.yml :alt: CI status of Linux/macOS/Windows
.. image:: https://coveralls.io/repos/github/thombashi/msgfy/badge.svg?branch=master :target: https://coveralls.io/github/thombashi/msgfy?branch=master :alt: Test coverage
.. image:: https://github.com/thombashi/msgfy/actions/workflows/github-code-scanning/codeql/badge.svg :target: https://github.com/thombashi/msgfy/actions/workflows/github-code-scanning/codeql :alt: CodeQL
:Sample Code: .. code:: python
import msgfy
def error_message_example():
try:
raise ValueError("example message")
except ValueError as e:
print(msgfy.to_error_message(e))
error_message_example()
:Output: ::
ValueError: example error message
:Sample Code: .. code:: python
import msgfy
def error_message_format_example():
try:
raise ValueError("example error message")
except ValueError as e:
print(msgfy.to_error_message(e, "{exception} {func_name}: {error_msg}"))
error_message_format_example()
:Output: ::
ValueError error_message_format_example: example error message
:Sample Code: .. code:: python
import msgfy
def debug_message_example():
try:
raise ValueError("example debug message")
except ValueError as e:
print(msgfy.to_debug_message(e))
debug_message_example()
:Output: ::
ValueError <ipython-input-4-bdd569af197b>(5) debug_message_example: example debug message
Available keywords for message formats
+---------------------+-----------------------------------------------+
| Keyword | Replaced to |
+=====================+===============================================+
| ``"{exception}"`` | Exception class name |
+---------------------+-----------------------------------------------+
| ``"{file_name}"`` | File name that exception raised |
+---------------------+-----------------------------------------------+
| ``"{line_no}"`` | Line number where the exception raised |
+---------------------+-----------------------------------------------+
| ``"{func_name}"`` | Function name that exception raised |
+---------------------+-----------------------------------------------+
| ``"{error_msg}"`` | Message that passed to the exception instance |
+---------------------+-----------------------------------------------+
Installation
====================================
Install from PyPI
------------------------------
::
pip install msgfy
Install from PPA (for Ubuntu)
------------------------------
::
sudo add-apt-repository ppa:thombashi/ppa
sudo apt update
sudo apt install python3-msgfy
Dependencies
====================================
Python 3.7+
No external dependencies.
Test dependencies
-----------------
- `pytest <https://docs.pytest.org/en/latest/>`__
- `tox <https://testrun.org/tox/latest/>`__
FAQs
msgfy is a Python library for convert Exception instance to a human-readable error message.
We found that msgfy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.