{"id":14476329,"url":"https://github.com/davydany/sultan","last_synced_at":"2025-04-12T23:34:15.330Z","repository":{"id":57472236,"uuid":"66904707","full_name":"davydany/sultan","owner":"davydany","description":"Sultan: Command and Rule over your Shell","archived":false,"fork":false,"pushed_at":"2024-07-16T08:20:40.000Z","size":471,"stargazers_count":680,"open_issues_count":22,"forks_count":35,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-26T11:42:00.709Z","etag":null,"topics":["bash","bash-script","cli","command-line","command-line-tool","command-prompt","compiler","python2","python3","ssh","terminal","zsh"],"latest_commit_sha":null,"homepage":"https://sultan.readthedocs.io/en/latest/","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/davydany.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-30T03:54:52.000Z","updated_at":"2025-03-09T21:44:41.000Z","dependencies_parsed_at":"2022-08-30T17:01:45.237Z","dependency_job_id":"fc85393e-7ce1-47e5-9138-fae5a936e30a","html_url":"https://github.com/davydany/sultan","commit_stats":{"total_commits":111,"total_committers":10,"mean_commits":11.1,"dds":"0.11711711711711714","last_synced_commit":"65b4271a161d6c19a9eb0170b5a95832a139ab7f"},"previous_names":["davydany/sultan","aeroxis/sultan"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davydany%2Fsultan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davydany%2Fsultan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davydany%2Fsultan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davydany%2Fsultan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davydany","download_url":"https://codeload.github.com/davydany/sultan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107828,"owners_count":20884797,"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":["bash","bash-script","cli","command-line","command-line-tool","command-prompt","compiler","python2","python3","ssh","terminal","zsh"],"created_at":"2024-09-02T15:01:41.959Z","updated_at":"2025-04-04T02:09:43.465Z","avatar_url":"https://github.com/davydany.png","language":"Python","readme":".. image:: https://raw.githubusercontent.com/aeroxis/sultan/master/docs/img/sultan-logo.png\n  :alt: sultan logo\n  :align: right\n\n**Command and Rule over your Shell**\n\n.. image:: https://badge.fury.io/py/sultan.svg\n  :alt: PyPI Version\n  :target: https://badge.fury.io/py/sultan\n\n.. image:: https://travis-ci.org/aeroxis/sultan.svg?branch=master\n  :alt: Travis Build Status\n  :target: https://travis-ci.org/aeroxis/sultan\n\n.. image:: http://img.shields.io/:license-mit-blue.svg\n  :alt: MIT License\n  :target: http://doge.mit-license.org\n\n.. image:: https://readthedocs.org/projects/sultan/badge/?version=latest\n  :alt: Documentation Status\n  :target: http://sultan.readthedocs.io/en/latest/?badge=latest\n\nSultan now supports Python 2.7+ and 3.0+\n\n----\nNote\n----\nYour input is welcome! Please provide your feedback by creating \n`issues on Github \u003chttps://github.com/aeroxis/sultan/issues\u003e`_\n\n-------\nInstall\n-------\n\n.. code:: bash\n\n  pip install --upgrade sultan\n\n-------------\nDocumentation\n-------------\n\n.. image:: https://readthedocs.org/projects/sultan/badge/?version=latest\n  :alt: Documentation Status\n  :target: http://sultan.readthedocs.io/en/latest/?badge=latest\n\nDocumentation is available on ReadTheDocs: http://sultan.readthedocs.io/en/latest/\n\n---------------\nWhat is Sultan?\n---------------\n\nSultan is a Python package for interfacing with command-line utilities, like \n`yum`, `apt-get`, or `ls`, in a Pythonic manner. It lets you run command-line \nutilities using simple function calls. \n\nThe simplest way to use Sultan is to just call it:\n\n.. code:: python\n\n  from sultan.api import Sultan\n  s = Sultan()\n  s.sudo(\"yum install -y tree\").run()\n  \n**Runs:** \n\n.. code:: bash\n\n  sudo yum install -y tree;\n\n------------\n\nThe recommended way of using Sultan is to use it in Context Management mode. \nHere is how to use Sultan with Context Management:\n\n.. code:: python\n\n  from sultan.api import Sultan\n\n  with Sultan.load(sudo=True) as s:\n    s.yum(\"install -y tree\").run()\n\n**Runs:** \n\n.. code:: bash\n  \n  sudo su - root -c 'yum install -y tree;'\n  \n------------\n\nWhat if we want to install this command on a remote machine? You can easily \nachieve this using context management:\n\n.. code:: python\n\n  from sultan.api import Sultan\n  \n  with Sultan.load(sudo=True, hostname=\"myserver.com\") as sultan:\n    sultan.yum(\"install -y tree\").run()\n\n**Runs:**\n\n.. code:: bash\n\n  ssh root@myserver.com 'sudo su - root -c 'yum install -y tree;''\n  \n------------\n\nIf you enter a wrong command, Sultan will print out details you need to debug and \nfind the problem quickly.\n\nHere, the same command was run on a Mac:\n\n.. code:: python\n\n  from sultan.api import Sultan\n  \n  with Sultan.load(sudo=True, hostname=\"myserver.com\") as sultan:\n    sultan.yum(\"install -y tree\").run()\n\n  \n**Yields:**\n\n.. code:: bash\n\n  [sultan]: sudo su - root -c 'yum install -y tree;'\n  Password:\n  [sultan]: --{ STDERR }-------------------------------------------------------------------------------------------------------\n  [sultan]: | -sh: yum: command not found\n  [sultan]: -------------------------------------------------------------------------------------------------------------------\n\n------------\n\nWant to get started? Simply install Sultan, and start writing your clean code::\n\n    pip install --upgrade sultan\n\nIf you have more questions, check the docs! http://sultan.readthedocs.io/en/latest/\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavydany%2Fsultan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavydany%2Fsultan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavydany%2Fsultan/lists"}