{ "info": { "author": "Sergio Garc\u00eda Prado", "author_email": "sergio@garciparedes.me", "bugtrack_url": null, "classifiers": [], "description": "# pascua\n\n[![PyPI](https://img.shields.io/pypi/v/pascua.svg)](https://pypi.org/project/pascua)\n[![Read the Docs](https://img.shields.io/readthedocs/pascua.svg)](https://pascua.readthedocs.io/)\n[![Travis (.org) branch](https://img.shields.io/travis/garciparedes/pascua/master.svg)](https://travis-ci.org/garciparedes/pascua/branches)\n[![Coveralls github](https://img.shields.io/coveralls/github/garciparedes/pascua.svg)](https://coveralls.io/github/garciparedes/pascua)\n[![GitHub](https://img.shields.io/github/license/garciparedes/pascua.svg)](https://github.com/garciparedes/pascua/blob/master/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/garciparedes/pascua.svg)](https://github.com/garciparedes/pascua)\n\n## Description \n\nPython library to perform code execution in fully isolated environments.\n\n**IMPORTANT**: This repository is in the early stage of development, so its not recommended to be used yet. Nevertheless, contributions are welcome!\n\n\n## Installation\n\nYou can install the latest ``pascua`` version via ``pip``:\n\n```bash\npip install pascua\n```\n\n## How it works?\n\n`pascua` allow us to perform code executions in isolated environments through containerization techniques. The main idea is that `pascua` builds a `docker` image with the given parameters defined in the corresponding implementation of the `Environment` constructor. \n\nWhen a call to `exec(.)` method is performed, it uses the generated `docker` image as the base in which it launches the proper interpreter or code compilation to execute the given `source_code` in combination with the variables defined in the `context` dictionary.\n\n## Usage\n\n### Python Environment\n\n```python\nimport pascua as psc\n\ncontext = {\n 'size': 100,\n}\n\nsource_code = [\n 'import numpy as np',\n 'random_numbers = np.random.uniform(size=size)',\n]\n\nenv = psc.PythonEnvironment(\n version='3.7.3', \n pip_dependencies=[\n 'numpy>=1.14.0',\n ]\n)\n\nresult = env.exec(source_code, context)\n```\n\n### R Environment\n\n```python\nimport pascua as psc\n\ncontext = {\n 'size': 100,\n}\n\nsource_code = [\n 'random_numbers <- runif(n = size)',\n]\n\nenv = psc.REnvironment(\n version='latest',\n)\n\nresult = env.exec(source_code, context)\n```\n\n### C++ Environment\n\n```python\nimport pascua as psc\n\ncontext = {\n 'size': 100,\n}\n\nsource_code = [\n 'float r;',\n 'vector random_numbers;',\n 'for (int i = 0; i < size; i++) {',\n ' r = static_cast (rand()) / static_cast (RAND_MAX);',\n ' random_numbers.push_back(r);',\n '}',\n]\n\nenv = psc.CCEnvironment(\n version='latest',\n includes=[\n 'vector',\n 'numeric',\n ]\n)\n\nresult = env.exec(source_code, context)\n```\n\n\n## Development\n\nYou can install it simply typing:\n\n```bash\npython setup.py install\n```\n\nTo run the tests perform:\n\n```bash\npython -m unittest discover tests\n```\n\n## License\n\n- This project is licensed under **[MIT license](http://opensource.org/licenses/mit-license.php)**.\n\n\n", "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/garciparedes/pascua", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pascua", "package_url": "https://pypi.org/project/pascua/", "platform": "", "project_url": "https://pypi.org/project/pascua/", "project_urls": { "Homepage": "https://github.com/garciparedes/pascua" }, "release_url": "https://pypi.org/project/pascua/0.0.2/", "requires_dist": [ "docker (>=4.0.0)", "dill (>=0.2.9)" ], "requires_python": "", "summary": "Python library to perform code execution in fully isolated environments", "version": "0.0.2" }, "last_serial": 5435484, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f87d4549a79d76589a9b72280f300837", "sha256": "7fc5cf5ac25fbe7c9f475f1d6a8d577ab4aaaf8a5869b64f077ce355ab69d389" }, "downloads": -1, "filename": "pascua-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f87d4549a79d76589a9b72280f300837", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4425, "upload_time": "2019-06-06T20:33:36", "url": "https://files.pythonhosted.org/packages/05/5a/4837245f2cfcc0cedcac3589453333b0909aae549133c25f117235452310/pascua-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e4261480df113ee9b5b1aa078ff70659", "sha256": "8a058a597916139391262f3af8a6bd95b60a68f7361116fec510c2ffee13d3c5" }, "downloads": -1, "filename": "pascua-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e4261480df113ee9b5b1aa078ff70659", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2716, "upload_time": "2019-06-06T20:33:41", "url": "https://files.pythonhosted.org/packages/d7/e5/a4f5648a25c8cf49d5ba5ea09233a97b182b43fe5b1369b9732582acbbaf/pascua-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0640f9a1590c48acfb71efcdd7efcdde", "sha256": "c9a8b34282fb8443fc923f3f6f5c9fb2a64f77f734179cb9a0364c0789433b01" }, "downloads": -1, "filename": "pascua-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0640f9a1590c48acfb71efcdd7efcdde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5644, "upload_time": "2019-06-22T19:03:01", "url": "https://files.pythonhosted.org/packages/13/7e/02a0d4aa2a069adb3ff8ff66c8e4c87f49e32a3f8a7b3f94509ce0754fc6/pascua-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32c419b31fb67f154b2007614520856a", "sha256": "8cbd638842d04be73f10e1ae4ad511f7f95f65557e7e2f8295c28979f3debaa9" }, "downloads": -1, "filename": "pascua-0.0.2.tar.gz", "has_sig": false, "md5_digest": "32c419b31fb67f154b2007614520856a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3872, "upload_time": "2019-06-22T19:03:04", "url": "https://files.pythonhosted.org/packages/ef/d8/a206a80106e91bee80fac598a6cd49a34f6150f7ae64020fe2c2511a19d4/pascua-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0640f9a1590c48acfb71efcdd7efcdde", "sha256": "c9a8b34282fb8443fc923f3f6f5c9fb2a64f77f734179cb9a0364c0789433b01" }, "downloads": -1, "filename": "pascua-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0640f9a1590c48acfb71efcdd7efcdde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5644, "upload_time": "2019-06-22T19:03:01", "url": "https://files.pythonhosted.org/packages/13/7e/02a0d4aa2a069adb3ff8ff66c8e4c87f49e32a3f8a7b3f94509ce0754fc6/pascua-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32c419b31fb67f154b2007614520856a", "sha256": "8cbd638842d04be73f10e1ae4ad511f7f95f65557e7e2f8295c28979f3debaa9" }, "downloads": -1, "filename": "pascua-0.0.2.tar.gz", "has_sig": false, "md5_digest": "32c419b31fb67f154b2007614520856a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3872, "upload_time": "2019-06-22T19:03:04", "url": "https://files.pythonhosted.org/packages/ef/d8/a206a80106e91bee80fac598a6cd49a34f6150f7ae64020fe2c2511a19d4/pascua-0.0.2.tar.gz" } ] }