gxmmx-flow-core


Namegxmmx-flow-core JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://gitlab.com/gxmmx/gitops/flow/core/flow-core
SummaryGxMMx Flow core functionality
upload_time2024-09-30 22:04:31
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

GxMMx Flow Core 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.

<!-- Badges etc -->

## Information

### Requirements

Python 3.11+

## Installation

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

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

## Usage

``` python
from gxmmx_flow_core 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).

## 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",
    "name": "gxmmx-flow-core",
    "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/82/c4/2304bd582c8540bd71a4af7aceee1eb5050c03d334805885a9a812575653/gxmmx_flow_core-0.1.0.tar.gz",
    "platform": null,
    "description": "# Flow Core\n\nGxMMx Flow Core 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\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/) and installable via pip:\n\n``` shell\npip install gxmmx-flow-core\n```\n\n## Usage\n\n``` python\nfrom gxmmx_flow_core 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).\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/-/blob/main/README.md",
        "Homepage": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core",
        "Repository": "https://gitlab.com/gxmmx/gitops/flow/core/flow-core"
    },
    "split_keywords": [
        "gxmmx",
        " flow",
        " core",
        " library",
        " cicd",
        " workflow"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e981be69a545556063f42cb2e7773ff714a3cd62b903c00662a5e90fe5f059cb",
                "md5": "33de7ff6f95bf9be911803b99ef1690c",
                "sha256": "4d805b499fa86e766161f44256193286d90be0623fa2e7d26a849b882d6a4b6e"
            },
            "downloads": -1,
            "filename": "gxmmx_flow_core-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33de7ff6f95bf9be911803b99ef1690c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 6843,
            "upload_time": "2024-09-30T22:04:30",
            "upload_time_iso_8601": "2024-09-30T22:04:30.105486Z",
            "url": "https://files.pythonhosted.org/packages/e9/81/be69a545556063f42cb2e7773ff714a3cd62b903c00662a5e90fe5f059cb/gxmmx_flow_core-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82c42304bd582c8540bd71a4af7aceee1eb5050c03d334805885a9a812575653",
                "md5": "d7db05a61e4e5ccccacc85f8736ebac3",
                "sha256": "f4578e4c7c86a6bf21304b4b376f7b7b34c0a5add747ab259dc6806ae550074b"
            },
            "downloads": -1,
            "filename": "gxmmx_flow_core-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d7db05a61e4e5ccccacc85f8736ebac3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 6402,
            "upload_time": "2024-09-30T22:04:31",
            "upload_time_iso_8601": "2024-09-30T22:04:31.543579Z",
            "url": "https://files.pythonhosted.org/packages/82/c4/2304bd582c8540bd71a4af7aceee1eb5050c03d334805885a9a812575653/gxmmx_flow_core-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 22:04:31",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "gxmmx",
    "gitlab_project": "gitops",
    "lcname": "gxmmx-flow-core"
}
        
Elapsed time: 0.34294s