flake8-helper

raw JSON →
0.2.2 verified Fri May 01 auth: no python

A helper library for Flake8 plugins, providing utilities like error reporting, file retrieval, and standard callback helpers. Current version is 0.2.2, requires Python >=3.6. Releases are infrequent; last update was 2021-09-20.

pip install flake8-helper
error ModuleNotFoundError: No module named 'flake8.helper'
cause Attempting to import with a period instead of underscore.
fix
Use 'from flake8_helper import ...' (underscore).
error AttributeError: module 'flake8_helper' has no attribute 'Error'
cause Forgot to import Error from the correct submodule or version mismatch.
fix
Check installed version: pip show flake8-helper. If v0.1.x, Error might be under flake8_helper.error submodule.
gotcha The package name uses a hyphen (flake8-helper) but the import uses an underscore (flake8_helper). Users often try to import flake8.helper or flake8_helper incorrectly.
fix Always import using 'from flake8_helper import ...' (underscore).
deprecated The library has not been updated since 2021; may lack compatibility with newer versions of flake8 or Python 3.10+.
fix Consider using flake8's built-in utilities or alternative plugins if you encounter issues.

Basic usage of the get_offset helper function.

from flake8_helper import get_offset

line = "    print('hello')"
offset = get_offset(line, column=4)
print(offset)  # 4