{ "info": { "author": "joshbuddy", "author_email": "joshbuddy@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# \ud83d\udd27 Pitcrew\n\nAsyncIO-powered python DSL for running commands locally, on docker, or over ssh.\n\n[![CircleCI](https://circleci.com/gh/joshbuddy/pitcrew.svg?style=svg)](https://circleci.com/gh/joshbuddy/pitcrew)\n\n## What does Pitcrew do?\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Pitcrew can run commands\n $ crew sh date\n
...or over ssh\n $ crew sh -p providers.ssh -P '{\"hosts\": [\"192.168.0.1\"]}' date\n
on hundreds of hosts!\n $ crew sh -p providers.ssh -P '{\"hosts\": [\"192.168.0.1-100\"]}' date\n
Crew can also run tasks\n $ crew run install.homebrew\n
Tasks are either other shell commands, or other tasks, for example,\n this provisions Cloudfront, SSL and S3 and builds and deploys docs to pitcrew.io\n $ crew run examples.deploy_pitcrew\n
You can list available tasks\n $ crew list\n
...edit an existing task\n $ crew edit examples.deploy_pitcrew\n # opens in $EDITOR\n
or create a new task!\n $ crew new some.new.task\n
\n\n## Installation\n\n### From binary\n\nTo install pitcrew in your home directory, run the following:\n\n```\ncurl -fsSL \"https://github.com/joshbuddy/pitcrew/releases/latest/download/crew-$(uname)\" > crew\nchmod u+x crew\n./crew run crew.install --dest=\"$HOME/crew\"\n```\n\n### From PyPi\n\nTo install from the Python Package Index, run the following:\n\n```\npip install pitcrew\ncrew run crew.install --dest=\"$HOME/crew\"\n```\n\n### From source\n\n```\ngit clone https://github.com/joshbuddy/pitcrew\ncd pitcrew\npython3.6 -m venv env\nsource env/bin/activate\npip install -e .\n```\n\n## Concepts\n\nA command or set of commands is called a **task**. A **context** runs tasks either locally, on docker or over ssh.\nA **provider** generates contexts.\n\n### Tasks\n\nTasks are either composed from other tasks or invoking a command on a shell.\n\nAn example of a *task* might be reading a file. `fs.read(path)` reads a file as bytes and returns it:\n\n### `pitcrew/tasks/fs/read.py`\n\n```python\nimport base64\nfrom pitcrew import task\n\n\n@task.arg(\"path\", desc=\"The file to read\", type=str)\n@task.returns(\"The bytes of the file\")\nclass FsRead(task.BaseTask):\n \"\"\"Read value of path into bytes\"\"\"\n\n async def run(self) -> bytes:\n code, out, err = await self.sh_with_code(f\"cat {self.params.esc_path}\")\n assert code == 0, \"exitcode was not zero\"\n return out\n\n```\n\nOther tasks might include writing a file, installing xcode or cloning a git repository. All the currently available\ntasks are listed at [docs/tasks.md](docs/tasks.md). The api available in a task is available at [docs/api.md#crewtask](docs/api.md#crewtask).\n\n### Contexts\n\nAn example of a *context* might be over ssh, or even locally. Learn more about contexts at [docs/api.md#crewcontext](docs/api.md#crewcontext).\n\n### Providers\n\nA *provider* is a task with a specific return type. The return type is an async iterator which returns contexts.\n\n## Usage\n\nFor detailed usage, see [docs/cli.md](docs/cli.md) for more details.\n\n### Run a command\n\nPitcrew allows running a command using `bin/crew sh -- [shell command]`.\n\nFor example `crew sh ls /` will list the \"/\" directory locally.\n\nYou can run this across three hosts via ssh using `crew sh -p providers.ssh -P '{\"hosts\": [\"192.168.0.1\", \"192.168.0.2\", \"192.168.0.3\"]}' ls /`.\n\n### Run a task\n\nPitcrew allows running a task using `crew run [task name] `. This will normally target your local machine unless you use the `-p` flag to select a different provider.\n\n### See available tasks\n\nTo see all the available tasks run `crew list`. This will show all available tasks which are stored in `crew/tasks`.\n\n### Make a new task\n\nTo see all the available tasks run `crew new [task_name]`. This will create a template of a new task.\n\n### Run tests\n\nTo run an ad-hoc command use . For tasks use `crew run [task-name] `.\n\n### Get CLI help\n\nTo see the whole list of commands available from the command-line, run `crew help`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pitcrew.io", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pitcrew", "package_url": "https://pypi.org/project/pitcrew/", "platform": "", "project_url": "https://pypi.org/project/pitcrew/", "project_urls": { "Homepage": "http://pitcrew.io" }, "release_url": "https://pypi.org/project/pitcrew/0.0.3/", "requires_dist": [ "Click (==7.0)", "Jinja2 (==2.10.1)", "MarkupSafe (==1.1.1)", "asn1crypto (==0.24.0)", "asyncssh (==1.16.1)", "cffi (==1.12.3)", "cryptography (==2.6.1)", "netaddr (==0.7.19)", "pycparser (==2.19)", "six (==1.12.0)" ], "requires_python": ">=3.6.0", "summary": "AsyncIO-powered python DSL for running commands locally, on docker, or over ssh.", "version": "0.0.3" }, "last_serial": 5290256, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6ca5cc45c3026586a68a6d9625e99821", "sha256": "85e753003fb8b3249071000f2b4b62c4106c2a1431db24c63fd371f310391d9b" }, "downloads": -1, "filename": "pitcrew-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6ca5cc45c3026586a68a6d9625e99821", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 26434, "upload_time": "2019-04-29T23:14:57", "url": "https://files.pythonhosted.org/packages/08/cc/7c477411dbc39cf825bfcfeed56192a28c001f352450098e7b5ac182d9d8/pitcrew-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dacbbba4ef2b574eb902382b84fb39e1", "sha256": "f38308ddf6f59073936528392c108cc3d80b4261b7102edcc83a1dccaafd18a8" }, "downloads": -1, "filename": "pitcrew-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dacbbba4ef2b574eb902382b84fb39e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 17745, "upload_time": "2019-04-29T23:15:16", "url": "https://files.pythonhosted.org/packages/d2/c3/f6dd61551781bd6e44d2d6854bb23c0e502fe27335e88cc513cecd20dd33/pitcrew-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4080229f225fe4e2a5c134ccf9810be1", "sha256": "7b1f479f656bc888e4f5b58bd2970f8ccbd81c32bb0cf19688f1ccd495ef5f9d" }, "downloads": -1, "filename": "pitcrew-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4080229f225fe4e2a5c134ccf9810be1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 27089, "upload_time": "2019-04-30T18:16:57", "url": "https://files.pythonhosted.org/packages/3f/2a/6d376a990c3debe8f906309af1db521301dae6c521c8ede52ca935246113/pitcrew-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e0326273fdccee72324ef6c0d4ed2e1", "sha256": "c72f044846917db706b89f3f79c2ac308f6e6ef9157a62b9de628fd593bd8731" }, "downloads": -1, "filename": "pitcrew-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8e0326273fdccee72324ef6c0d4ed2e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18496, "upload_time": "2019-04-30T18:17:00", "url": "https://files.pythonhosted.org/packages/7a/b3/5239b1c6a6891a484ada9d813091b050c6f0d024b3215e26328e034ad6f8/pitcrew-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f5aa574df87140c898842e3c01c2e9f0", "sha256": "258a379fb87d1bbecedb4ed6a26a65bd07ec33ff45fcf315358cd69f78420091" }, "downloads": -1, "filename": "pitcrew-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f5aa574df87140c898842e3c01c2e9f0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 26937, "upload_time": "2019-05-20T04:22:49", "url": "https://files.pythonhosted.org/packages/04/30/4875e0853ad392654390863b75d5e3c9e3801f7580371bcd966d89c55faa/pitcrew-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f4c689e8140e7920d9763b6ecdb5225", "sha256": "5dbeb2a6c609bd3ebc80e2c1cc781327d90040e77a9f13004438df2d81afa082" }, "downloads": -1, "filename": "pitcrew-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2f4c689e8140e7920d9763b6ecdb5225", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18313, "upload_time": "2019-05-20T04:22:51", "url": "https://files.pythonhosted.org/packages/5e/5e/02b53ad83abc9160a8e1d3e41b92a107059726267322afdb617a70c9144f/pitcrew-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f5aa574df87140c898842e3c01c2e9f0", "sha256": "258a379fb87d1bbecedb4ed6a26a65bd07ec33ff45fcf315358cd69f78420091" }, "downloads": -1, "filename": "pitcrew-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f5aa574df87140c898842e3c01c2e9f0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 26937, "upload_time": "2019-05-20T04:22:49", "url": "https://files.pythonhosted.org/packages/04/30/4875e0853ad392654390863b75d5e3c9e3801f7580371bcd966d89c55faa/pitcrew-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f4c689e8140e7920d9763b6ecdb5225", "sha256": "5dbeb2a6c609bd3ebc80e2c1cc781327d90040e77a9f13004438df2d81afa082" }, "downloads": -1, "filename": "pitcrew-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2f4c689e8140e7920d9763b6ecdb5225", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18313, "upload_time": "2019-05-20T04:22:51", "url": "https://files.pythonhosted.org/packages/5e/5e/02b53ad83abc9160a8e1d3e41b92a107059726267322afdb617a70c9144f/pitcrew-0.0.3.tar.gz" } ] }