Skip to main content

Multiple File Parser for monitoring and processing updates to a given set of output files.

Project description

Multiparser

PyPI Latest Release PyPI - Python Version multiparser Code style: 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:

pip install ukaea-multiparser

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

pip install ukaea-multiparser[fortran,arrow]

Example

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.

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 file.


Copyright (c) 2024 UK Atomic Energy Authority

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ukaea_multiparser-1.0.5.tar.gz (247.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ukaea_multiparser-1.0.5-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file ukaea_multiparser-1.0.5.tar.gz.

File metadata

  • Download URL: ukaea_multiparser-1.0.5.tar.gz
  • Upload date:
  • Size: 247.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ukaea_multiparser-1.0.5.tar.gz
Algorithm Hash digest
SHA256 0d5c78c4fcba248499cc3a54d84c20aee00d12e3eb1803f7f93415b250e02f58
MD5 d21f0621e270f7433ac4e407f8d992c1
BLAKE2b-256 a248d7224e0cce0811e2476923be9e689395e261289eb5c51fc92bd3aacecd48

See more details on using hashes here.

Provenance

The following attestation bundles were made for ukaea_multiparser-1.0.5.tar.gz:

Publisher: python-publish.yml on ukaea/Multiparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ukaea_multiparser-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ukaea_multiparser-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c11fd5c6f0016268061f4840882a5033995733113703647a1cf5c9b20b50f1e4
MD5 486338648443271f013ad3692dfce3f5
BLAKE2b-256 6cb44366f8208e2b2792ac336c35e398fa016d19b632cff7cfdeee23805d7350

See more details on using hashes here.

Provenance

The following attestation bundles were made for ukaea_multiparser-1.0.5-py3-none-any.whl:

Publisher: python-publish.yml on ukaea/Multiparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page