flake8-digit-separator


Nameflake8-digit-separator JSON
Version 0.1.8 PyPI version JSON
download
home_pagehttps://github.com/imtoopunkforyou/flake8-digit-separator
SummaryCorrect placement of separators
upload_time2025-07-27 12:19:35
maintainerNone
docs_urlNone
authorTimur Valiev
requires_python<4.0,>=3.10
licenseMIT
keywords flake8 linter pep515 separator code-style python-linter linting code-standards code-quality flake8-plugin flake8-formatter code-checker numbers digits fds underscores numeric literals
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # flake8-digit-separator
[![coverage](https://raw.githubusercontent.com/imtoopunkforyou/flake8-digit-separator/refs/heads/main/.github/badge/coverage.svg)](https://github.com/pytest-dev/pytest-cov)
[![tests](https://github.com/imtoopunkforyou/flake8-digit-separator/actions/workflows/tests.yaml/badge.svg)](https://github.com/imtoopunkforyou/flake8-digit-separator/actions/workflows/tests.yaml)
[![pypi package version](https://img.shields.io/pypi/v/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)
[![pypi downloads](https://img.shields.io/pypi/dm/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)
[![supported python versions](https://img.shields.io/pypi/pyversions/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)
[![license](https://img.shields.io/pypi/l/flake8-digit-separator.svg)](https://github.com/imtoopunkforyou/flake8-digit-separator/blob/main/LICENSE)  


<p align="center">
  <a href="https://pypi.org/project/flake8-digit-separator">
    <img src="https://raw.githubusercontent.com/imtoopunkforyou/flake8-digit-separator/main/.github/badge/logo.png"
         alt="FDS logo">
  </a>
</p>

A set of [rules](https://github.com/imtoopunkforyou/flake8-digit-separator?tab=readme-ov-file#rules) on top of the capabilities provided by [PEP515](https://peps.python.org/pep-0515/).

```python
correct_int = 10_000
correct_float = 10_000.1_234
correct_binary = 0b_1101_1001
correct_octal = 0o_134_155
correct_hex = 0x_CAFE_F00D
```

## Installation
```bash
pip install flake8-digit-separator
```

### Dependencies
- `python (>=3.10, <4.0)`
- `flake8 (>=7.1, <8.0)`

## Usage
```bash
flake8 . --select FDS
```

## Rules
[PEP515](https://peps.python.org/pep-0515/) allows separators, but does not impose any restrictions on their position in a number (except that a number should not start/end with a separator and there should not be two separators in a row). To introduce more rigor and beauty into the code, we have written a few simple rules that we suggest following.

| Rule   | Number  | Description                               | Correct       | Wrong       |
|--------|---------|-------------------------------------------|---------------|-------------|
| FDS100 | integer | Group by 3s from right                    | 10_000        | 10_0        |
| FDS200 | float   | Group by 3s from right                    | 10_000.1_234  | 1_0_0.123_4 |
| FDS300 | binary  | Group by 4s from right after prefix `0b_` | 0b_1101_1001  | 0b110_11    |
| FDS400 | octal   | Group by 3s from right after prefix `0o_` | 0o_12_134_155 | 0o1_23_45   |
| FDS500 | hex     | Group by 4s from right after prefix `0x_` | 0x_CAFE_F00D  | 0xCAFEF0_0D |

## License
[FDS](https://github.com/imtoopunkforyou/flake8-digit-separator) is released under the MIT License. See the bundled [LICENSE](https://github.com/imtoopunkforyou/flake8-digit-separator/blob/main/LICENSE) file for details.

The logo was created using [Font Meme](https://fontmeme.com/graffiti-creator/).
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/imtoopunkforyou/flake8-digit-separator",
    "name": "flake8-digit-separator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "flake8, linter, PEP515, separator, code-style, python-linter, linting, code-standards, code-quality, flake8-plugin, flake8-formatter, code-checker, numbers, digits, FDS, Underscores, Numeric Literals",
    "author": "Timur Valiev",
    "author_email": "cptchunk@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/1c/42/4982ea9e3796530ff0c254f34ca9ddc3f2fe720173837381d441c3c53dc4/flake8_digit_separator-0.1.8.tar.gz",
    "platform": null,
    "description": "# flake8-digit-separator\n[![coverage](https://raw.githubusercontent.com/imtoopunkforyou/flake8-digit-separator/refs/heads/main/.github/badge/coverage.svg)](https://github.com/pytest-dev/pytest-cov)\n[![tests](https://github.com/imtoopunkforyou/flake8-digit-separator/actions/workflows/tests.yaml/badge.svg)](https://github.com/imtoopunkforyou/flake8-digit-separator/actions/workflows/tests.yaml)\n[![pypi package version](https://img.shields.io/pypi/v/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)\n[![pypi downloads](https://img.shields.io/pypi/dm/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)\n[![supported python versions](https://img.shields.io/pypi/pyversions/flake8-digit-separator.svg)](https://pypi.org/project/flake8-digit-separator)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n[![license](https://img.shields.io/pypi/l/flake8-digit-separator.svg)](https://github.com/imtoopunkforyou/flake8-digit-separator/blob/main/LICENSE)  \n\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/flake8-digit-separator\">\n    <img src=\"https://raw.githubusercontent.com/imtoopunkforyou/flake8-digit-separator/main/.github/badge/logo.png\"\n         alt=\"FDS logo\">\n  </a>\n</p>\n\nA set of [rules](https://github.com/imtoopunkforyou/flake8-digit-separator?tab=readme-ov-file#rules) on top of the capabilities provided by [PEP515](https://peps.python.org/pep-0515/).\n\n```python\ncorrect_int = 10_000\ncorrect_float = 10_000.1_234\ncorrect_binary = 0b_1101_1001\ncorrect_octal = 0o_134_155\ncorrect_hex = 0x_CAFE_F00D\n```\n\n## Installation\n```bash\npip install flake8-digit-separator\n```\n\n### Dependencies\n- `python (>=3.10, <4.0)`\n- `flake8 (>=7.1, <8.0)`\n\n## Usage\n```bash\nflake8 . --select FDS\n```\n\n## Rules\n[PEP515](https://peps.python.org/pep-0515/) allows separators, but does not impose any restrictions on their position in a number (except that a number should not start/end with a separator and there should not be two separators in a row). To introduce more rigor and beauty into the code, we have written a few simple rules that we suggest following.\n\n| Rule   | Number  | Description                               | Correct       | Wrong       |\n|--------|---------|-------------------------------------------|---------------|-------------|\n| FDS100 | integer | Group by 3s from right                    | 10_000        | 10_0        |\n| FDS200 | float   | Group by 3s from right                    | 10_000.1_234  | 1_0_0.123_4 |\n| FDS300 | binary  | Group by 4s from right after prefix `0b_` | 0b_1101_1001  | 0b110_11    |\n| FDS400 | octal   | Group by 3s from right after prefix `0o_` | 0o_12_134_155 | 0o1_23_45   |\n| FDS500 | hex     | Group by 4s from right after prefix `0x_` | 0x_CAFE_F00D  | 0xCAFEF0_0D |\n\n## License\n[FDS](https://github.com/imtoopunkforyou/flake8-digit-separator) is released under the MIT License. See the bundled [LICENSE](https://github.com/imtoopunkforyou/flake8-digit-separator/blob/main/LICENSE) file for details.\n\nThe logo was created using [Font Meme](https://fontmeme.com/graffiti-creator/).",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Correct placement of separators",
    "version": "0.1.8",
    "project_urls": {
        "Homepage": "https://github.com/imtoopunkforyou/flake8-digit-separator"
    },
    "split_keywords": [
        "flake8",
        " linter",
        " pep515",
        " separator",
        " code-style",
        " python-linter",
        " linting",
        " code-standards",
        " code-quality",
        " flake8-plugin",
        " flake8-formatter",
        " code-checker",
        " numbers",
        " digits",
        " fds",
        " underscores",
        " numeric literals"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34c9f55891195da469bbb99d0bf2018a5497f5d0ac69f0df84140871f696a174",
                "md5": "962fa9901d62e4d466b5288af381f81e",
                "sha256": "73543684b5f7ed4d3f1ffcaacc47d06951897696ac31a4e6b8c56135326327a9"
            },
            "downloads": -1,
            "filename": "flake8_digit_separator-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "962fa9901d62e4d466b5288af381f81e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 22604,
            "upload_time": "2025-07-27T12:19:33",
            "upload_time_iso_8601": "2025-07-27T12:19:33.739319Z",
            "url": "https://files.pythonhosted.org/packages/34/c9/f55891195da469bbb99d0bf2018a5497f5d0ac69f0df84140871f696a174/flake8_digit_separator-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c424982ea9e3796530ff0c254f34ca9ddc3f2fe720173837381d441c3c53dc4",
                "md5": "4a2216d805a0404a67cf70c5668f5364",
                "sha256": "e789e8489758edcf114917643194a3d6bebb5741fb88638f844137dffa200a46"
            },
            "downloads": -1,
            "filename": "flake8_digit_separator-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "4a2216d805a0404a67cf70c5668f5364",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 10446,
            "upload_time": "2025-07-27T12:19:35",
            "upload_time_iso_8601": "2025-07-27T12:19:35.129628Z",
            "url": "https://files.pythonhosted.org/packages/1c/42/4982ea9e3796530ff0c254f34ca9ddc3f2fe720173837381d441c3c53dc4/flake8_digit_separator-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-27 12:19:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "imtoopunkforyou",
    "github_project": "flake8-digit-separator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flake8-digit-separator"
}
        
Elapsed time: 0.63991s