{ "info": { "author": "Joshua Holbrook", "author_email": "josh.holbrook@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Database", "Topic :: Database :: Front-Ends" ], "description": "# `db_hooks`\n\nExtremely beta sqlalchemy and toml based sql connection manager.\n\n## config file\n\n`db_hooks` looks for a local config file at `./.databases.toml` in your working directory and then looks for a global config file using the [appdirs](https://pypi.org/project/appdirs/) library. Right now there isn't an obvious way to find this path, but running `db_hooks list` will bomb with a useful error message if the file isn't there. In general, try these locations:\n\n| os | location |\n|------------|---------------------------------------------------------|\n| linux | `~/.local/share/db_hooks/databases.toml` |\n| osx | `~/Library/Application Support/db_hooks/databases.toml` |\n| windows 10 | `~\\AppData\\local\\jfhbrook\\db_hooks` |\n\nKeys in the TOML file are connection names. Under those are key/value pairs for the various parameters in a connection. Connections support the following parameters:\n\n* `connection` - a sqlalchemy-compatible connstring. May have a `{password}` f-string parameter.\n* `password_cmd` - a bash command that will be executed in order to fetch the password, which will be applied to `connection` as an f-string.\n\nIn general, one would use `password_cmd` to write a small snippet that fetches the password. This is designed to allow the most flexibility and therefore will depend on your needs.\n\nFor example, you may have a local postgres account and want to read the password using [`zenity`](https://help.gnome.org/users/zenity/):\n\n```toml\n[pg_example]\nconnection = \"postgresql+psycopg2://josh:{password}@localhost:5432/josh\"\npassword_cmd = \"zenity --password\"\n```\n\n## in your code\n\nOnce you have a connection configured, you can load a sqlalchemy engine using\nthe `get_engine` API:\n\n```py\nfrom db_hooks import get_engine\n\nengine = get_engine('pg_example')\n```\n\nThis will pull the connection, run your `password_cmd` and give you a configured sqlalchemy engine.\n\nNote that `get_engine` is cached with a `cachetools.TTLCache` configured with a ttl of 10 minutes.\n\n## the cli\n\n`db_hooks` exposes a CLI that will launch either `psql` or `mysql` in a manner appropriate to the underlying connection. You can run `db_hooks --help` for hopefully useful help output.\n\n## licensing\n\nThis library is licensed under the Apache Software License. See the LICENSE and NOTICE files for details.\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": "https://github.com/jfhbrook/db_hooks", "keywords": "sqlalchemy,repl,jupyter,database", "license": "", "maintainer": "", "maintainer_email": "", "name": "db-hooks", "package_url": "https://pypi.org/project/db-hooks/", "platform": "", "project_url": "https://pypi.org/project/db-hooks/", "project_urls": { "Homepage": "https://github.com/jfhbrook/db_hooks" }, "release_url": "https://pypi.org/project/db-hooks/0.3.1/", "requires_dist": [ "appdirs", "attrs", "cachetools", "cattrs", "click", "pygments", "sqlalchemy", "toml" ], "requires_python": ">=3.5", "summary": "A simple sqlalchemy connection configuration manager", "version": "0.3.1" }, "last_serial": 5936546, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c0a82cd21fcfa05c3a0bb7306c8fea97", "sha256": "05059cbde5dc2993988bf2bd2c710a61fb0a5e1f59b2acb684f111c653cc866a" }, "downloads": -1, "filename": "db_hooks-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c0a82cd21fcfa05c3a0bb7306c8fea97", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8878, "upload_time": "2019-09-29T17:15:53", "url": "https://files.pythonhosted.org/packages/5e/9a/e9db1c8e1ecf52c7016f5e10d1f8e7730e0ae690f151104cdf14f69286b5/db_hooks-0.0.1-py2.py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0f5a6e01b8fb683761c12b7eff29312f", "sha256": "86f9abcd7cc72826db66d434250b6dd5a8df1bd98c38f315951c96fa6fec066f" }, "downloads": -1, "filename": "db_hooks-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0f5a6e01b8fb683761c12b7eff29312f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9798, "upload_time": "2019-09-29T17:23:25", "url": "https://files.pythonhosted.org/packages/dd/2e/d6ce6972d680c10d8e005acb0f2f436f422ae8be5aecf1060fd31762a2b6/db_hooks-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dbd7e088c6aa508ee0506c8d87983eb5", "sha256": "740d9f0627ead18602e61f9936f78c8fbb8f1f95c0122bb258483377225c93ed" }, "downloads": -1, "filename": "db_hooks-0.0.2.tar.gz", "has_sig": false, "md5_digest": "dbd7e088c6aa508ee0506c8d87983eb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4221, "upload_time": "2019-09-29T17:23:28", "url": "https://files.pythonhosted.org/packages/91/64/d1241efd311a7f102478844f85cc6f6c062381c57b8fd28f9263451ceae8/db_hooks-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5c0dc34fa1bcfb9208d77f55df116061", "sha256": "76e64ebbbd9515eeaacc44973a8a3763c3b3d2adad40c6c2b9f96c5dfd4d9db8" }, "downloads": -1, "filename": "db_hooks-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5c0dc34fa1bcfb9208d77f55df116061", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9948, "upload_time": "2019-09-29T17:36:10", "url": "https://files.pythonhosted.org/packages/e8/e4/11befd0d6ee6410fef084097de9f5cc5f9937ea653431b4fe03ee904caf0/db_hooks-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a158ca5f80074e6958d18ba5ed587925", "sha256": "67b0adf51be9197bede18c681c25134b57973411a78e9c7a9ebcf6024f46314b" }, "downloads": -1, "filename": "db_hooks-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a158ca5f80074e6958d18ba5ed587925", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4253, "upload_time": "2019-09-29T17:36:11", "url": "https://files.pythonhosted.org/packages/cc/89/a9a34d7341bcccc6464fecaae2c0cae139f7b7ceaf59213927a32881789e/db_hooks-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "41a75b96fc708c692b30cf86bdd6935c", "sha256": "52ffaa7f18b3f919b3216bf659f71d5435ff51748a4cdd6b176fd9fa6ad9e35c" }, "downloads": -1, "filename": "db_hooks-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "41a75b96fc708c692b30cf86bdd6935c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10025, "upload_time": "2019-09-29T20:27:33", "url": "https://files.pythonhosted.org/packages/33/b8/abb77dc32cc6775b6d284c6e75ec0fb06b33eb6a991d912cd4d31e829d23/db_hooks-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ecfbc9aa04c4e93d4b75f0b975a8b26", "sha256": "7f1a4a07cb20dc5212f5d67ed3f2d325aa90643bc5dad20c305ea4aa33db6c5f" }, "downloads": -1, "filename": "db_hooks-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9ecfbc9aa04c4e93d4b75f0b975a8b26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4313, "upload_time": "2019-09-29T20:27:34", "url": "https://files.pythonhosted.org/packages/45/f0/5635fd1ed9093cc326d02354ba653173d28dfff8357e1a85868570bc8c61/db_hooks-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "49ae65748bb32fb1857a865f232b9fb0", "sha256": "ce5c3201bb653791cf718f8c5cabe63ada4a10c630da2576e67cd97427a6f7fe" }, "downloads": -1, "filename": "db_hooks-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "49ae65748bb32fb1857a865f232b9fb0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10251, "upload_time": "2019-09-29T20:42:02", "url": "https://files.pythonhosted.org/packages/64/96/c925bc514920e94c1a98dae962a1a54eb3a1fb5ab5bdf793ca6ca08f442c/db_hooks-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6267fd2c011659282f18101adf956594", "sha256": "7fe58614596e5226e49bf3911e8015c0019fcf7c9ce96181ffd89bc75fab7cfe" }, "downloads": -1, "filename": "db_hooks-0.0.5.tar.gz", "has_sig": false, "md5_digest": "6267fd2c011659282f18101adf956594", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4608, "upload_time": "2019-09-29T20:42:04", "url": "https://files.pythonhosted.org/packages/a4/53/cbf65157edc6cff527f8ecc192ec9eaa2224550bfc35197f2072dae48fdf/db_hooks-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "b7ae75b494ade627c18f36f9db27392e", "sha256": "61dd8f7b100dca80e8fd6ec11042a965000986d371afccc36908b3f1d8e80f54" }, "downloads": -1, "filename": "db_hooks-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b7ae75b494ade627c18f36f9db27392e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 10277, "upload_time": "2019-09-29T23:05:35", "url": "https://files.pythonhosted.org/packages/03/2f/40de5c685eb3e57bbed48fe52a534b5bbaed1ef2297c0d1ce4b608535dad/db_hooks-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "994914a26e5e623bf850ded45d1e8f05", "sha256": "1ce8627143a810d3a22244037f4d7191ac590e5cf2c6c6cc8bf354561a1b1194" }, "downloads": -1, "filename": "db_hooks-0.0.6.tar.gz", "has_sig": false, "md5_digest": "994914a26e5e623bf850ded45d1e8f05", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4652, "upload_time": "2019-09-29T23:05:37", "url": "https://files.pythonhosted.org/packages/fe/10/335730933b52de792faff112a408fdc65fcf14e7271c636417deedd9a156/db_hooks-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "7e5a71a17bb3dd597452243de0899af8", "sha256": "21a9776e4a4130981ad65f00205acd8d830dfbc73411e8104e7b6482d8db8974" }, "downloads": -1, "filename": "db_hooks-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e5a71a17bb3dd597452243de0899af8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 10280, "upload_time": "2019-09-30T23:24:34", "url": "https://files.pythonhosted.org/packages/b7/95/206a4efb2f05eac0e204e0e455236222c7de81701017ec27cedabbd0b1ef/db_hooks-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f6dc4785ae18f804ee3eb55567d6623", "sha256": "685f7529a59e5484156a7f8d84abc8dc21b24fc5f99cd083d8b7dbdfe9f7bc5b" }, "downloads": -1, "filename": "db_hooks-0.0.7.tar.gz", "has_sig": false, "md5_digest": "0f6dc4785ae18f804ee3eb55567d6623", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4660, "upload_time": "2019-09-30T23:24:35", "url": "https://files.pythonhosted.org/packages/1d/0d/9a840961d7ddf1a0f1cd101e6a6368de4c95f5355fede42f5f5b4d28e7bf/db_hooks-0.0.7.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "1e15f9c60c350dc03f73457d989a5ec6", "sha256": "32f0e1c71cc25867a2f549aafaa7f5a7f19e3eaa98592f36a93890c332633fbb" }, "downloads": -1, "filename": "db_hooks-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1e15f9c60c350dc03f73457d989a5ec6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 15876, "upload_time": "2019-10-06T18:59:33", "url": "https://files.pythonhosted.org/packages/07/d1/891a8d26bb3a05697f20e9f5d1cd7e3c23f78fbcec41df4e6e55032dde23/db_hooks-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "86bb42b958bd2278863b8b2f528b890d", "sha256": "8010c8fc941c7b5775ffce19a34d74adedf2e125e35fcd5c54a4644257a1a640" }, "downloads": -1, "filename": "db_hooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "86bb42b958bd2278863b8b2f528b890d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6934, "upload_time": "2019-10-06T18:59:34", "url": "https://files.pythonhosted.org/packages/1c/88/8bfd7c62b413e1010853859ae5e034a753402cb869b0bd83ceb2c547d8d4/db_hooks-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "29a8c705ac02f4efd8f83d803febc171", "sha256": "b9597ea248a4bd582148485c0f168eebf1ff80fbcf7effedbb470eb197e90b62" }, "downloads": -1, "filename": "db_hooks-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "29a8c705ac02f4efd8f83d803febc171", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 15880, "upload_time": "2019-10-06T19:56:43", "url": "https://files.pythonhosted.org/packages/8a/9a/911d10b574ee32408c6c3d344509de2f81aec60be18bb27bea4d8a54e426/db_hooks-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "57913f370f2c94aa31e0131808d3bb1f", "sha256": "14e2bed33ffeec7d3f2b96dd131453cdc6bc86c7d3e6f91aaba6c1ea1706cbf4" }, "downloads": -1, "filename": "db_hooks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "57913f370f2c94aa31e0131808d3bb1f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6946, "upload_time": "2019-10-06T19:56:45", "url": "https://files.pythonhosted.org/packages/b7/9f/7902dc2fd1b59a275483a33e8055fd15f9fb1fe673bda5b5a5893553775f/db_hooks-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c6209fed9ae7da25fa6cc890eef17107", "sha256": "de67be5ea8cf1d8eed1370ecd091582d024d1f8e34bc7670ff40b89d8380948a" }, "downloads": -1, "filename": "db_hooks-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c6209fed9ae7da25fa6cc890eef17107", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 17376, "upload_time": "2019-10-07T00:39:03", "url": "https://files.pythonhosted.org/packages/ad/92/c960b755e4ab830b66659f96f67b9ba85e538f3564cc6b0abdfa8bb8515d/db_hooks-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6403748505b34c4ad3da79b1c9336f65", "sha256": "6235a5546515e70d0043fdecda2c38e17b56049f559b704b343bba3370a4a7d8" }, "downloads": -1, "filename": "db_hooks-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6403748505b34c4ad3da79b1c9336f65", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8510, "upload_time": "2019-10-07T00:39:05", "url": "https://files.pythonhosted.org/packages/00/9c/70f3721888d9ac08e35f2cdbf375a49b00c2311eddc0fb2fa2c1e7985d58/db_hooks-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "ed07033b8d395fcecf6c53dace184855", "sha256": "a291d1b8923549811d29ccde913d709e0655728f1df52e6a324c0f42a200119f" }, "downloads": -1, "filename": "db_hooks-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed07033b8d395fcecf6c53dace184855", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 17504, "upload_time": "2019-10-07T01:16:32", "url": "https://files.pythonhosted.org/packages/2d/35/ecb35e27a29f47ce2865d100ad75e9707767e4316eff322b0724194efd25/db_hooks-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "962588918e9ffe0d4678c0ad180f1ab7", "sha256": "c09fc0e4538762508b9b6b9f6c7c3cd606bd226774210f370bc07db1f9af98a4" }, "downloads": -1, "filename": "db_hooks-0.3.0.tar.gz", "has_sig": false, "md5_digest": "962588918e9ffe0d4678c0ad180f1ab7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8591, "upload_time": "2019-10-07T01:16:34", "url": "https://files.pythonhosted.org/packages/5d/07/52a73c6c71a09a58d0b34260e33119d0e028504103a1461d5d316c71d2b3/db_hooks-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "db29f9d626880487620cd8ca2f5e03c9", "sha256": "b0d279a08ea0024146d2a7b0afa0a91b09bc782e165a0097fc7e9fff1a7df607" }, "downloads": -1, "filename": "db_hooks-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "db29f9d626880487620cd8ca2f5e03c9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 17505, "upload_time": "2019-10-07T01:22:34", "url": "https://files.pythonhosted.org/packages/6d/ed/33d5ebaa2e2bd4b3fb0dcc2a89e7e38ce2cfdea4f0288a26cf45c7cf8faf/db_hooks-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24664c09118752eb71b52d8053083c6c", "sha256": "fc5f3f488e023600c7ee8831fb467234d8778fa00261b4b5f585c0b8d10b2738" }, "downloads": -1, "filename": "db_hooks-0.3.1.tar.gz", "has_sig": false, "md5_digest": "24664c09118752eb71b52d8053083c6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8591, "upload_time": "2019-10-07T01:22:35", "url": "https://files.pythonhosted.org/packages/fb/ee/bf3322e30ca8f53c1b1bce924b8ff33463e9f607956984eb1382ea25f94d/db_hooks-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db29f9d626880487620cd8ca2f5e03c9", "sha256": "b0d279a08ea0024146d2a7b0afa0a91b09bc782e165a0097fc7e9fff1a7df607" }, "downloads": -1, "filename": "db_hooks-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "db29f9d626880487620cd8ca2f5e03c9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 17505, "upload_time": "2019-10-07T01:22:34", "url": "https://files.pythonhosted.org/packages/6d/ed/33d5ebaa2e2bd4b3fb0dcc2a89e7e38ce2cfdea4f0288a26cf45c7cf8faf/db_hooks-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24664c09118752eb71b52d8053083c6c", "sha256": "fc5f3f488e023600c7ee8831fb467234d8778fa00261b4b5f585c0b8d10b2738" }, "downloads": -1, "filename": "db_hooks-0.3.1.tar.gz", "has_sig": false, "md5_digest": "24664c09118752eb71b52d8053083c6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8591, "upload_time": "2019-10-07T01:22:35", "url": "https://files.pythonhosted.org/packages/fb/ee/bf3322e30ca8f53c1b1bce924b8ff33463e9f607956984eb1382ea25f94d/db_hooks-0.3.1.tar.gz" } ] }