Metadata-Version: 2.1
Name: flake8-import-order-ruler501
Version: 0.18.1
Summary: ruler501's flake8-import-order plugin.
Home-page: https://github.com/ruler501/flake8-import-order-ruler501
Author: ruler501
Author-email: ruler501@ruler501.com
License: MIT
Keywords: flake8-import-order ruler501
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Flake8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.4
Description-Content-Type: text/markdown
Requires-Dist: flake8-import-order (>=0.18)

# flake8-import-order-ruler501

A [flake8-import-order](https://github.com/PyCQA/flake8-import-order) ordering definition, defining ruler501's preferred import order style. Originally based on [flake8-import-order-grok](https://github.com/groklearning/flake8-import-order-grok)

The import order enforced by this style is:
1. `__future__`
2. builtins
3. third-party, grouped separately by package
4. Application packages by package
5. Relative imports

All groups of imports require a line break between them, except packages within your application.

All imports must be alphabetical horizontally and vertically.
`from` import groups are on separate lines sorted by constants first, followed by classes, followed by functions (i.e. CAPITAL_CASE, CamelCase, underscore_case).

The names of the application packages can be configured via the `application-import-names` setting in `flake8`.

For example, if `application-import-names` is set to `my_project`, this import ordering enforces the following ordering:

```python
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals  # 1. `__future__`

import io  # 2. Builtins.
import logging
import os
import tarfile

from django.conf import settings  # 3.1 django
from django.utils.http import urlencode

from dns.exception import DNSException, Timeout  # 3.2
from dns.resolver import NXDOMAIN
from dns.resolver import NoAnswer, Resolver

import requests # 3.3 

import ujson #3.4

from my_project.views import MainView  # 4. Application packages.
from my_project.core.enums import Enum
from my_project.utils.download import DOWNLOAD_TIMEOUT
from my_project.utils.download import InvalidURLException
from my_project.utils.download import download_content_url

from .models import Article
```

## Usage

Install the `flake8-import-order-ruler501` package using `pip`, then tell `flake8` to use this import order style using the `--import-order-style=ruler501` command-line option, or by setting it in `setup.cfg`.
The names of your application package(s) can be set by the `application-import-names` setting:

```
[flake8]
import-order-style = ruler501
application-import-names = my_package1, my_package2
```


