{"id":22816624,"url":"https://github.com/mrigankpawagi/pyjail","last_synced_at":"2026-02-03T18:01:57.205Z","repository":{"id":266341446,"uuid":"898046349","full_name":"mrigankpawagi/PyJail","owner":"mrigankpawagi","description":"Python module to provide a secure environment for executing untrusted code.","archived":false,"fork":false,"pushed_at":"2024-12-20T15:16:48.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T18:51:14.902Z","etag":null,"topics":["python-package","secure-execution"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/PyJail/","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/mrigankpawagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T17:33:10.000Z","updated_at":"2024-12-20T15:16:52.000Z","dependencies_parsed_at":"2024-12-03T20:02:36.296Z","dependency_job_id":"2b6d084d-3687-4a68-a7aa-47f6be1a9bb9","html_url":"https://github.com/mrigankpawagi/PyJail","commit_stats":null,"previous_names":["mrigankpawagi/pyjail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPyJail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPyJail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPyJail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPyJail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrigankpawagi","download_url":"https://codeload.github.com/mrigankpawagi/PyJail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249293846,"owners_count":21245830,"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":["python-package","secure-execution"],"created_at":"2024-12-12T14:08:10.013Z","updated_at":"2026-02-03T18:01:52.173Z","avatar_url":"https://github.com/mrigankpawagi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyJail\n\n\u003cp align=center\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/abea90ce-abe7-4f74-bd00-e4b73d17fb8f\" /\u003e\n\u003c/p\u003e\n\nPyJail is a Python module designed to provide a secure environment for executing untrusted code. PyJail is available on [PyPI](https://pypi.org/project/PyJail/).\n\n\u003e [!NOTE]\n\u003e PyJail uses `chroot` and is therefore currently supported only on Linux. Further, you must run your Python script as root.\n\n```bash\npip install PyJail\n```\n\nTo execute a function without access to your system, call it through PyJail as shown below.\n\n```python\nfrom pyjail import Jail\n\nwith Jail() as jail:\n    result = jail.execute(untrusted_func, args=func_args, kwargs=func_kwargs)\n```\n\nThe `Jail` class constructor has the optional parameters `path=os.path.join(os.getcwd(), \"jail\")`, `clear_before_create=False` and `clear_after_destroy=True`. The `path` parameter specifies the directory where the jail will be created. The `clear_before_create` parameter specifies whether the jail directory should be cleared before creation (if it already exists) and the `clear_after_destroy` parameter specifies whether the jail directory should be cleared after destruction.\n\nThe `execute` method takes the optional parameters `args` (positional arguments) and `kwargs` (keyword arguments) to pass arguments to the function `untrusted_func`. The `execute` method also takes an optional `timeout` parameter to specify the maximum time in seconds that the function is allowed to run. A `TimeoutError` will be raised if the function takes longer than the specified time to execute. Otherwise, the return value of the function is returned (and exceptions are raised if the function raises an exception).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fpyjail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrigankpawagi%2Fpyjail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fpyjail/lists"}