{"id":13826557,"url":"https://github.com/karkason/pywinsandbox","last_synced_at":"2025-12-14T13:01:25.179Z","repository":{"id":57458547,"uuid":"248972006","full_name":"karkason/pywinsandbox","owner":"karkason","description":"Windows Sandbox Utillities Python Package","archived":false,"fork":false,"pushed_at":"2024-06-26T05:23:51.000Z","size":53,"stargazers_count":137,"open_issues_count":4,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-07T04:50:06.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/karkason.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}},"created_at":"2020-03-21T12:31:40.000Z","updated_at":"2024-11-02T18:01:18.000Z","dependencies_parsed_at":"2022-09-09T22:51:45.949Z","dependency_job_id":null,"html_url":"https://github.com/karkason/pywinsandbox","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karkason%2Fpywinsandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karkason%2Fpywinsandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karkason%2Fpywinsandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karkason%2Fpywinsandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karkason","download_url":"https://codeload.github.com/karkason/pywinsandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476383,"owners_count":17480215,"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":[],"created_at":"2024-08-04T09:01:40.230Z","updated_at":"2025-12-14T13:01:20.158Z","avatar_url":"https://github.com/karkason.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# PyWinSandbox\nPython [Windows Sandbox](https://techcommunity.microsoft.com/t5/windows-kernel-internals/windows-sandbox/ba-p/301849) library.\nCreate a new Windows Sandbox machine, control it with a simple RPyC interface.\n\nA good usage for this library would be to easily run sandboxed tests in a controlled envionment.\n\nQuick Start\n------------\n\nPyWinSandbox can be installed using pip:\n\n```sh\n$ pip3 install -U pywinsandbox\n```\n\nIf you want to run the latest version of the code, you can install from git:\n\n```sh\n$ pip3 install -U git+git://github.com/karkason/pywinsandbox.git\n```\n\nNote that the Windows Sandbox should be enabled in your system in order to use PyWinSandbox. [See the following Microsoft article on how to do that.](https://techcommunity.microsoft.com/t5/windows-kernel-internals/windows-sandbox/ba-p/301849)\n\nExamples\n-------\n\n```python\nimport winsandbox\n\nsandbox = winsandbox.new_sandbox()\nsandbox.rpyc.modules.subprocess.run('explorer .')\n\n# Create a sandbox with a mapped directory.\n# Directories are mapped under desktop.\nsandbox = winsandbox.new_sandbox(folder_mappers=[winsandbox.FolderMapper(r'C:\\users\\public')])\ntree = sandbox.rpyc.modules.subprocess.check_output(r'cmd /c tree %userprofile%\\Desktop\\public')\n\n# Create an offline sandbox with a logon script.\nsandbox = winsandbox.new_sandbox(networking=False, logon_script=\"explorer .\")\n\n# Create a sandbox with your own RAM value\nsandbox = winsandbox.new_sandbox(memory_mb=8192)\n```\n\nAlso a console script is available:\n\n```sh\n# wsb / winsandbox are aliases\n\n# Create an interactive sandbox session. Spawns an IPython shell.\nwsb -i\n\n# Spawn an \"offline\" Windows Sandbox instance, with a command line.\nwsb -s \"explorer C:\\windows\\system32\" \n```\n\nWindows Shell Extension\n-------\nA shell extension is also available to easily sandbox executables with the right click menu:\n\n![Shell Extension](https://i.imgur.com/WXrE1du.png)\n\n```sh\n# Run these commands with Administrator privileges\n\n# Register the shell extension\nwsb -r\n# Unregister the shell extension\nwsb -u\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarkason%2Fpywinsandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarkason%2Fpywinsandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarkason%2Fpywinsandbox/lists"}