{ "info": { "author": "dblintio", "author_email": "lakecli@tokern.io", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: SQL", "Topic :: Database", "Topic :: Database :: Front-Ends", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[![CircleCI](https://circleci.com/gh/tokern/lakecli.svg?style=svg)](https://circleci.com/gh/tokern/lakecli)\n[![codecov](https://codecov.io/gh/tokern/lakecli/branch/master/graph/badge.svg)](https://codecov.io/gh/tokern/lakecli)\n[![PyPI](https://img.shields.io/pypi/v/lakecli.svg)](https://pypi.python.org/pypi/lakecli)\n[![image](https://img.shields.io/pypi/l/lakecli.svg)](https://pypi.org/project/lakecli/)\n[![image](https://img.shields.io/pypi/pyversions/lakecli.svg)](https://pypi.org/project/lakecli/)\n\n# Introduction\n\nLakeCLI is a SQL interface (CLI) for managing [AWS Lake Formation](https://aws.amazon.com/lake-formation/) and \n[AWS Glue](https://aws.amazon.com/glue) permissions. \n\n# Features\n\nLakeCLI provides an *information schema* and supports SQL GRANT/REVOKE statements. These features help administrators\n* Use familiar SQL features to view and manage permissions\n* Write scripts to automate on-boarding and removing permissions.\n* Write scripts to monitor & alert permissions to ensure best practices and policies are followed.\n\n## Information Schema\nLakeCLI provides two tables:\n\n1. *database_privileges*\n2. *table_privileges*\n\n### Database Privileges\n| Column | Description |\n|--------|-------------|\n| id | Primary Key | \n| schema_name | Name of the Schema | \n| principal | AWS IAM Role or User |\n| permission | Permission type (Described in a later section) |\n| grant | Boolean. Describes if the principal is allowed to grant permission to others | \n\n### Table Privileges\n| Column | Description |\n|--------|-------------|\n| id | Primary Key | \n| schema_name | Schema Name of the Table | \n| table_name | Name of the Table |\n| principal | AWS IAM Role or User |\n| permission | Permission type (Described in a later section) |\n| grant | Boolean. Describes if the principal is allowed to grant permission to others | \n\n## GRANT/REVOKE Statements\n\n GRANT/REVOKE { { PERMISSION TYPE }\n [, ...] }\n ON { [ TABLE | DATABASE ] name }\n TO role_specification\n\n### Permission Types\n\n* ALL\n* SELECT\n* ALTER\n* DROP\n* DELETE\n* INSERT\n* CREATE_DATABASE\n* CREATE_TABLE\n* DATA_LOCATION_ACCESS\n\n# Examples\n\n## Table Privileges\n\n \\r:iamdb> SELECT * FROM table_privileges;\n +----+-------------+----------------+--------------+------------+-------+\n | id | schema_name | table_name | principal | permission | grant |\n +----+-------------+----------------+--------------+------------+-------+\n | 1 | taxidata | raw_misc | role/lakecli | ALL | 1 |\n | 2 | taxidata | raw_misc | role/lakecli | ALTER | 1 |\n | 3 | taxidata | raw_misc | role/lakecli | DELETE | 1 |\n +----+-------------+----------------+--------------+------------+-------+\n\n## Database Privileges\n\n \\r:iamdb> SELECT * FROM database_privileges;\n +----+-------------+--------------------------------+--------------+-------+\n | id | schema_name | principal | permission | grant |\n +----+-------------+--------------------------------+--------------+-------+\n | 9 | taxilake | role/LakeFormationWorkflowRole | CREATE_TABLE | 1 |\n | 10 | taxilake | role/LakeFormationWorkflowRole | DROP | 1 |\n | 11 | default | user/datalake_user | ALTER | 0 |\n | 12 | default | user/datalake_user | CREATE_TABLE | 0 |\n | 13 | default | user/datalake_user | DROP | 0 |\n +----+-------------+--------------------------------+--------------+-------+\n\n## GRANT\n\n \\r:iamdb> grant SELECT ON TABLE 'taxidata'.'raw_misc' TO 'user/datalake_user';\n GRANT\n Time: 1.467s\n\n## REVOKE\n\n \\r:iamdb> revoke SELECT ON TABLE 'taxidata'.'raw_misc' TO 'user/datalake_user';\n REVOKE\n Time: 1.450s\n\n# Quick Start\n\n## Install\n\n``` bash\n$ pip install lakecli\n```\n\n## Config\n\nA config file is automatically created at `~/.lakecli/lakeclirc` at first launch (run lakecli). \nSee the file itself for a description of all available options.\n\nBelow 4 variables are required. \n\n``` text\n# AWS credentials\naws_access_key_id = ''\naws_secret_access_key = ''\nregion = '' # e.g us-west-2, us-east-1\naccount_id = ''\n```\n\nor you can also use environment variables:\n\n``` bash\n$ export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID\n$ export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY\n$ export AWS_DEFAULT_REGION=us-west-2\n$ export AWS_ACCOUNT_ID=ACCOUNT_ID\n```\n\n# Features\n\n- Auto-completes as you type for SQL keywords as well as tables and columns in the database.\n- Syntax highlighting.\n- Smart-completion will suggest context-sensitive completion.\n - `SELECT * FROM ` will only show table names.\n - `SELECT * FROM users WHERE ` will only show column names.\n- Pretty prints tabular data and various table formats.\n- Some special commands. e.g. Favorite queries.\n- Alias support. Column completions will work even when table names are aliased.\n\n# Usages\n\n```bash\n$ lakecli --help\nUsage: lakecli [OPTIONS]\n\n A Athena terminal client with auto-completion and syntax highlighting.\n\n Examples:\n - lakecli\n - lakecli my_database\n\nOptions:\n -e, --execute TEXT Execute a command (or a file) and quit.\n -r, --region TEXT AWS region.\n --aws-access-key-id TEXT AWS access key id.\n --aws-secret-access-key TEXT AWS secretaccess key.\n --aws-account-id TEXT Amazon Account ID.\n --lake-cli-rc FILE Location of lake_cli_rc file.\n --profile TEXT AWS profile\n --scan / --no-scan\n --help Show this message and exit.\n```\n\n# Credits\n\nLakeCLI is based on [AthenaCLI](https://github.com/dbcli/athenacli) and the excellent [DBCli](https://www.dbcli.com/) \nproject. A big thanks to all of them for providing a great foundation to build SQL CLI projects.\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/tokern/lakecli", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lakecli", "package_url": "https://pypi.org/project/lakecli/", "platform": "", "project_url": "https://pypi.org/project/lakecli/", "project_urls": { "Homepage": "https://github.com/tokern/lakecli" }, "release_url": "https://pypi.org/project/lakecli/0.2.0/", "requires_dist": [ "Pygments (>=1.6)", "boto3 (>=1.4.4)", "botocore (>=1.5.52)", "cli-helpers[styles] (>=1.0.1)", "click (>=4.1)", "configobj (>=5.0.5)", "peewee (>=3.11.2)", "prompt-toolkit (<1.1.0,>=1.0.10)", "sqlparse (<0.3.0,>=0.2.2)" ], "requires_python": "", "summary": "CLI for Athena Database and AWS Lake Formation. With auto-completion and syntax highlighting.", "version": "0.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 6273460, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "3cf27a885206aaccc0ef25fe024dfe84", "sha256": "d2b93c2dd4ad3c1d8757394f506011b2fb8918e49b99c71dcd2272fe5a99a5b5" }, "downloads": -1, "filename": "lakecli-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3cf27a885206aaccc0ef25fe024dfe84", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 53213, "upload_time": "2019-10-31T07:23:24", "upload_time_iso_8601": "2019-10-31T07:23:24.338785Z", "url": "https://files.pythonhosted.org/packages/96/78/6639bac739b9b5873480ab552ecaa48ec614e7a6dddc10392b4ec1c139ad/lakecli-0.1.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "d8fc6ab7b5b4f88e90793dfe31900612", "sha256": "bf6a0e3b95506f28ee56f26e1303b772dadf44f46288f4d15a04554ad7be3b4c" }, "downloads": -1, "filename": "lakecli-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d8fc6ab7b5b4f88e90793dfe31900612", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43733, "upload_time": "2019-10-31T07:23:29", "upload_time_iso_8601": "2019-10-31T07:23:29.545330Z", "url": "https://files.pythonhosted.org/packages/ce/cc/7e374625ab89fd59785c4617f14ac292591d4b31625035b39f4e144525f5/lakecli-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "656cda532e142595882a5fa24029639a", "sha256": "147e61db063503369436c9feba9d1b12c88e7e9b38313f2f51c82cbf0d07a82a" }, "downloads": -1, "filename": "lakecli-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "656cda532e142595882a5fa24029639a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 61782, "upload_time": "2019-12-10T15:06:43", "upload_time_iso_8601": "2019-12-10T15:06:43.541880Z", "url": "https://files.pythonhosted.org/packages/08/2d/a9aa76ffdb30f7eff86f3ed3cb2a6e112d25d69c93222a4537aff8d94e5e/lakecli-0.2.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4f317a01c4121f82f2cf1f019db02854", "sha256": "59a5ae3a441909e0346810969f0b7e91342167359ca0bffa7d1207dcdb151179" }, "downloads": -1, "filename": "lakecli-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4f317a01c4121f82f2cf1f019db02854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46763, "upload_time": "2019-12-10T15:06:49", "upload_time_iso_8601": "2019-12-10T15:06:49.274380Z", "url": "https://files.pythonhosted.org/packages/c0/3b/1303b85e0058721784ce8b5213efc18a47d22c9cd2333f77139c0ca589dc/lakecli-0.2.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "656cda532e142595882a5fa24029639a", "sha256": "147e61db063503369436c9feba9d1b12c88e7e9b38313f2f51c82cbf0d07a82a" }, "downloads": -1, "filename": "lakecli-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "656cda532e142595882a5fa24029639a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 61782, "upload_time": "2019-12-10T15:06:43", "upload_time_iso_8601": "2019-12-10T15:06:43.541880Z", "url": "https://files.pythonhosted.org/packages/08/2d/a9aa76ffdb30f7eff86f3ed3cb2a6e112d25d69c93222a4537aff8d94e5e/lakecli-0.2.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4f317a01c4121f82f2cf1f019db02854", "sha256": "59a5ae3a441909e0346810969f0b7e91342167359ca0bffa7d1207dcdb151179" }, "downloads": -1, "filename": "lakecli-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4f317a01c4121f82f2cf1f019db02854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46763, "upload_time": "2019-12-10T15:06:49", "upload_time_iso_8601": "2019-12-10T15:06:49.274380Z", "url": "https://files.pythonhosted.org/packages/c0/3b/1303b85e0058721784ce8b5213efc18a47d22c9cd2333f77139c0ca589dc/lakecli-0.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }