{ "info": { "author": "Joel Johnson", "author_email": "joelj@joelj.com", "bugtrack_url": null, "classifiers": [], "description": "# dkr\n\nExtensible Docker CLI Client\n\n## To Use\n\n`dkr --help` for use.\n\n## To Install\n\n```bash\npip install dkr\n```\n\n## To Extend\n\nAdd any .py file to `~/.dkr/commands/`. It should have the following functions:\n\n* `command()`: returns a `str` or `list` of `str`. The name of the subcommand(s).\n* `help_summary(str)`: takes a `str` returns a `str`. The returned string is what is displayed for the given command in `--help`.\n* `import_command(docker_client, args, state)`: Takes the docker-py docker client and a subparser for argparse.ArgumentParser for the command. The state is a simple dictionary that remains persistent between running the dkr command. You can use this to track state, e.g. to remember what the last container was used so you can provide a shortcut. \n `args.set_defaults(func=somefunc)` should be called. `somefunc` will be invoked when your particular command is run from the CLI. It should accept the same three arguments as import_command.\n \n\n## Create Options\n\nThe `dkr create` command has the `--option` (`-o`) flag that can be specified multiple times. The format is explained below.\nThis can be used to specify any docker create arg, using the naming conventions used by [docker-py](http://docker-py.readthedocs.io/en/latest/api/#create_container)\n \n \n## Create Options Format\n \nThese arguments get expanded to a dict. For example:\n \n ```bash\n dkr create -o key=value image_name\n ```\n \n Is expanded to:\n \n ```python\n {\n \"key\": \"value\"\n }\n ```\n \n This also handles nested values:\n \n ```bash\n dkr create -o nested.key=value image_name\n ```\n \n Is expanded to:\n \n ```python\n {\n \"nested\": {\n \"key\": \"value\"\n }\n }\n ```\n \n You can also specify raw json values:\n \n ```bash\n dkr create -o nested.key:=true image_name\n ```\n \n Is expanded to:\n \n ```python\n {\n \"nested\": {\n \"key\": True\n }\n }\n ```\n \n And:\n \n ```bash\n dkr create -o \"nested.key:=[true, false, 0]\" image_name\n ```\n \n Is expanded to:\n \n ```python\n {\n \"nested\": {\n \"key\": [True, False, 0]\n }\n }\n ```\n \n You can use multiple options:\n \n ```bash\n dkr create -o \"nested.key:=[true, false, 0]\" -o \"nested.key2=value\" image_name\n ```\n \n Is expanded to:\n \n ```python\n {\n \"nested\": {\n \"key\": [True, False, 0],\n \"key2\": \"value\"\n }\n }\n ```\n \n You can test this yourself by running `dkr_core/cmd_to_json.py` with naked arguments. i.e. no `-o`:\n \n ```bash\n python3 dkr_core/cmd_to_json.py \"nested.key:=[true, false, 0]\" \"nested.key2=value\"\n ```", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/leftstache/dkr", "keywords": "", "license": "(c) 2016 Joel Johnson", "maintainer": "", "maintainer_email": "", "name": "dkr", "package_url": "https://pypi.org/project/dkr/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dkr/", "project_urls": { "Homepage": "https://github.com/leftstache/dkr" }, "release_url": "https://pypi.org/project/dkr/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Extendable alternative client for Docker", "version": "0.0.1" }, "last_serial": 2122445, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "415d9703c9c66db2ab3fcaf04df80c65", "sha256": "816a5ee2a6553666a1b5f6f83bcf3d82c71dee7b926649be3176c13cecc66cef" }, "downloads": -1, "filename": "dkr-0.0.1.tar.gz", "has_sig": false, "md5_digest": "415d9703c9c66db2ab3fcaf04df80c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7012, "upload_time": "2016-05-18T20:31:12", "url": "https://files.pythonhosted.org/packages/af/33/00789821c30502c83be4e208604d7bc2fa8cc534aa611cbae8869a36947b/dkr-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "415d9703c9c66db2ab3fcaf04df80c65", "sha256": "816a5ee2a6553666a1b5f6f83bcf3d82c71dee7b926649be3176c13cecc66cef" }, "downloads": -1, "filename": "dkr-0.0.1.tar.gz", "has_sig": false, "md5_digest": "415d9703c9c66db2ab3fcaf04df80c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7012, "upload_time": "2016-05-18T20:31:12", "url": "https://files.pythonhosted.org/packages/af/33/00789821c30502c83be4e208604d7bc2fa8cc534aa611cbae8869a36947b/dkr-0.0.1.tar.gz" } ] }