ioproc


Nameioproc JSON
Version 2.1.2 PyPI version JSON
download
home_pagehttps://gitlab.com/dlr-ve/ioproc
SummaryWorkflow framework for data pre- and postprocessing.
upload_time2024-02-08 13:42:21
maintainerFelix Nitsch, Benjamin Fuchs, Jan Buschmann
docs_urlNone
authorFelix Nitsch, Benjamin Fuchs, Judith Riehm, Jan Buschmann
requires_python>=3.8
licenseMIT
keywords workflow management data pipeline data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/ioproc.svg)](https://badge.fury.io/py/ioproc)
[![PyPI license](https://img.shields.io/pypi/l/ioproc.svg)](https://badge.fury.io/py/ioproc)
[![pipeline status](https://gitlab.dlr.de/ioproc/ioproc/badges/development/pipeline.svg)](https://gitlab.dlr.de/ioproc/ioproc/-/commits/development)
[![coverage report](https://gitlab.dlr.de/ioproc/ioproc/badges/development/coverage.svg)](https://gitlab.dlr.de/ioproc/ioproc/-/commits/development) 

# The ioProc workflow manager
`ioproc` is a light-weight workflow manager for Python ensuring robust, scalable and reproducible data pipelines. The tool is developed at the German Aerospace Center (DLR) for and in the scientific context of energy systems analysis, however, it is widely applicable in other scientific fields.

## how-to install
Setup a new Python environment and install ioProc using 

    pip install ioproc   

## how-to configure

Configure your pipeline in the `user.yaml`. The `workflow` is defined by a list of actions. These must
contain the fields `project`, `call` and `data` (with sub fields `read_from_dmgr`, and `write_to_dmgr`). The user
may specify additional fields for each action under the optional key `args`.  
You may get inspiration from the default actions in `general.py`.

You may also have a look into the [snippets](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets) section where several basic `ioproc` functionalities are described:
- [Set up your first workflow](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327213)
- [Define your first action](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327210)
- [Make use of checkpoints](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327214)
- [Define an action making use of the ioproc datamanger](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327212)
- [Add additional yaml files to your workflow](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327209)
- [Define global parameters](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327207)
- [Starting ioproc workflow via command line with additional input parameters](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327208) 

## default actions provided by ioProc

### `readExcel`
This function is used to parse Excel files and storing it in the Data manager.

```python
@action('general')
def parse_excel(dmgr, config, params):
    '''
    Parses given `excelFile` for specified `excelSheets` as dataframe object and stores it in the datamanager by the 
    key specified in `write_to_dmgr`.
    `excelHeader` can be set to `True` or `False`.
    
    The action may be specified in the user.yaml as follows:
    - action:
        project: general
        call: parse_excel
        data:
            read_from_dmgr: null
            write_to_dmgr: parsedData
        args:  
            excelFile: spreadsheet.xlsx
            excelSheet: sheet1
            excelHeader: True
    '''

    args = params['args']
    file = get_field(args, 'excelFile')
    excel_sheet = get_excel_sheet(args)
    header = get_header(get_field(args, 'excelHeader'))
    parsed_excel = pd.read_excel(io=file, sheet_name=excel_sheet, header=header)

    with dmgr.overwrite:
        dmgr[params['data']['write_to_dmgr']] = parsed_excel
```

### `checkpoint`
Checkpoints save the current state and content of the data manger to disk in HDF5 format. The workflow can be resumed at any time from previously created checkpoints.

```python
@action('general')
def checkpoint(dmgr, config, params):
    '''
    creates a checkpoint file in the current working directory with name
    Cache_TAG while TAG is supplied by the action config.

    :param tag: the tag for this checkpoint, this can never be "start"
    '''
    assert params['tag'] != 'start', 'checkpoints can not be named start'
    dmgr.toCache(params['tag'])
    mainlogger.info('set checkpoint "{}"'.format(params['tag']))
```

### `printData`
This action prints all data stored in the data manager to the console. It can therefore be used for conveniently debugging a workflow.

```python
@action('general')
def printData(dmgr, config, params):
    '''
    simple debugging printing function. Prints all data in the data manager.

    Does not have any parameters.
    '''
    for k, v in dmgr.items():
        mainlogger.info(k+' = \n'+str(v))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/dlr-ve/ioproc",
    "name": "ioproc",
    "maintainer": "Felix Nitsch, Benjamin Fuchs, Jan Buschmann",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "ioproc@dlr.de",
    "keywords": "workflow management,data pipeline,data science",
    "author": "Felix Nitsch, Benjamin Fuchs, Judith Riehm, Jan Buschmann",
    "author_email": "felix.nitsch@dlr.de, benjamin.fuchs@dlr.de, judith.riehm@dlr.de, jan.buschmann@dlr.de",
    "download_url": "https://files.pythonhosted.org/packages/f1/64/707c7e45a4aea22e66b30518db79cc66995beb5f59e4314f3a3bd764c399/ioproc-2.1.2.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/ioproc.svg)](https://badge.fury.io/py/ioproc)\n[![PyPI license](https://img.shields.io/pypi/l/ioproc.svg)](https://badge.fury.io/py/ioproc)\n[![pipeline status](https://gitlab.dlr.de/ioproc/ioproc/badges/development/pipeline.svg)](https://gitlab.dlr.de/ioproc/ioproc/-/commits/development)\n[![coverage report](https://gitlab.dlr.de/ioproc/ioproc/badges/development/coverage.svg)](https://gitlab.dlr.de/ioproc/ioproc/-/commits/development) \n\n# The ioProc workflow manager\n`ioproc` is a light-weight workflow manager for Python ensuring robust, scalable and reproducible data pipelines. The tool is developed at the German Aerospace Center (DLR) for and in the scientific context of energy systems analysis, however, it is widely applicable in other scientific fields.\n\n## how-to install\nSetup a new Python environment and install ioProc using \n\n    pip install ioproc   \n\n## how-to configure\n\nConfigure your pipeline in the `user.yaml`. The `workflow` is defined by a list of actions. These must\ncontain the fields `project`, `call` and `data` (with sub fields `read_from_dmgr`, and `write_to_dmgr`). The user\nmay specify additional fields for each action under the optional key `args`.  \nYou may get inspiration from the default actions in `general.py`.\n\nYou may also have a look into the [snippets](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets) section where several basic `ioproc` functionalities are described:\n- [Set up your first workflow](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327213)\n- [Define your first action](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327210)\n- [Make use of checkpoints](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327214)\n- [Define an action making use of the ioproc datamanger](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327212)\n- [Add additional yaml files to your workflow](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327209)\n- [Define global parameters](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327207)\n- [Starting ioproc workflow via command line with additional input parameters](https://gitlab.com/dlr-ve/esy/ioproc/-/snippets/2327208) \n\n## default actions provided by ioProc\n\n### `readExcel`\nThis function is used to parse Excel files and storing it in the Data manager.\n\n```python\n@action('general')\ndef parse_excel(dmgr, config, params):\n    '''\n    Parses given `excelFile` for specified `excelSheets` as dataframe object and stores it in the datamanager by the \n    key specified in `write_to_dmgr`.\n    `excelHeader` can be set to `True` or `False`.\n    \n    The action may be specified in the user.yaml as follows:\n    - action:\n        project: general\n        call: parse_excel\n        data:\n            read_from_dmgr: null\n            write_to_dmgr: parsedData\n        args:  \n            excelFile: spreadsheet.xlsx\n            excelSheet: sheet1\n            excelHeader: True\n    '''\n\n    args = params['args']\n    file = get_field(args, 'excelFile')\n    excel_sheet = get_excel_sheet(args)\n    header = get_header(get_field(args, 'excelHeader'))\n    parsed_excel = pd.read_excel(io=file, sheet_name=excel_sheet, header=header)\n\n    with dmgr.overwrite:\n        dmgr[params['data']['write_to_dmgr']] = parsed_excel\n```\n\n### `checkpoint`\nCheckpoints save the current state and content of the data manger to disk in HDF5 format. The workflow can be resumed at any time from previously created checkpoints.\n\n```python\n@action('general')\ndef checkpoint(dmgr, config, params):\n    '''\n    creates a checkpoint file in the current working directory with name\n    Cache_TAG while TAG is supplied by the action config.\n\n    :param tag: the tag for this checkpoint, this can never be \"start\"\n    '''\n    assert params['tag'] != 'start', 'checkpoints can not be named start'\n    dmgr.toCache(params['tag'])\n    mainlogger.info('set checkpoint \"{}\"'.format(params['tag']))\n```\n\n### `printData`\nThis action prints all data stored in the data manager to the console. It can therefore be used for conveniently debugging a workflow.\n\n```python\n@action('general')\ndef printData(dmgr, config, params):\n    '''\n    simple debugging printing function. Prints all data in the data manager.\n\n    Does not have any parameters.\n    '''\n    for k, v in dmgr.items():\n        mainlogger.info(k+' = \\n'+str(v))\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Workflow framework for data pre- and postprocessing.",
    "version": "2.1.2",
    "project_urls": {
        "Homepage": "https://gitlab.com/dlr-ve/ioproc"
    },
    "split_keywords": [
        "workflow management",
        "data pipeline",
        "data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2dc97d2a1d8164b49cb4763ec71af85115c3a8a7adcdb16c494ff57fa4ae39f",
                "md5": "4292c45173503ab9c11d81c2c773afd9",
                "sha256": "b3ec15f6f11e41159aa178592406d3230e74873adf974f61a45c977c1c69bda2"
            },
            "downloads": -1,
            "filename": "ioproc-2.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4292c45173503ab9c11d81c2c773afd9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 27663,
            "upload_time": "2024-02-08T13:42:19",
            "upload_time_iso_8601": "2024-02-08T13:42:19.584733Z",
            "url": "https://files.pythonhosted.org/packages/b2/dc/97d2a1d8164b49cb4763ec71af85115c3a8a7adcdb16c494ff57fa4ae39f/ioproc-2.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f164707c7e45a4aea22e66b30518db79cc66995beb5f59e4314f3a3bd764c399",
                "md5": "8a3fe84c224d946d5ac32aa4a23813e0",
                "sha256": "780a15144e0ceaacc86cedf55229dd33c0e2bb526e98585eeda97eb6fae45fda"
            },
            "downloads": -1,
            "filename": "ioproc-2.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8a3fe84c224d946d5ac32aa4a23813e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20326,
            "upload_time": "2024-02-08T13:42:21",
            "upload_time_iso_8601": "2024-02-08T13:42:21.426594Z",
            "url": "https://files.pythonhosted.org/packages/f1/64/707c7e45a4aea22e66b30518db79cc66995beb5f59e4314f3a3bd764c399/ioproc-2.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 13:42:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "dlr-ve",
    "gitlab_project": "ioproc",
    "lcname": "ioproc"
}
        
Elapsed time: 0.19529s