{"id":20472209,"url":"https://github.com/garciparedes/pascua","last_synced_at":"2025-10-14T18:03:06.282Z","repository":{"id":50189422,"uuid":"190632836","full_name":"garciparedes/pascua","owner":"garciparedes","description":"Python library to perform code execution in fully isolated environments","archived":false,"fork":false,"pushed_at":"2023-12-15T20:26:18.000Z","size":90,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T23:32:16.305Z","etag":null,"topics":["conteinerized","environment","environment-isolation","isolate","library","metaprogramming","package","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garciparedes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-06-06T18:47:27.000Z","updated_at":"2024-01-13T23:59:59.000Z","dependencies_parsed_at":"2023-12-25T04:44:37.857Z","dependency_job_id":null,"html_url":"https://github.com/garciparedes/pascua","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"a45a05db80498887c3e6b58bcf1c11f2bc6c5a39"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garciparedes%2Fpascua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garciparedes%2Fpascua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garciparedes%2Fpascua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garciparedes%2Fpascua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garciparedes","download_url":"https://codeload.github.com/garciparedes/pascua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039661,"owners_count":20061925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conteinerized","environment","environment-isolation","isolate","library","metaprogramming","package","python","python3"],"created_at":"2024-11-15T14:19:07.697Z","updated_at":"2025-10-14T18:03:01.238Z","avatar_url":"https://github.com/garciparedes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u003e=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 \u003c- 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\u003cfloat\u003e random_numbers;',\n    'for (int i = 0; i \u003c size; i++) {',\n    '  r = static_cast \u003cfloat\u003e (rand()) / static_cast \u003cfloat\u003e (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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarciparedes%2Fpascua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarciparedes%2Fpascua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarciparedes%2Fpascua/lists"}