{"id":14128563,"url":"https://github.com/toastdriven/shell","last_synced_at":"2025-06-10T08:36:10.911Z","repository":{"id":8759950,"uuid":"10442161","full_name":"toastdriven/shell","owner":"toastdriven","description":"A better way to run shell commands in Python.","archived":false,"fork":false,"pushed_at":"2020-04-08T14:43:29.000Z","size":32,"stargazers_count":160,"open_issues_count":1,"forks_count":50,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-07T16:54:58.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://shell.readthedocs.org/en/latest/","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toastdriven.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-02T20:58:28.000Z","updated_at":"2024-11-28T16:27:17.000Z","dependencies_parsed_at":"2022-08-07T04:16:44.915Z","dependency_job_id":null,"html_url":"https://github.com/toastdriven/shell","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Fshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Fshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Fshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Fshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toastdriven","download_url":"https://codeload.github.com/toastdriven/shell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Fshell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039613,"owners_count":22796874,"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-15T16:01:50.619Z","updated_at":"2025-06-10T08:36:10.874Z","avatar_url":"https://github.com/toastdriven.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"=====\nshell\n=====\n\n\"\"\"A better way to run shell commands in Python.\"\"\"\n\nBuilt because every time I go to use `subprocess`_, I spend more time in the\ndocs \u0026 futzing around than actually implementing what I'm trying to get done.\n\n.. _`subprocess`: http://docs.python.org/2.7/library/subprocess.html\n\nFull docs are at https://shell.readthedocs.org/en/latest/.\n\n\nRequirements\n============\n\n* Python 2.6+ or Python 3.3+\n\n\nUsage\n=====\n\nIf you just need to quickly run a command, you can use the ``shell`` shortcut\nfunction::\n\n    \u003e\u003e\u003e from shell import shell\n    \u003e\u003e\u003e ls = shell('ls')\n    \u003e\u003e\u003e for file in ls.output():\n    ...     print file\n    'another.txt'\n\nIf you need to extend the behavior, you can also use the ``Shell`` object::\n\n    \u003e\u003e\u003e from shell import Shell\n    \u003e\u003e\u003e sh = Shell(has_input=True)\n    \u003e\u003e\u003e cat = sh.run('cat -u')\n    \u003e\u003e\u003e cat.write('Hello, world!')\n    \u003e\u003e\u003e cat.output()\n    ['Hello, world!']\n\nYou can even chain calls if you'd like::\n\n    \u003e\u003e\u003e from shell import shell\n    \u003e\u003e\u003e shell('cat -u', has_input=True).write('Hello, world!').output()\n    ['Hello, world!']\n\n\nInstallation\n============\n\nUsing ``pip``, simply run::\n\n    pip install shell\n\n\nLicense\n=======\n\nNew BSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Fshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoastdriven%2Fshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Fshell/lists"}