gxmmx-flow-core-test


Namegxmmx-flow-core-test JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://gitlab.com/gxmmx/gitops/flow/core/flow-core-test
SummaryGxMMx Flow core functionality
upload_time2024-09-30 11:23:26
maintainerGudmundur Gudmundsson
docs_urlNone
authorGudmundur Gudmundsson
requires_python<4.0,>=3.11
licenseMIT
keywords gxmmx flow core library cicd workflow
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

<!-- Badges etc -->

## Information

### Requirements

Python 3.11+

## Installation

Package is available on [PyPI](https://pypi.org/project/gxmmx-flow-core-test/) and installable via pip:

``` shell
pip install gxmmx-flow-core
```

## Usage

``` python
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`](https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test).

## 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

* [gummigudm](https://gitlab.com/gummigudm)  

## License

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

## Contact

GuĂ°mundur GuĂ°mundsson - <gummigudm@gmail.com>

* Gitlab - [gummigudm](https://gitlab.com/gummigudm)  
* Github - [gummigudm](https://github.com/gummigudm)

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test",
    "name": "gxmmx-flow-core-test",
    "maintainer": "Gudmundur Gudmundsson",
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": "gummigudm@gmail.com",
    "keywords": "gxmmx, flow, core, library, cicd, workflow",
    "author": "Gudmundur Gudmundsson",
    "author_email": "gummigudm@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c4/a6/04ec9a3b35d1bfbf5a66a9fe0082be42e42e8ffecdb3d8c50bac862b2205/gxmmx_flow_core_test-0.1.0.tar.gz",
    "platform": null,
    "description": "# Flow Core Test\n\nGxMMx Flow Core Test is a Python package for Flow's core functionality.  \n\nFlow Core is the building block used and extended by Flow images for workflows.  \nIt consists of basic configuration, validation and management of Flow parameters.\n\nChange 2\n\n<!-- Badges etc -->\n\n## Information\n\n### Requirements\n\nPython 3.11+\n\n## Installation\n\nPackage is available on [PyPI](https://pypi.org/project/gxmmx-flow-core-test/) and installable via pip:\n\n``` shell\npip install gxmmx-flow-core\n```\n\n## Usage\n\n``` python\nfrom gxmmx_flow_core_test import Flow, FlowLog, FlowCodeQuality, FlowValidationError\n\n# Add config_param decorator to function\n# Declares validation for a config parameter.\n# This value must be an integer.\n# In this case if the value is not present in the config,\n# the value gets a default of 15.\n# If it is greater than 30 it is invalid, and an exception is raised.\n@Flow.config_param()\ndef param_some_int(value):\n    if value is None:\n        value = 15\n    if not isinstance(value, int):\n        raise FlowValidationError(\"some_int must be an integer\")\n    if value > 30:\n        raise FlowValidationError(\"some_int must be 30 or less\")\n    return value\n\n# Creates directory and parent directories\n# under the root dir that the program is called from.\nFlow.ensure_directory(\"my_build_dir\")\n\n# Creates a code quality report that logs errors\n# to stdout as well as creates a report.\ncq_report = FlowCodeQuality(\"my_report\")\n\n# Looks for and loads flow.yml config file.\n# Can be specified by 'FLOW_CONFIG_PATH' env variable.\nFlow.start()\n\n# dummy logic\nsomething_failed_in_file_txt = True\nif something_failed_in_file_txt:\n    cq_report.critical(name=\"my-error\",\n                       desc=\"description of error\",\n                       path=\"file.txt\", begin=14)\n\nFlowLog.msg(\"This is a normal message\")\nFlowLog.wrn(\"This is a warning message\")\n\n# Finish report and write it out.\n# If there are errors, the program will exit with error.\ncq_report.write()\n```\n\n## Development\n\nDevelopment documentation can be found under the projects\n[`docs`](https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test).\n\n## Changes\n\nVersion history with features and bugfixes, as well as upcoming features and roadmap  \ndepicted in `CHANGELOG.md`\n\n## Contributing\n\nAny contributions are greatly appreciated. See `CONTRIBUTING.md` for more information.\n\n### Contributors\n\n* [gummigudm](https://gitlab.com/gummigudm)  \n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nGu\u00f0mundur Gu\u00f0mundsson - <gummigudm@gmail.com>\n\n* Gitlab - [gummigudm](https://gitlab.com/gummigudm)  \n* Github - [gummigudm](https://github.com/gummigudm)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GxMMx Flow core functionality",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test/-/blob/main/README.md",
        "Homepage": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test",
        "Repository": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core-test"
    },
    "split_keywords": [
        "gxmmx",
        " flow",
        " core",
        " library",
        " cicd",
        " workflow"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cdd3524221c497facf684771852683685012314d537453cb8c7c320c71a1bd6",
                "md5": "34121b60b9c12cc9d81ed72b2d34212c",
                "sha256": "1b9c79484f5e9758ee6aad3b17b319bfb3adb9b599306cfc762767b05f64210b"
            },
            "downloads": -1,
            "filename": "gxmmx_flow_core_test-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34121b60b9c12cc9d81ed72b2d34212c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 6955,
            "upload_time": "2024-09-30T11:23:24",
            "upload_time_iso_8601": "2024-09-30T11:23:24.677158Z",
            "url": "https://files.pythonhosted.org/packages/5c/dd/3524221c497facf684771852683685012314d537453cb8c7c320c71a1bd6/gxmmx_flow_core_test-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4a604ec9a3b35d1bfbf5a66a9fe0082be42e42e8ffecdb3d8c50bac862b2205",
                "md5": "09bce0342bb9dd427e5b2cd22d615dd6",
                "sha256": "6b6ec9a0f38d4829f29292e9609d5c6ccfdd88748eb27f21e3f7e72930cd485a"
            },
            "downloads": -1,
            "filename": "gxmmx_flow_core_test-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "09bce0342bb9dd427e5b2cd22d615dd6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 6430,
            "upload_time": "2024-09-30T11:23:26",
            "upload_time_iso_8601": "2024-09-30T11:23:26.186453Z",
            "url": "https://files.pythonhosted.org/packages/c4/a6/04ec9a3b35d1bfbf5a66a9fe0082be42e42e8ffecdb3d8c50bac862b2205/gxmmx_flow_core_test-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 11:23:26",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "gxmmx",
    "gitlab_project": "gitops",
    "lcname": "gxmmx-flow-core-test"
}
        
Elapsed time: 0.47499s