Zombie-py

Latest version: v1.3

Safety actively analyzes 722032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.3

What's Changed
- fixed typing
- fixed other small bugs


* Develop by tybruno in https://github.com/tybruno/zombie-py/pull/9


**Full Changelog**: https://github.com/tybruno/zombie-py/compare/v1.2...v1.3

Installation
To install the package, use the following command:
shell
pip install zombie-py


Usage Examples
Using as a Context Manager
python
from zombie import ExceptionTransformation, Reraise

transform = ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
)

with Reraise(transform):
raise KeyError('Original error message')


Using as a Decorator
python
from zombie import ExceptionTransformation, Reraise

transforms = [
ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
error_message='A KeyError occurred',
raise_from_error=True,
),
ExceptionTransformation(
original_exception=TypeError,
new_exception=RuntimeError,
error_message='A TypeError occurred',
raise_from_error=True,
),
]

Reraise(transforms)
def func():
raise KeyError('Original error message')

func()


Bug Fixes
- None

Known Issues
- None

Contributors
- Tyler Bruno

1.2

What's Changed
- Python 3.10 compatible


* Develop by tybruno in https://github.com/tybruno/zombie-py/pull/7


**Full Changelog**: https://github.com/tybruno/zombie-py/compare/v1.1...v1.2

Installation
To install the package, use the following command:
shell
pip install zombie-py


Usage Examples
Using as a Context Manager
python
from zombie import ExceptionTransformation, Reraise

transform = ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
)

with Reraise(transform):
raise KeyError('Original error message')


Using as a Decorator
python
from zombie import ExceptionTransformation, Reraise

transforms = [
ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
error_message='A KeyError occurred',
raise_from_error=True,
),
ExceptionTransformation(
original_exception=TypeError,
new_exception=RuntimeError,
error_message='A TypeError occurred',
raise_from_error=True,
),
]

Reraise(transforms)
def func():
raise KeyError('Original error message')

func()


Bug Fixes
- None

Known Issues
- None

Contributors
- Tyler Bruno

1.1

New Features
- examples/examples.py for more examples.
- fixed some documentation
- added images for pypi.

Installation
To install the package, use the following command:
shell
pip install zombie-py


Usage Examples
Using as a Context Manager
python
from zombie import ExceptionTransformation, Reraise

transform = ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
)

with Reraise(transform):
raise KeyError('Original error message')


Using as a Decorator
python
from zombie import ExceptionTransformation, Reraise

transforms = [
ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
error_message='A KeyError occurred',
raise_from_error=True,
),
ExceptionTransformation(
original_exception=TypeError,
new_exception=RuntimeError,
error_message='A TypeError occurred',
raise_from_error=True,
),
]

Reraise(transforms)
def func():
raise KeyError('Original error message')

func()


Bug Fixes
- None

Known Issues
- None

Contributors
- Tyler Bruno

What's Changed
* Develop by tybruno in https://github.com/tybruno/zombie-py/pull/5


**Full Changelog**: https://github.com/tybruno/zombie-py/compare/v1.0...v1.1

1.0

New Features
- **Exception Transformation**: Simplifies the process of transforming and re-raising exceptions.
- **Context Manager and Decorator**: Provides both context manager and decorator for handling exceptions.
- **Customizable Transformations**: Allows defining custom transformations for exceptions.
- **Comprehensive Testing**: Ensures reliability through comprehensive tests.

Installation
To install the package, use the following command:
shell
pip install zombie-py


Usage Examples
Using as a Context Manager
python
from zombie import ExceptionTransformation, Reraise

transform = ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
)

with Reraise(transform):
raise KeyError('Original error message')


Using as a Decorator
python
from zombie import ExceptionTransformation, Reraise

transforms = [
ExceptionTransformation(
original_exception=KeyError,
new_exception=ValueError,
error_message='A KeyError occurred',
raise_from_error=True,
),
ExceptionTransformation(
original_exception=TypeError,
new_exception=RuntimeError,
error_message='A TypeError occurred',
raise_from_error=True,
),
]

Reraise(transforms)
def func():
raise KeyError('Original error message')

func()


Bug Fixes
- None

Known Issues
- None

Contributors
- Tyler Bruno

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.