Module Utilities

pcapkit.utilities contains several useful functions and classes which are fundations of pcapkit, including decorater function seekset() and beholder(), and several user-refined exceptions and warnings.

Logging System

pcapkit.utilities.logging contains naïve integration of the Python logging system, i.e. a logging.Logger instance as logger.

pcapkit.utilities.logging.logger

Logger instance named after pcapkit.

Type:

logging.Logger

Environment Variables

pcapkit.utilities.logging.DEVMODE

Development mode flag.

Type:

bool

See also

This variable can be configured through the environment variable PCAPKIT_DEVMODE.

pcapkit.utilities.logging.VERBOSE

Verbose output flag.

Type:

bool

See also

This variable can be configured through the environment variable PCAPKIT_VERBOSE.

pcapkit.utilities.logging.SPHINX_TYPE_CHECKING

This is a workaround for typing.TYPE_CHECKING in Sphinx.

Type:

bool

See also

This variable can be configured through the environment variable PCAPKIT_SPHINX.

Version Compatibility

pcapkit further provides a compatibility layer for the following objects and functions:

Compatibility Target

Minimal Required Version

pathlib

Python 3.5

ModuleNotFoundError

Python 3.6

collections.abc.Collection

Python 3.6

functools.cached_property()

Python 3.8

collections.abc.Mapping[KT, VT]

Python 3.9

tuple[T, ...]

Python 3.9

list[T]

Python 3.9

dict[KT, VT]

Python 3.9

enum.StrEnum

Python 3.11

typing.final()

Python 3.8

decimal.localcontext(ctx=None, **kwargs)

Python 3.11

enum.show_flag_values()

Python 3.11

typing.TypeAlias

Python 3.10