{"id":13821331,"url":"https://github.com/dbcli/athenacli","last_synced_at":"2025-04-05T11:07:54.939Z","repository":{"id":33021048,"uuid":"145800435","full_name":"dbcli/athenacli","owner":"dbcli","description":"AthenaCLI is a CLI tool for AWS Athena service that can do auto-completion and syntax highlighting.","archived":false,"fork":false,"pushed_at":"2022-05-16T00:50:48.000Z","size":1019,"stargazers_count":205,"open_issues_count":7,"forks_count":31,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-04-26T13:31:45.842Z","etag":null,"topics":["athena-cli","autocompletion","aws-athena","aws-cli","bigdata","cli","command-line","python","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://athenacli.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbcli.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-23T04:30:53.000Z","updated_at":"2024-04-20T14:27:25.000Z","dependencies_parsed_at":"2022-08-07T19:30:24.605Z","dependency_job_id":null,"html_url":"https://github.com/dbcli/athenacli","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcli%2Fathenacli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcli%2Fathenacli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcli%2Fathenacli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbcli%2Fathenacli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbcli","download_url":"https://codeload.github.com/dbcli/athenacli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["athena-cli","autocompletion","aws-athena","aws-cli","bigdata","cli","command-line","python","syntax-highlighting"],"created_at":"2024-08-04T08:01:20.066Z","updated_at":"2025-04-05T11:07:54.919Z","avatar_url":"https://github.com/dbcli.png","language":"Python","funding_links":[],"categories":["Python","Open Source Repos","CLI"],"sub_categories":["CLI","dbcli"],"readme":"[![Build Status](https://travis-ci.org/dbcli/athenacli.svg?branch=master)](https://travis-ci.org/dbcli/athenacli)\n[![PyPI](https://img.shields.io/pypi/v/athenacli.svg)](https://pypi.python.org/pypi/athenacli)\n[![Downloads](https://pepy.tech/badge/athenacli)](https://pepy.tech/project/athenacli)\n[![image](https://img.shields.io/pypi/l/athenacli.svg)](https://pypi.org/project/athenacli/)\n[![image](https://img.shields.io/pypi/pyversions/athenacli.svg)](https://pypi.org/project/athenacli/)\n[![Join the chat at https://gitter.im/dbcli/athenacli](https://badges.gitter.im/dbcli/athenacli.svg)](https://gitter.im/dbcli/athenacli?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n# Introduction\n\nAthenaCLI is a command line interface (CLI) for the [Athena](https://aws.amazon.com/athena/) service that can do auto-completion and syntax highlighting, and is a proud member of the dbcli community.\n\n![](./docs/_static/gif/athenacli.gif)\n\n# Quick Start\n\n## Install\n\n### Install via `pip`\n\nIf you already know how to install python packages, then you can simply do:\n\n``` bash\n$ pip install athenacli\n```\n\n### Install via `brew`\n\n[Homebrew](https://brew.sh/) users can install by:\n\n```sh\n$ brew install athenacli\n```\n\nIf you don't know how to install python packages, please check the [Install](./docs/install.rst) page for more options (e.g docker)\n\n## Config\n\nA config file is automatically created at `~/.athenacli/athenaclirc` at first launch (run athenacli). See the file itself for a description of all available options.\n\nBelow 4 variables are required. If you are a user of aws cli, you can refer to [awsconfig](./docs/awsconfig.rst) file to see how to reuse credentials configuration of aws cli.\n\n``` text\n# AWS credentials\naws_access_key_id = ''\naws_secret_access_key = ''\nregion = '' # e.g us-west-2, us-east-1\n\n# Amazon S3 staging directory where query results are stored.\n# NOTE: S3 should in the same region as specified above.\n# The format is 's3://\u003cyour s3 directory path\u003e'\ns3_staging_dir = ''\n\n# Name of athena workgroup that you want to use\nwork_group = '' # e.g. primary\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_ATHENA_S3_STAGING_DIR=s3://YOUR_S3_BUCKET/path/to/\n$ export AWS_ATHENA_WORK_GROUP=YOUR_ATHENA_WORK_GROUP\n```\n\n## Create a table\n\n``` bash\n$ athenacli -e examples/create_table.sql\n```\n\nYou can find `examples/create_table.sql` [here](./examples/create_table.sql).\n\n## Run a query\n\n``` bash\n$ athenacli -e 'select elb_name, request_ip from elb_logs LIMIT 10'\n```\n\n## REPL\n\n``` bash\n$ athenacli [\u003cdatabase_name\u003e]\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 \u003ctab\u003e` will only show table names.\n    - `SELECT * FROM users WHERE \u003ctab\u003e` 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\nPlease refer to the [Features](./docs/features.rst) page for the screenshots of above features.\n\n# Usages\n\n```bash\n$ athenacli --help\nUsage: main.py [OPTIONS] [DATABASE]\n\nA Athena terminal client with auto-completion and syntax highlighting.\n\nExamples:\n    - athenacli\n    - athenacli 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--s3-staging-dir TEXT         Amazon S3 staging directory where query\n                                results are stored.\n--work-group TEXT             Amazon Athena workgroup in which query is run, default is primary\n--athenaclirc PATH            Location of athenaclirc file.\n--help                        Show this message and exit.\n```\n\nPlease go to the [Usages](https://athenacli.readthedocs.io/en/latest/usage.html) for detailed information on how to use AthenaCLI.\n\n# Contributions\n\nIf you're interested in contributing to this project, first of all I would like to extend my heartfelt gratitude. I've written a small [doc](https://athenacli.readthedocs.io/en/latest/develop.html) to describe how to get this running in a development setup.\n\nPlease feel free to reach out to me if you need help. My email: zhuzhaolong0 AT gmail com\n\n# FAQs\n\nPlease refer to the [FAQs](https://athenacli.readthedocs.io/en/latest/faq.html) for other information, e.g. \"How can I get support for athenacli?\".\n\n# Credits\n\nA special thanks to [Amjith Ramanujam](https://github.com/amjith) for creating pgcli and mycli, which inspired me to create this AthenaCLI, and AthenaCLI is created based on a clone of mycli.\n\nThanks to [Jonathan Slenders](https://github.com/jonathanslenders) for creating the [Python Prompt Toolkit](https://github.com/jonathanslenders/python-prompt-toolkit), which leads me to pgcli and mycli. It's a lot of fun playing with this library.\n\nThanks to [PyAthena](https://github.com/laughingman7743/PyAthena) for a pure python adapter to Athena database.\n\nLast but not least, thanks my team and manager encourage me to work on this hobby project.\n\n# Similar projects\n\n- [satterly/athena-cli](https://github.com/satterly/athena-cli): Presto-like CLI tool for AWS Athena.\n- [pengwynn/athena-cli](https://github.com/pengwynn/athena-cli): CLI for Amazon Athena, powered by JRuby.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbcli%2Fathenacli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbcli%2Fathenacli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbcli%2Fathenacli/lists"}