{ "info": { "author": "Romain TAPREST", "author_email": "romain@taprest.fr", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# yapyseq\n\nYet Another Python Sequencer\n\n| Item | master | dev |\n| ------------- | ------------- | ----- |\n| CI status | [![Build Status](https://travis-ci.com/RomainTT/yapyseq.svg?branch=master)](https://travis-ci.com/RomainTT/yapyseq) | [![Build Status](https://travis-ci.com/RomainTT/yapyseq.svg?branch=dev)](https://travis-ci.com/RomainTT/yapyseq) |\n| version | [![Pypi](https://img.shields.io/pypi/v/yapyseq.svg)](https://pypi.org/project/yapyseq/) | N/A |\n\n## Overview\n\nIf you have a bunch of Python functions in a bunch of files, which can be called\nin various orders in function of the need, you have two choices:\n\n* Call these functions in classic python scripts, ordering the calls with\n Python statements. You have to write from scratch the conditional structures,\n the multiprocessing management if necessary, and eventually write a lot of \n code.\n* Use yapyseq to write a sequence. A sequence file has its own syntax, it makes\n references to Python functions that must be called. The calls, the conditional\n transitions between them, the multiprocessing, the logging, all of these\n things are automatically managed by yapyseq without writing a single line of\n Python code.\n\n![yapyseq principle](doc/resources/yapyseq_principle.png)\n\n\n## Installation\n\nyapyseq is on the [Pypi](https://pypi.org) server. To install it, \nyou can use `pip`:\n\n pip install yapyseq\n\n\n## Quick-start\n\nLet's assume that you have a project in the directory `project/` with a \nsub-directory `project/functions` containing some Python files like\n `project/functions/hello.py`, and some functions like the following ones:\n\n```python\nimport os\n\ndef hello(name):\n print('Hello {}!'.format(name))\n\ndef list_path(path):\n print(os.listdir(path))\n```\n\nNow create a sequence file anywhere, for instance `project/my_sequence.yaml`. \nHere is the content of a sequence to call `list_path`, and if no exception has \nbeen raised then call `hello`:\n\n![quickstart sequence](doc/resources/ex_quickstart.png)\n\n```yaml\nsequence:\n\n nodes:\n - id: 0\n type: start\n transitions:\n - target: 1\n\n - id: 1\n type: function\n function: list_path\n arguments:\n path: \"/tmp/\"\n transitions:\n - target: 2\n condition: not results[1].exception\n - target: 3\n condition: results[1].exception\n\n - id: 2\n type: function\n function: hello\n arguments:\n name: \"John\"\n transitions:\n - target: 3\n\n - id: 3\n type: stop\n```\n\nTo run the sequence in command line, run the following command in a terminal:\n\n```bash\nyapyseq run Project/my_sequence.yaml Project/Functions\n```\n\nThe command `yapyseq run` takes as arguments: the path to the sequence file\nand the path to the directory containing the Python functions.\n\nAfter pressing enter, you should see the output of `list_path()` and `hello()`\nin the terminal.\n\nTo run the sequence using `yapyseq` as a Python module, run the following code:\n\n```python\nfrom yapyseq import SequenceRunner\n\nsr = SequenceRunner('Project/my_sequence.yaml', 'Project/Functions')\nsr.run()\n```\n\nOf course, for an example that simple, making a sequence with yapyseq requires\nmore work than calling the functions in a simple Python script. But it is just\nan example to start, and yapyseq will be much more useful in more complex\nsituations. Please read the next sections to learn more.\n\n## More details for users\n\nTo get more details about how to use `yapyseq`, please read the\n[user documentation](doc/userdoc.md).\n\n## Contributions\n\nContributions are welcome from anyone ! To have a better understanding of the\ninternal structure of `yapyseq` and to know more about the integration\nprocess, please read the [developer documentation](doc/devdoc.md).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RomainTT/yapyseq", "keywords": "", "license": "MPL-2.0", "maintainer": "", "maintainer_email": "", "name": "yapyseq", "package_url": "https://pypi.org/project/yapyseq/", "platform": "", "project_url": "https://pypi.org/project/yapyseq/", "project_urls": { "Homepage": "https://github.com/RomainTT/yapyseq" }, "release_url": "https://pypi.org/project/yapyseq/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Yet Another Python Sequencer", "version": "1.1.0" }, "last_serial": 5366394, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "082c9210e172014b1041658b7c866c0d", "sha256": "487398ee65c2494a70937ba6b364390405994db0a69fa3b02c9eb25147f686d4" }, "downloads": -1, "filename": "yapyseq-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "082c9210e172014b1041658b7c866c0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24016, "upload_time": "2018-12-08T11:58:06", "url": "https://files.pythonhosted.org/packages/8c/6b/95f67a2d2be05ca9a1ddf7f0e407aa6d8cdf6d4dc05432250cd5f209c33d/yapyseq-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "995db09b7bd8512c4bf933e6de03ec5c", "sha256": "e479e7986bc1b16ed9bc4909fb32ec5707fd14989e7ccce125fa9ab99c59e5b4" }, "downloads": -1, "filename": "yapyseq-1.0.0.tar.gz", "has_sig": false, "md5_digest": "995db09b7bd8512c4bf933e6de03ec5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14760, "upload_time": "2018-12-08T11:58:08", "url": "https://files.pythonhosted.org/packages/28/cd/12dfc91c74bc21d759e1fb9f67766ed57d771fd310128678a6c1bcb4d78a/yapyseq-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "514fc1f3a85e8b208acec458780bbcba", "sha256": "59c9395fcb86076201eaf9312000d878f3e98a3d039adb316e981de6d1029f3d" }, "downloads": -1, "filename": "yapyseq-1.1.0.tar.gz", "has_sig": false, "md5_digest": "514fc1f3a85e8b208acec458780bbcba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22356, "upload_time": "2019-06-06T09:36:03", "url": "https://files.pythonhosted.org/packages/3a/3d/6ad439faffe4f9494bfc1023d1529a21ea68e422f199293bfc3769aaada8/yapyseq-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "514fc1f3a85e8b208acec458780bbcba", "sha256": "59c9395fcb86076201eaf9312000d878f3e98a3d039adb316e981de6d1029f3d" }, "downloads": -1, "filename": "yapyseq-1.1.0.tar.gz", "has_sig": false, "md5_digest": "514fc1f3a85e8b208acec458780bbcba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22356, "upload_time": "2019-06-06T09:36:03", "url": "https://files.pythonhosted.org/packages/3a/3d/6ad439faffe4f9494bfc1023d1529a21ea68e422f199293bfc3769aaada8/yapyseq-1.1.0.tar.gz" } ] }