ukaea-multiparser


Nameukaea-multiparser JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryMultiple File Parser for monitoring and processing updates to a given set of output files.
upload_time2024-10-29 10:11:19
maintainerNone
docs_urlNone
authorKristian Zarębski
requires_python<3.14,>=3.10
licenseNone
keywords parsing monitoring logging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<img src="https://raw.githubusercontent.com/ukaea/Multiparser/main/docs/media/logo.png", width="200">
</p>

# Multiparser
[![PyPI Latest Release](https://img.shields.io/pypi/v/ukaea-multiparser.svg)](https://pypi.org/project/ukaea-multiparser/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ukaea-multiparser)
 [![multiparser](https://github.com/ukaea/multiparser/actions/workflows/test_run_multiparser.yaml/badge.svg?branch=main)](https://github.com/ukaea/multiparser/actions/workflows/test_run_multiparser.yaml)
 [![Code style: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

_Multiparser_ is module for performing functionality across a set of output files. Given a set of files, and optionally a list of output parameter names or regex filters the module keeps track of changes by monitoring the "last modified" timestamp of each file and executing the assigned callback.

For example, in the case where a set of model outputs were written to a set of files the user is able to specify which files are of importance, the variables to be noted within these files, and a function to execute whenever a change is made to one of these files.

## Installation

The module is available in PyPi:

```sh
pip install ukaea-multiparser
```

To install optional extras `arrow` and `fortran` list them during the install, e.g.:

```sh
pip install ukaea-multiparser[fortran,arrow]
```

## Example

```python
with FileMonitor(
    per_thread_callback=callback_function,
    lock_callback=True,
    interval=10.0,
    flatten_data=True
) as monitor:
    monitor.track(
        path_glob_exprs=["file_of_interest.toml", "out_dir/*.other"],
        tracked_values=[
            "list", "of", "interesting", "values",
            re.compile(r"^list"),
            re.compile(r"of\s"),
            re.compile(r"regular"),
            re.compile(r"Expressions")
        ],
        static=True
    )
    monitor.run()
    ...
    monitor.terminate()
```

## Documentation

For information on use and functionality please see the [documentation](https://ukaea.github.io/Multiparser/).

## Licensing

_Multiparser_ is provided under the MIT license allowing reuse within both open source and proprietary software.

## Contributing

For contributions and development towards improving _Multiparser_ please see the included [CONTRIBUTING.md](https://github.com/ukaea/Multiparser/blob/main/CONTRIBUTING.md) file.

---

Copyright (c) 2024 UK Atomic Energy Authority


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ukaea-multiparser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10",
    "maintainer_email": null,
    "keywords": "parsing, monitoring, logging",
    "author": "Kristian Zar\u0119bski",
    "author_email": "kristian.zarebski@ukaea.uk",
    "download_url": "https://files.pythonhosted.org/packages/1f/48/a3943a88b3faa4dfda359223c52cd9128098d1b5fff6b2f6d93da445803c/ukaea_multiparser-1.0.4.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n<img src=\"https://raw.githubusercontent.com/ukaea/Multiparser/main/docs/media/logo.png\", width=\"200\">\n</p>\n\n# Multiparser\n[![PyPI Latest Release](https://img.shields.io/pypi/v/ukaea-multiparser.svg)](https://pypi.org/project/ukaea-multiparser/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ukaea-multiparser)\n [![multiparser](https://github.com/ukaea/multiparser/actions/workflows/test_run_multiparser.yaml/badge.svg?branch=main)](https://github.com/ukaea/multiparser/actions/workflows/test_run_multiparser.yaml)\n [![Code style: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n_Multiparser_ is module for performing functionality across a set of output files. Given a set of files, and optionally a list of output parameter names or regex filters the module keeps track of changes by monitoring the \"last modified\" timestamp of each file and executing the assigned callback.\n\nFor example, in the case where a set of model outputs were written to a set of files the user is able to specify which files are of importance, the variables to be noted within these files, and a function to execute whenever a change is made to one of these files.\n\n## Installation\n\nThe module is available in PyPi:\n\n```sh\npip install ukaea-multiparser\n```\n\nTo install optional extras `arrow` and `fortran` list them during the install, e.g.:\n\n```sh\npip install ukaea-multiparser[fortran,arrow]\n```\n\n## Example\n\n```python\nwith FileMonitor(\n    per_thread_callback=callback_function,\n    lock_callback=True,\n    interval=10.0,\n    flatten_data=True\n) as monitor:\n    monitor.track(\n        path_glob_exprs=[\"file_of_interest.toml\", \"out_dir/*.other\"],\n        tracked_values=[\n            \"list\", \"of\", \"interesting\", \"values\",\n            re.compile(r\"^list\"),\n            re.compile(r\"of\\s\"),\n            re.compile(r\"regular\"),\n            re.compile(r\"Expressions\")\n        ],\n        static=True\n    )\n    monitor.run()\n    ...\n    monitor.terminate()\n```\n\n## Documentation\n\nFor information on use and functionality please see the [documentation](https://ukaea.github.io/Multiparser/).\n\n## Licensing\n\n_Multiparser_ is provided under the MIT license allowing reuse within both open source and proprietary software.\n\n## Contributing\n\nFor contributions and development towards improving _Multiparser_ please see the included [CONTRIBUTING.md](https://github.com/ukaea/Multiparser/blob/main/CONTRIBUTING.md) file.\n\n---\n\nCopyright (c) 2024 UK Atomic Energy Authority\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Multiple File Parser for monitoring and processing updates to a given set of output files.",
    "version": "1.0.4",
    "project_urls": {
        "Change Log": "https://github.com/ukaea/Multiparser/blob/main/CHANGELOG.md",
        "Documentation": "https://ukaea.github.io/Multiparser/",
        "Issues": "https://github.com/ukaea/Multiparser/issues",
        "Repository": "https://github.com/ukaea/Multiparser"
    },
    "split_keywords": [
        "parsing",
        " monitoring",
        " logging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2648e079a5f2399a55ab2c197dca05b0112c3f8a0eca452b70c22fbb2d618e7c",
                "md5": "a7ee6d9f5fb4a0157284a1979491d314",
                "sha256": "4b467c94116d25d26dff083d801f32bf696781a0d47beebad9fb277dcb954692"
            },
            "downloads": -1,
            "filename": "ukaea_multiparser-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a7ee6d9f5fb4a0157284a1979491d314",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10",
            "size": 25730,
            "upload_time": "2024-10-29T10:11:18",
            "upload_time_iso_8601": "2024-10-29T10:11:18.881895Z",
            "url": "https://files.pythonhosted.org/packages/26/48/e079a5f2399a55ab2c197dca05b0112c3f8a0eca452b70c22fbb2d618e7c/ukaea_multiparser-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f48a3943a88b3faa4dfda359223c52cd9128098d1b5fff6b2f6d93da445803c",
                "md5": "1816bfa89905e9cd76be55e0ec69d64a",
                "sha256": "fbcd0c1c73095be202be5371af12056f5349b09a3a68577ec4e194f308d471e5"
            },
            "downloads": -1,
            "filename": "ukaea_multiparser-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1816bfa89905e9cd76be55e0ec69d64a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10",
            "size": 22269,
            "upload_time": "2024-10-29T10:11:19",
            "upload_time_iso_8601": "2024-10-29T10:11:19.921822Z",
            "url": "https://files.pythonhosted.org/packages/1f/48/a3943a88b3faa4dfda359223c52cd9128098d1b5fff6b2f6d93da445803c/ukaea_multiparser-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 10:11:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ukaea",
    "github_project": "Multiparser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ukaea-multiparser"
}
        
Elapsed time: 0.62311s