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.6.tar.gz (248.0 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.6-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ukaea_multiparser-1.0.6.tar.gz
  • Upload date:
  • Size: 248.0 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.6.tar.gz
Algorithm Hash digest
SHA256 a9e7c5854d102a8ce5b28fc1401170254890d98705177dc2f2560ae09f811fa9
MD5 fbabf883706228ae7faa3736a09ca3a9
BLAKE2b-256 6664cabd898cd58d50d601fe5ab8dfb74663f001e8ea13e9d88248db8d409de3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ukaea_multiparser-1.0.6.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.6-py3-none-any.whl.

File metadata

File hashes

Hashes for ukaea_multiparser-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f53de51bf7035d84360d4250480581bf3e1f403b9b193b7dca552b124a115280
MD5 47fcf4123b3fa5380bee3e6c324dc7a7
BLAKE2b-256 15b8e673139ce2d56d212e78c97e63486705644bcb6d3953449472377a93bf08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ukaea_multiparser-1.0.6-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