Skip to main content

flake8-import-order style plugin for my (thebigmunch) taste.

Project description

flake8-import-order-tbm

PyPI
GitHub CI

flake8-import-order-tbm is a style for flake8-import-order.

Styling

  • Package, module, and imported names are naturally sorted using natsort.
  • Standard library import section precedes 3rd-party import section precedes local import section.
  • Import statements precede from import statements.
  • UPPERCASE precedes Capitalized precedes lowercase.
  • Fewer levels in a local relative import precede greater levels.

A basic example:

import os
import sys
from os import path

import attr
import requests
from attr import attrib, attrs

import LocalPackage
import localpackage
from localpackage import name
from . import name1, name2, name10
from .module import name3
from ..module import name4

Usage

Install flake8-import-order-tbm using pip install flake8-import-order-tbm.

When running flake8, do one of the following:

  • Add the --import-order-style=tbm option to the command.

  • Add this to your flake8 config:

     import-order-style = tbm
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-import-order-tbm-1.3.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

flake8_import_order_tbm-1.3.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page