Skip to main content

GxMMx Flow core functionality

Project description

Flow Core Test

GxMMx Flow Core Test is a Python package for Flow's core functionality.

Flow Core is the building block used and extended by Flow images for workflows.
It consists of basic configuration, validation and management of Flow parameters.

Change 2

Information

Requirements

Python 3.11+

Installation

Package is available on PyPI and installable via pip:

pip install gxmmx-flow-core

Usage

from gxmmx_flow_core_test import Flow, FlowLog, FlowCodeQuality, FlowValidationError

# Add config_param decorator to function
# Declares validation for a config parameter.
# This value must be an integer.
# In this case if the value is not present in the config,
# the value gets a default of 15.
# If it is greater than 30 it is invalid, and an exception is raised.
@Flow.config_param()
def param_some_int(value):
    if value is None:
        value = 15
    if not isinstance(value, int):
        raise FlowValidationError("some_int must be an integer")
    if value > 30:
        raise FlowValidationError("some_int must be 30 or less")
    return value

# Creates directory and parent directories
# under the root dir that the program is called from.
Flow.ensure_directory("my_build_dir")

# Creates a code quality report that logs errors
# to stdout as well as creates a report.
cq_report = FlowCodeQuality("my_report")

# Looks for and loads flow.yml config file.
# Can be specified by 'FLOW_CONFIG_PATH' env variable.
Flow.start()

# dummy logic
something_failed_in_file_txt = True
if something_failed_in_file_txt:
    cq_report.critical(name="my-error",
                       desc="description of error",
                       path="file.txt", begin=14)

FlowLog.msg("This is a normal message")
FlowLog.wrn("This is a warning message")

# Finish report and write it out.
# If there are errors, the program will exit with error.
cq_report.write()

Development

Development documentation can be found under the projects docs.

Changes

Version history with features and bugfixes, as well as upcoming features and roadmap
depicted in CHANGELOG.md

Contributing

Any contributions are greatly appreciated. See CONTRIBUTING.md for more information.

Contributors

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Guðmundur Guðmundsson - gummigudm@gmail.com

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

gxmmx_flow_core_test-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

gxmmx_flow_core_test-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file gxmmx_flow_core_test-0.1.0.tar.gz.

File metadata

  • Download URL: gxmmx_flow_core_test-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/5.15.154+

File hashes

Hashes for gxmmx_flow_core_test-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b6ec9a0f38d4829f29292e9609d5c6ccfdd88748eb27f21e3f7e72930cd485a
MD5 09bce0342bb9dd427e5b2cd22d615dd6
BLAKE2b-256 c4a604ec9a3b35d1bfbf5a66a9fe0082be42e42e8ffecdb3d8c50bac862b2205

See more details on using hashes here.

File details

Details for the file gxmmx_flow_core_test-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gxmmx_flow_core_test-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b9c79484f5e9758ee6aad3b17b319bfb3adb9b599306cfc762767b05f64210b
MD5 34121b60b9c12cc9d81ed72b2d34212c
BLAKE2b-256 5cdd3524221c497facf684771852683685012314d537453cb8c7c320c71a1bd6

See more details on using hashes here.

Supported by

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