parser201


Nameparser201 JSON
Version 1.5.3 PyPI version JSON
download
home_pageNone
SummaryExtract individual fields from lines in Apache access logs
upload_time2024-11-15 17:19:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2020-2024, Peter Nardi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords apache log parse parser parser201 scanner server web
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![GitHub](https://img.shields.io/github/license/geozeke/parser201)
![PyPI](https://img.shields.io/pypi/v/parser201)
![PyPI - Status](https://img.shields.io/pypi/status/parser201)
![GitHub last commit](https://img.shields.io/github/last-commit/geozeke/parser201)
![GitHub issues](https://img.shields.io/github/issues/geozeke/parser201)
![PyPI - Downloads](https://img.shields.io/pypi/dm/parser201)
![GitHub repo size](https://img.shields.io/github/repo-size/geozeke/parser201)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/parser201)

<br>

<img
src="https://lh3.googleusercontent.com/d/1H04KVAA3ohH_dLXIrC0bXuJXDn3VutKc"
alt="Dinobox Logo" width="120"/>

## Features

The centerpiece of the parser201 module is the LogParser class. The
class initializer takes a single line from an Apache access log file and
extracts the individual fields into attributes within an object.

## Installation

```text
pip3 install parser201
```

## Usage

The most common use-case for parser201 is importing individual lines
from an Apache access log file and creating LogParser objects, like
this:

```python
from parser201 import LogParser

with open('access.log', 'r') as f:
    for line in f:
        lp = LogParser(line)
        # Use lp as desired: add to List, Dictionary, etc.
```

## Documentation

See: [parser201 Documentation][def].

## Version History

* 1.5.2 (2024-11-15)
  * Dependency updates.<br><br>
* 1.5.2 (2024-09-23)
  * Migrated packaging and build system to [uv][def2], and code
    formatting and linting to [ruff][def3].
  * Improved exception handling for invalid date-time objects.
  * Migrated documentation generation to [pdoc][def7].
  * Code and documentation linting.<br><br>
* 1.5.0 (2024-01-27)
  * Cleaned up packaging for better [PEP561][def4] compliance.
  * Cleaned up type hints.
  * Dropped support for converting timestamps to local machine time.
    Processing local timezones across multiple architectures and
    operating systems is a bit of a hot mess in Python right now.
    There's just too much variability with regard to OS Settings,
    location, daylight savings time, etc. The performance of this
    feature was spotty at best. There is still support for the
    *original* timezone and converstion to [*UTC*][def5].<br><br>
* 1.4.1 (2023-06-22)
  * Migrated code formatter to *black*.<br><br>
* 1.4.0 (2023-04-30)
  * Strengthened regular expression parsing to handle log lines that
    contain a wider array of malicious attacks.
  * Added support for access logs that contain both IPv4 and IPv6
    addresses.
  * Minimum supported Python version is now 3.8 (^3.8).
  * Miscellaneous optimizations.<br><br>
* 1.3.1 (2022-10-22)
  * Migrated dependency/build management to [poetry][def6].<br><br>
* 1.3.0 (2022-08-13)
  * Implemented `__eq__` magic method for the `LogParser` class. You can
    now perform equality checks on two `LogParser` objects.
  * Added test cases for `__eq__`
  * Migrated task runner to `make`
  * Documentation cleanup
  * Code linting and cleanup<br><br>
* 1.2.0 (2022-07-17)
  * Implemented `__eq__` magic methods in the `FMT` and `TZ` classes.
  * Documentation cleanup.
  * Testing improvements and pyproject.toml adjustments for better
    pytest compatability.
  * Code linting and cleanup.<br><br>
* 1.1.5 (2022-01-17)
  * Code linting and cleanup.<br><br>
* 1.1.4 (2021-12-23)
  * Documentation cleanup.<br><br>
* 1.1.3 (2021-12-19)
  * Make file tuning.
  * Documentation cleanup.
  * Added site logo to README.md.<br><br>
* 1.1.0 (2021-11-13)
  * Implemented selectable timestamp conversion options {*original*,
    *local*,
    [*UTC*][def5]}.
  * Implemented selectable formatting options for timestamp attribute
    {*string*, *date_obj*}.
  * Migrated API reference to GitHub pages.
  * Code cleanup.<br><br>
* 1.0.2 (2021-11-05)
  * Documentation cleanup.<br><br>
* 1.0.0 (2021-11-04)
  * Stable production release.
  * Migrated to a new development framework.
  * Implemented more robust and compartmentalized test cases.
  * Code tuning.<br><br>
* 0.2.0 (2021-10-31)
  * Changed behavior to gracefully fail for any malformed input line. If
    an input line cannot be successfully parsed, all attributes of the
    returned object are set to `None` and no messages are printed.
  * Added additional pytest cases to verify failure behavior.<br><br>
* 0.1.9 (2021-09-15)
  * Code cleanup for pep8 compliance.
  * Cleaned up Makefiles and scripts to remove references to python
    (meaning python2) and replace it with python3.<br><br>
* 0.1.7 (2021-06-05)
  * Re-tooled testing scripts to use parameterized test data, and
    conduct more robust testing.<br><br>
* 0.1.6 (2020-12-19)
  * Addressed exception handling for initializer input not being a valid
    string data type.
  * Documentation cleanup.<br><br>
* 0.1.5 (2020-10-26)
  * Enabled automatic deployment of tagged releases to pypi from travis
    using encrypted token.
  * Converted references to the master branch in the git repository to
    main across the documentation set.
  * Documentation cleanup.<br><br>
* 0.1.4 (2020-10-24)
  * Initial pypi release.
  * Fixed test file filtering issue in .gitignore.
  * Dependency fix for travis tests.<br><br>
* 0.1.1 (2020-10-22)
  * Follow-on testing on test.pypi.org.<br><br>
* 0.1.0 (2020-10-18)
  * Initial testing on test.pypi.org.

[def]: https://geozeke.github.io/parser201
[def2]: https://docs.astral.sh/uv/
[def3]: https://docs.astral.sh/ruff/
[def4]: https://peps.python.org/pep-0561/
[def5]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
[def6]: https://python-poetry.org/
[def7]: https://github.com/mitmproxy/pdoc

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "parser201",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Peter Nardi <pete@nardi.com>",
    "keywords": "apache, log, parse, parser, parser201, scanner, server, web",
    "author": null,
    "author_email": "Peter Nardi <pete@nardi.com>",
    "download_url": "https://files.pythonhosted.org/packages/6b/58/c2abf62d457f2a6892768ee3e28283b0b8e5e0ddf95a970f0949cc78806a/parser201-1.5.3.tar.gz",
    "platform": null,
    "description": "![GitHub](https://img.shields.io/github/license/geozeke/parser201)\n![PyPI](https://img.shields.io/pypi/v/parser201)\n![PyPI - Status](https://img.shields.io/pypi/status/parser201)\n![GitHub last commit](https://img.shields.io/github/last-commit/geozeke/parser201)\n![GitHub issues](https://img.shields.io/github/issues/geozeke/parser201)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/parser201)\n![GitHub repo size](https://img.shields.io/github/repo-size/geozeke/parser201)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/parser201)\n\n<br>\n\n<img\nsrc=\"https://lh3.googleusercontent.com/d/1H04KVAA3ohH_dLXIrC0bXuJXDn3VutKc\"\nalt=\"Dinobox Logo\" width=\"120\"/>\n\n## Features\n\nThe centerpiece of the parser201 module is the LogParser class. The\nclass initializer takes a single line from an Apache access log file and\nextracts the individual fields into attributes within an object.\n\n## Installation\n\n```text\npip3 install parser201\n```\n\n## Usage\n\nThe most common use-case for parser201 is importing individual lines\nfrom an Apache access log file and creating LogParser objects, like\nthis:\n\n```python\nfrom parser201 import LogParser\n\nwith open('access.log', 'r') as f:\n    for line in f:\n        lp = LogParser(line)\n        # Use lp as desired: add to List, Dictionary, etc.\n```\n\n## Documentation\n\nSee: [parser201 Documentation][def].\n\n## Version History\n\n* 1.5.2 (2024-11-15)\n  * Dependency updates.<br><br>\n* 1.5.2 (2024-09-23)\n  * Migrated packaging and build system to [uv][def2], and code\n    formatting and linting to [ruff][def3].\n  * Improved exception handling for invalid date-time objects.\n  * Migrated documentation generation to [pdoc][def7].\n  * Code and documentation linting.<br><br>\n* 1.5.0 (2024-01-27)\n  * Cleaned up packaging for better [PEP561][def4] compliance.\n  * Cleaned up type hints.\n  * Dropped support for converting timestamps to local machine time.\n    Processing local timezones across multiple architectures and\n    operating systems is a bit of a hot mess in Python right now.\n    There's just too much variability with regard to OS Settings,\n    location, daylight savings time, etc. The performance of this\n    feature was spotty at best. There is still support for the\n    *original* timezone and converstion to [*UTC*][def5].<br><br>\n* 1.4.1 (2023-06-22)\n  * Migrated code formatter to *black*.<br><br>\n* 1.4.0 (2023-04-30)\n  * Strengthened regular expression parsing to handle log lines that\n    contain a wider array of malicious attacks.\n  * Added support for access logs that contain both IPv4 and IPv6\n    addresses.\n  * Minimum supported Python version is now 3.8 (^3.8).\n  * Miscellaneous optimizations.<br><br>\n* 1.3.1 (2022-10-22)\n  * Migrated dependency/build management to [poetry][def6].<br><br>\n* 1.3.0 (2022-08-13)\n  * Implemented `__eq__` magic method for the `LogParser` class. You can\n    now perform equality checks on two `LogParser` objects.\n  * Added test cases for `__eq__`\n  * Migrated task runner to `make`\n  * Documentation cleanup\n  * Code linting and cleanup<br><br>\n* 1.2.0 (2022-07-17)\n  * Implemented `__eq__` magic methods in the `FMT` and `TZ` classes.\n  * Documentation cleanup.\n  * Testing improvements and pyproject.toml adjustments for better\n    pytest compatability.\n  * Code linting and cleanup.<br><br>\n* 1.1.5 (2022-01-17)\n  * Code linting and cleanup.<br><br>\n* 1.1.4 (2021-12-23)\n  * Documentation cleanup.<br><br>\n* 1.1.3 (2021-12-19)\n  * Make file tuning.\n  * Documentation cleanup.\n  * Added site logo to README.md.<br><br>\n* 1.1.0 (2021-11-13)\n  * Implemented selectable timestamp conversion options {*original*,\n    *local*,\n    [*UTC*][def5]}.\n  * Implemented selectable formatting options for timestamp attribute\n    {*string*, *date_obj*}.\n  * Migrated API reference to GitHub pages.\n  * Code cleanup.<br><br>\n* 1.0.2 (2021-11-05)\n  * Documentation cleanup.<br><br>\n* 1.0.0 (2021-11-04)\n  * Stable production release.\n  * Migrated to a new development framework.\n  * Implemented more robust and compartmentalized test cases.\n  * Code tuning.<br><br>\n* 0.2.0 (2021-10-31)\n  * Changed behavior to gracefully fail for any malformed input line. If\n    an input line cannot be successfully parsed, all attributes of the\n    returned object are set to `None` and no messages are printed.\n  * Added additional pytest cases to verify failure behavior.<br><br>\n* 0.1.9 (2021-09-15)\n  * Code cleanup for pep8 compliance.\n  * Cleaned up Makefiles and scripts to remove references to python\n    (meaning python2) and replace it with python3.<br><br>\n* 0.1.7 (2021-06-05)\n  * Re-tooled testing scripts to use parameterized test data, and\n    conduct more robust testing.<br><br>\n* 0.1.6 (2020-12-19)\n  * Addressed exception handling for initializer input not being a valid\n    string data type.\n  * Documentation cleanup.<br><br>\n* 0.1.5 (2020-10-26)\n  * Enabled automatic deployment of tagged releases to pypi from travis\n    using encrypted token.\n  * Converted references to the master branch in the git repository to\n    main across the documentation set.\n  * Documentation cleanup.<br><br>\n* 0.1.4 (2020-10-24)\n  * Initial pypi release.\n  * Fixed test file filtering issue in .gitignore.\n  * Dependency fix for travis tests.<br><br>\n* 0.1.1 (2020-10-22)\n  * Follow-on testing on test.pypi.org.<br><br>\n* 0.1.0 (2020-10-18)\n  * Initial testing on test.pypi.org.\n\n[def]: https://geozeke.github.io/parser201\n[def2]: https://docs.astral.sh/uv/\n[def3]: https://docs.astral.sh/ruff/\n[def4]: https://peps.python.org/pep-0561/\n[def5]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time\n[def6]: https://python-poetry.org/\n[def7]: https://github.com/mitmproxy/pdoc\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2020-2024, Peter Nardi  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Extract individual fields from lines in Apache access logs",
    "version": "1.5.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/geozeke/parser201/issues",
        "Documentation": "https://geozeke.github.io/parser201",
        "Source Code": "https://github.com/geozeke/parser201"
    },
    "split_keywords": [
        "apache",
        " log",
        " parse",
        " parser",
        " parser201",
        " scanner",
        " server",
        " web"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "177289a0fe04f4768844828300d247a8ba155ff37091a3858de43aa9afc5aed9",
                "md5": "1bba3d0f3b04705380ae61e4d2c71043",
                "sha256": "24beb022e0f5f1a68c9e45f03a96c34dab340f686e2a09a30b184a9a6f6740e5"
            },
            "downloads": -1,
            "filename": "parser201-1.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1bba3d0f3b04705380ae61e4d2c71043",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8703,
            "upload_time": "2024-11-15T17:19:46",
            "upload_time_iso_8601": "2024-11-15T17:19:46.272876Z",
            "url": "https://files.pythonhosted.org/packages/17/72/89a0fe04f4768844828300d247a8ba155ff37091a3858de43aa9afc5aed9/parser201-1.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6b58c2abf62d457f2a6892768ee3e28283b0b8e5e0ddf95a970f0949cc78806a",
                "md5": "73ad718d3fcdf395dedc088540a3556f",
                "sha256": "911047e1847b2cec77454684c0143b8f4e73e575f6a937e66b222031ec2918c9"
            },
            "downloads": -1,
            "filename": "parser201-1.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "73ad718d3fcdf395dedc088540a3556f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8768,
            "upload_time": "2024-11-15T17:19:47",
            "upload_time_iso_8601": "2024-11-15T17:19:47.187013Z",
            "url": "https://files.pythonhosted.org/packages/6b/58/c2abf62d457f2a6892768ee3e28283b0b8e5e0ddf95a970f0949cc78806a/parser201-1.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 17:19:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "geozeke",
    "github_project": "parser201",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "parser201"
}
        
Elapsed time: 0.64921s