{ "info": { "author": "Astzweig UG(haftungsbeschr\u00e4nkt) & Co. KG", "author_email": "it@astzweig.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Database", "Topic :: Terminals", "Topic :: Text Processing", "Topic :: Utilities" ], "description": "# Cocof\n[![Build Status](https://travis-ci.org/astzweig/cocof-py.svg?branch=master)](https://travis-ci.org/astzweig/cocof-py)\n[![PyPI version](https://badge.fury.io/py/cocof.svg)](https://badge.fury.io/py/cocof)\n\nCocof, short for consistent config file, is a python module that allows the\nmodification of different key-value config files on the comand line.\n\nMost importantly: For YAML and TOML it _It will keep line breaks and comments\nthe same._ So the file will look more or less like the original (depending on\nthe operations on it of course).\n\nCurrently supported formats are TOML, YAML, JSON and PLIST.\n\n### Install\n```bash\n$ pip install cocof\n```\n\n### Usage\n```bash\n$ cocof --help\nUsage: cocof [OPTIONS] FILEPATH JSONPATCH\n\n Cocof runs the provided 'jsonpatch' modifications on the configuration\n file given with the 'filepath' argument. Use the '--format' option to tell\n the file format. If not given cocof will try to guess the file format\n based on the file extension. Use '-' as filepath for stdin, in which case\n the output goes to stdout and you must provide the format of the data via\n the '--format' option.\n\nOptions:\n -f, --format [toml|yaml|json|plist]\n The format of the file. Obligatory if\n filepath is '-' (stdin).\n --help Show this message and exit.\n```\n\nCocof takes a file path and a [JSON patch][json_patch] string as arguments.\nIt then modifies the datastructure given by the file's content accordingly and\nwrities it back to the same file (in-place editing).\nYou can also tell `cocof` to read from `stdin`, in which case it will output\nit's result to `stdout`. TOML, YAML and JSON expect their content to be `utf-8`\nencoded. PLIST expects either an `utf-8` encoded xml content or binary content.\n\n\n### Examples\n```TOML\n# example.toml\ntitle = \"Example\"\n\n[owner]\nname = \"Tom Preston-Werner\"\ndob = 1979-05-27T07:32:00-08:00 # Inline comment\n\n[database]\nserver = \"192.168.1.1\"\nports = [ 8001, 8001, 8002 ]\n```\n\nUsing `{\"op\": \"add\", \"path\": \"/subtitle\", \"value\": \"Sub\"}` as modification\nyields:\n\n```bash\n$ cocof ./example.toml '[{\"op\": \"add\", \"path\": \"/subtitle\", \"value\": \"Sub\"}]'`\n$ cat ./example.toml\n# example.toml\ntitle = \"Example\"\nsubtitle = \"Sub\"\n\n[owner]\nname = \"Tom Preston-Werner\"\ndob = 1979-05-27T07:32:00-08:00 # Inline comment\n\n[database]\nserver = \"192.168.1.1\"\nports = [ 8001, 8001, 8002 ]\n```\n\n[json_patch]: https://tools.ietf.org/html/rfc6902", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/astzweig/cocof-py", "keywords": "toml,yaml,json,terminal,cli,edit", "license": "", "maintainer": "", "maintainer_email": "", "name": "cocof", "package_url": "https://pypi.org/project/cocof/", "platform": "", "project_url": "https://pypi.org/project/cocof/", "project_urls": { "Homepage": "https://github.com/astzweig/cocof-py" }, "release_url": "https://pypi.org/project/cocof/1.2.2/", "requires_dist": null, "requires_python": "", "summary": "Consistent CLI config file modifier", "version": "1.2.2" }, "last_serial": 4746226, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "aba37f0d71140faefc2927182779019f", "sha256": "d411739370761eb119459b4073c416a96333a6359e5af4dc4232e22ea3f8b0f9" }, "downloads": -1, "filename": "cocof-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "aba37f0d71140faefc2927182779019f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11006, "upload_time": "2019-01-04T01:15:43", "url": "https://files.pythonhosted.org/packages/a8/d6/ceda73731e1dfa0d77ebafd757a48f9e516339beaaf0b38b4d2b1282697a/cocof-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "962c2fb8cdf83cbbd5959ee1489b1af0", "sha256": "89b7b8a6d686a1234179f8377df2c2565a00ab202fbb29c60003b990c2bf9c7f" }, "downloads": -1, "filename": "cocof-1.0.0.tar.gz", "has_sig": false, "md5_digest": "962c2fb8cdf83cbbd5959ee1489b1af0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4706, "upload_time": "2019-01-04T01:15:45", "url": "https://files.pythonhosted.org/packages/e3/60/b764d931051244e7ea0043963bfca988b7c112b787f4f2784a173ad70cd5/cocof-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f293ef39687562ed2cadad1157f0070c", "sha256": "7c7c9a21d75bc7ae06bf14bfedd82dfa3fd820f42ce56b442e5814888b5ed370" }, "downloads": -1, "filename": "cocof-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f293ef39687562ed2cadad1157f0070c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4835, "upload_time": "2019-01-05T02:00:54", "url": "https://files.pythonhosted.org/packages/2f/79/49b052d9f18da242508a8154e49e1d86ebe9b5d632f4293988e0b5b05ef2/cocof-1.0.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "61f616ce28a36ace3e8be667bf322422", "sha256": "36d59408fae0df995ff88b554a779373bd5e8189f99ffe3c058bdfbf8d6ae439" }, "downloads": -1, "filename": "cocof-1.2.0.tar.gz", "has_sig": false, "md5_digest": "61f616ce28a36ace3e8be667bf322422", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5199, "upload_time": "2019-01-18T16:57:44", "url": "https://files.pythonhosted.org/packages/0a/1a/13b697749fa480e09e8356641b8816f21e3f4b01b0be186e22e60c0a6dbe/cocof-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "f728615991632c6b7505f817d74fa84c", "sha256": "933f5ec6da4652801a5c3b83716e702f53d32121557fa6e7b057fd2672317231" }, "downloads": -1, "filename": "cocof-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f728615991632c6b7505f817d74fa84c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5193, "upload_time": "2019-01-27T05:21:50", "url": "https://files.pythonhosted.org/packages/1d/91/51b11b9e506143938f24a187c695f73bdab401488ae2975eeb6a759f7b80/cocof-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "337b318a7ec080417306640dc4cab9b1", "sha256": "36a05eca9aa8000a1a204a97ca6d703a9513713d7908325d91bf26309ac29204" }, "downloads": -1, "filename": "cocof-1.2.2.tar.gz", "has_sig": false, "md5_digest": "337b318a7ec080417306640dc4cab9b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5177, "upload_time": "2019-01-27T14:20:35", "url": "https://files.pythonhosted.org/packages/e4/cb/6b267413a3987671f73bd5637f1ced076585b31702923ce8fa0869289076/cocof-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "337b318a7ec080417306640dc4cab9b1", "sha256": "36a05eca9aa8000a1a204a97ca6d703a9513713d7908325d91bf26309ac29204" }, "downloads": -1, "filename": "cocof-1.2.2.tar.gz", "has_sig": false, "md5_digest": "337b318a7ec080417306640dc4cab9b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5177, "upload_time": "2019-01-27T14:20:35", "url": "https://files.pythonhosted.org/packages/e4/cb/6b267413a3987671f73bd5637f1ced076585b31702923ce8fa0869289076/cocof-1.2.2.tar.gz" } ] }