{"id":18465570,"url":"https://github.com/numtide/deploykit","last_synced_at":"2025-09-10T03:34:36.762Z","repository":{"id":95407390,"uuid":"514298063","full_name":"numtide/deploykit","owner":"numtide","description":"Execute commands remote via ssh and locally in parallel with python","archived":false,"fork":false,"pushed_at":"2024-07-26T09:34:19.000Z","size":70,"stargazers_count":27,"open_issues_count":3,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-02T23:55:51.133Z","etag":null,"topics":["deploy","python"],"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/numtide.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}},"created_at":"2022-07-15T14:25:41.000Z","updated_at":"2024-08-21T21:47:40.000Z","dependencies_parsed_at":"2023-04-22T17:45:26.580Z","dependency_job_id":"3c183b18-b96e-4b43-a594-4b2b515f2e32","html_url":"https://github.com/numtide/deploykit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdeploykit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdeploykit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdeploykit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdeploykit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtide","download_url":"https://codeload.github.com/numtide/deploykit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804604,"owners_count":20999019,"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":["deploy","python"],"created_at":"2024-11-06T09:13:34.565Z","updated_at":"2025-04-08T08:31:57.860Z","avatar_url":"https://github.com/numtide.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploykit\n\nA Python library that executes commands in parallel, locally and remotely,\nover a group of hosts.\n\nThis library has been extracted from existing projects where it was used as a\nbasis to create deployment scripts. It's a bit like a mini Ansible, without\nthe YAML overhead, and usable as a simple composable library.\n\nHere are some important facts about deploykit:\n\n- Local commands and user-defined function: In contrast to many other libraries\n  in the space, deploykit allows to also run commands and user-defined\n  functions locally in parallel for each host.\n- OpenSSH: To retain compatibility with existing configuration, deploykit uses\n  the openssh executable for running the commands remotely. \n- Threaded: Deploykit starts a thread per target host run commands and\n  user-defined functions and collects their results for inspection. To run\n  commands, deploykit wraps around python's subprocess API.\n- Clean output: command outputs are prefixed by the hostname of the target.\n\n## Example\n\n```python\nfrom deploykit import parse_hosts\nimport subprocess\n\nhosts = parse_hosts(\"server1,server2,server3\")\nruns = hosts.run(\"uptime\", stdout=subprocess.PIPE)\nfor r in runs:\n    print(f\"The uptime of {r.host.hostname} is {r.result.stdout}\")\n```\n\nA more comprehensive example explaining all the concepts of the API can be found\n[here](https://github.com/numtide/deploykit/blob/main/examples/basic.py).\n\n## Differences to other libraries and tools\n\n- [Fabric](http://fabfile.org): \n  - Deploykit took inspiration from fabric and addresses its limitation that\n    local commands cannot be executed in parallel for a range of hosts (i.e. rsync).\n    By also allowing to run a function per host it provides higher flexibility. Fabric\n    uses [pyinvoke]() as a task runner frontend, so deploykit can be also used in\n    combination with the same.\n- [Ansible](https://ansible.org): \n  - Deploykit is more lightweight and has a faster startup time.\n  - Using python for task definitions allows for more flexibility than YAML.\n  - Use ansible if you need declarative configuration management. Use deploykit\n    if you want to imperatively quickly execute a series of commands on a number\n    of hosts.\n\n## Contributing\n\nContributions and discussions are welcome. Please make sure to send a WIP PR or\nissue before doing large refactors, so your work doesn't get wasted (in case of\ndisagreement). In our [development](DEVELOPMENT.md) documentation we explain how\nto get starte on deploykit.\n\n## License\n\nThis project is copyright Numtide and contributors, and licensed under the\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fdeploykit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtide%2Fdeploykit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fdeploykit/lists"}