looplog


Namelooplog JSON
Version 0.0.10 PyPI version JSON
download
home_page
SummaryA little helper to log warnings/errors for processed
upload_time2024-02-02 11:33:15
maintainer
docs_urlNone
author
requires_python>=3.0
licenseMIT License
keywords logging warnings errors
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Looplog

Looplog is a simple helper to log processing done in a loop, catching errors and warnings to produce a readble
console output, both interactively and not.

Quickly see how it looks with the demo.

```bash
python -m looplog.demo
```

## Usage

Decorate you function with `@looplog(items)` like this.

```python
from looplog import SKIP, looplog

@looplog([1, 2, 3, 4, 5, 6, 7, 8, "9", 10, 11.5, 12, 0, 13, None, 15])
def func_basic(value):
    if value is None:
        return SKIP
    if isinstance(value, float) and not value.is_integer():
        warnings.warn("Input will be rounded !")
    10 // value

# [to stdout in realtime]
# Starting loop `func_basic`
# ..........!.X.-....X.

print(func_basic.details())

# ================================================================================
# WARNING step_11: Input will be rounded !
# ================================================================================
# ERROR step_13: integer division or modulo by zero
# ================================================================================
# ERROR step_20: unsupported operand type(s) for //: 'int' and 'str'
# ================================================================================

print(func_basic.summary())

# 17 ok / 1 warn / 2 err / 1 skip
```

Check the looplog docstring for some additional features (logging, limit, etc.).

## Contribute

```bash
# install pre-commit
pip install pre-commit
pre-commit install

# run tests
python -m tests
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "looplog",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "",
    "keywords": "logging,warnings,errors",
    "author": "",
    "author_email": "Olivier Dalang <olivier.dalang@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/25/b1/da645521275fcc9b5d053526f956e78c834844e0da629b457dc75ac14654/looplog-0.0.10.tar.gz",
    "platform": null,
    "description": "# Looplog\n\nLooplog is a simple helper to log processing done in a loop, catching errors and warnings to produce a readble\nconsole output, both interactively and not.\n\nQuickly see how it looks with the demo.\n\n```bash\npython -m looplog.demo\n```\n\n## Usage\n\nDecorate you function with `@looplog(items)` like this.\n\n```python\nfrom looplog import SKIP, looplog\n\n@looplog([1, 2, 3, 4, 5, 6, 7, 8, \"9\", 10, 11.5, 12, 0, 13, None, 15])\ndef func_basic(value):\n    if value is None:\n        return SKIP\n    if isinstance(value, float) and not value.is_integer():\n        warnings.warn(\"Input will be rounded !\")\n    10 // value\n\n# [to stdout in realtime]\n# Starting loop `func_basic`\n# ..........!.X.-....X.\n\nprint(func_basic.details())\n\n# ================================================================================\n# WARNING step_11: Input will be rounded !\n# ================================================================================\n# ERROR step_13: integer division or modulo by zero\n# ================================================================================\n# ERROR step_20: unsupported operand type(s) for //: 'int' and 'str'\n# ================================================================================\n\nprint(func_basic.summary())\n\n# 17 ok / 1 warn / 2 err / 1 skip\n```\n\nCheck the looplog docstring for some additional features (logging, limit, etc.).\n\n## Contribute\n\n```bash\n# install pre-commit\npip install pre-commit\npre-commit install\n\n# run tests\npython -m tests\n```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A little helper to log warnings/errors for processed",
    "version": "0.0.10",
    "project_urls": {
        "homepage": "https://github.com/olivierdalang/looplog",
        "repository": "https://github.com/olivierdalang/looplog",
        "tracker": "https://github.com/olivierdalang/looplog/issues"
    },
    "split_keywords": [
        "logging",
        "warnings",
        "errors"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "523c0dd502353ef7cf7f8a99d99d1b7bd09a3350f71b0364d792009f3c4fbda3",
                "md5": "436fac2103801d7a59c0bd552ef8a967",
                "sha256": "ba4d73a8ee82dee718b1b378539fb863167dace42da41d35684cfee34c966c54"
            },
            "downloads": -1,
            "filename": "looplog-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "436fac2103801d7a59c0bd552ef8a967",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 7726,
            "upload_time": "2024-02-02T11:33:12",
            "upload_time_iso_8601": "2024-02-02T11:33:12.769190Z",
            "url": "https://files.pythonhosted.org/packages/52/3c/0dd502353ef7cf7f8a99d99d1b7bd09a3350f71b0364d792009f3c4fbda3/looplog-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25b1da645521275fcc9b5d053526f956e78c834844e0da629b457dc75ac14654",
                "md5": "d06b796971e9c9a0090765ac0dbced5c",
                "sha256": "856834bae9322d8d2d66b2fc91691a133094a40c47e882d1192a697a6dfcf348"
            },
            "downloads": -1,
            "filename": "looplog-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "d06b796971e9c9a0090765ac0dbced5c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 8226,
            "upload_time": "2024-02-02T11:33:15",
            "upload_time_iso_8601": "2024-02-02T11:33:15.285850Z",
            "url": "https://files.pythonhosted.org/packages/25/b1/da645521275fcc9b5d053526f956e78c834844e0da629b457dc75ac14654/looplog-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 11:33:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "olivierdalang",
    "github_project": "looplog",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "looplog"
}
        
Elapsed time: 0.18703s