{ "info": { "author": "Senic GmbH", "author_email": "tom@senic.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python" ], "description": "senic.cryptoyaml\n================\n\n.. image:: https://travis-ci.org/getsenic/senic.cryptoyaml.svg?branch=master\n :target: https://travis-ci.org/getsenic/senic.cryptoyaml\n\n`senic.cryptoyaml` is a python library to manage encrypted YAML files, its motivation was to provide an API for applications to read (and write) potentially sensitive configuration settings (i.e. passwords, personal user information) in encrypted form.\n\nAnother motivation is that even in scenarios where the private key to access those settings is persisted alongside the settings themselves, the advantage would be that it becomes trivial to delete those settings securely: you now only need to destroy the key properly and not worry that you leave sensitive bits and bytes on the storage device.\n\n\nThis package is simply a convenience wrapper tailored to that use case. The actual heavy lifting of parsing and writing YAML and encrypting and decrypting it is done by the excellent libraries `PyYAML `__ and `cryptography `__ respectively.\nAlso, while they support both Python 2.x and 3.x this package only targets Python >= 3.5 (because it's 2016).\n\n\nAPI Usage\n---------\n\nHere's a simple example::\n\n >>> from senic.cryptoyaml import generate_key, CryptoYAML\n >>> new_key = generate_key('secret')\n >>> config = CryptoYAML('/path/to/settings.yml.aes', keyfile=new_key)\n\nInitially you must generate a key (it uses the `Fernet symmetric encryption `_ from the `cryptography `__ library) and use it to construct an CryptoYAML instance.\n\nThat instance then provides a `data` attribute which is initally an empty dictionary that you can fill with arbitrary data, provided, the `PyYAML `__ library can encode it::\n\n >>> config.data['foo'] = 123\n\nNote, however, that the data is only persisted on the filesystem when you explicitly commit it to disk like so::\n\n >>> config.write()\n\nOnce written, the file can be re-read as long as the original secret is still provided::\n\n >>> reread = CryptoYAML('/path/to/settings.yml.aes', keyfile=new_key)\n >>> reread.data['foo']\n >>> 123\n\n\nCommand Line Usage\n------------------\n\nHaving an encrypted settings file is neat, but sometimes you might want to take a look at it or manipulate it from the command line instead of programmatically.\n\nFor this ``cryptoyaml`` has three commands for generating a key, creating a new file, reading it and setting individual settings::\n\n # cryptoyaml generate_key mysecret\n Created new private key at /Users/senic/Development/senic.cryptoyaml/mysecret\n # cryptoyaml create mysettings.yml.aes --keyfile mysecret\n created new file at /Users/senic/Development/senic.cryptoyaml/mysettings.yml.aes\n # cryptoyaml set mysettings.yml.aes foo bar --keyfile mysecret\n foo -> bar\n # cryptoyaml cat mysettings.yml.aes --keyfile mysecret\n {'foo': 'bar'}\n\n\n\nEnvironment variables\n---------------------\n\nA common practice is to provide the secret key via an environment variable.\nSimply setting ``CRYPTOYAML_SECRET`` will allow you to omit the key for both API usage and for the command line.\n\n\nRelease Information\n===================\n\nChangelog\n=========\n\nVersions follow `CalVer `_ with a strict backwards compatibility policy.\nThe third digit is only for regressions.\n\n0.1.1 (2017-01-03)\n------------------\n\nCosmetic brown bag release...\n\nChanges:\n^^^^^^^^\n\n - fix README markup.\n\n - fix namespace declaration (to allow it to co-exist with other ``senic.*`` packages).\n\n\n0.1.0 (2016-12-20)\n-------------------\n\nChanges:\n^^^^^^^^\n\nInitial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/getsenic/senic.cryptoyaml", "keywords": null, "license": "BSD 2-Clause License", "maintainer": null, "maintainer_email": null, "name": "senic.cryptoyaml", "package_url": "https://pypi.org/project/senic.cryptoyaml/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/senic.cryptoyaml/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/getsenic/senic.cryptoyaml" }, "release_url": "https://pypi.org/project/senic.cryptoyaml/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A python library to manage encrypted YAML files.", "version": "0.1.1" }, "last_serial": 2551884, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "990e6720954902012114508bb09b883d", "sha256": "e08eb7d51e1d7d953f6d384ee1d534782b22d8556f93ed9047c04f390403b701" }, "downloads": -1, "filename": "senic.cryptoyaml-0.1.0.tar.gz", "has_sig": false, "md5_digest": "990e6720954902012114508bb09b883d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11241, "upload_time": "2016-12-20T11:09:19", "url": "https://files.pythonhosted.org/packages/e6/6d/38498a977b3cf0c36f333413e45533dce9ffaae633b0eb83a083dea2d97d/senic.cryptoyaml-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "12e4c3ff2a5fb4b778fa8f17115200f9", "sha256": "130251efb1060881519f590510170c886bd359072f42d4056a2b75601df45407" }, "downloads": -1, "filename": "senic.cryptoyaml-0.1.1.tar.gz", "has_sig": false, "md5_digest": "12e4c3ff2a5fb4b778fa8f17115200f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11496, "upload_time": "2017-01-03T16:34:02", "url": "https://files.pythonhosted.org/packages/35/1e/a8d6726386d04e04518b33c866a6890175a2ae0ee8f0a77e60c9395bf7e0/senic.cryptoyaml-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "12e4c3ff2a5fb4b778fa8f17115200f9", "sha256": "130251efb1060881519f590510170c886bd359072f42d4056a2b75601df45407" }, "downloads": -1, "filename": "senic.cryptoyaml-0.1.1.tar.gz", "has_sig": false, "md5_digest": "12e4c3ff2a5fb4b778fa8f17115200f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11496, "upload_time": "2017-01-03T16:34:02", "url": "https://files.pythonhosted.org/packages/35/1e/a8d6726386d04e04518b33c866a6890175a2ae0ee8f0a77e60c9395bf7e0/senic.cryptoyaml-0.1.1.tar.gz" } ] }