Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
AthenaCLI is a command line interface (CLI) for the Athena service that can do auto-completion and syntax highlighting, and is a proud member of the dbcli community.
pip
If you already know how to install python packages, then you can simply do:
$ pip install athenacli
brew
Homebrew users can install by:
$ brew install athenacli
If you don't know how to install python packages, please check the Install page for more options (e.g docker)
A config file is automatically created at ~/.athenacli/athenaclirc
at first launch (run athenacli). See the file itself for a description of all available options.
Below 4 variables are required. If you are a user of aws cli, you can refer to awsconfig file to see how to reuse credentials configuration of aws cli.
# AWS credentials
aws_access_key_id = ''
aws_secret_access_key = ''
region = '' # e.g us-west-2, us-east-1
# Amazon S3 staging directory where query results are stored.
# NOTE: S3 should in the same region as specified above.
# The format is 's3://<your s3 directory path>'
s3_staging_dir = ''
# Name of athena workgroup that you want to use
work_group = '' # e.g. primary
or you can also use environment variables:
$ export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
$ export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
$ export AWS_DEFAULT_REGION=us-west-2
$ export AWS_ATHENA_S3_STAGING_DIR=s3://YOUR_S3_BUCKET/path/to/
$ export AWS_ATHENA_WORK_GROUP=YOUR_ATHENA_WORK_GROUP
$ athenacli -e examples/create_table.sql
You can find examples/create_table.sql
here.
$ athenacli -e 'select elb_name, request_ip from elb_logs LIMIT 10'
$ athenacli [<database_name>]
SELECT * FROM <tab>
will only show table names.SELECT * FROM users WHERE <tab>
will only show column names.Please refer to the Features page for the screenshots of above features.
$ athenacli --help
Usage: main.py [OPTIONS] [DATABASE]
A Athena terminal client with auto-completion and syntax highlighting.
Examples:
- athenacli
- athenacli my_database
Options:
-e, --execute TEXT Execute a command (or a file) and quit.
-r, --region TEXT AWS region.
--aws-access-key-id TEXT AWS access key id.
--aws-secret-access-key TEXT AWS secretaccess key.
--s3-staging-dir TEXT Amazon S3 staging directory where query
results are stored.
--work-group TEXT Amazon Athena workgroup in which query is run, default is primary
--athenaclirc PATH Location of athenaclirc file.
--help Show this message and exit.
Please go to the Usages for detailed information on how to use AthenaCLI.
If 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 to describe how to get this running in a development setup.
Please feel free to reach out to me if you need help. My email: zhuzhaolong0 AT gmail com
Please refer to the FAQs for other information, e.g. "How can I get support for athenacli?".
A special thanks to Amjith Ramanujam for creating pgcli and mycli, which inspired me to create this AthenaCLI, and AthenaCLI is created based on a clone of mycli.
Thanks to Jonathan Slenders for creating the Python Prompt Toolkit, which leads me to pgcli and mycli. It's a lot of fun playing with this library.
Thanks to PyAthena for a pure python adapter to Athena database.
Last but not least, thanks my team and manager encourage me to work on this hobby project.
FAQs
CLI for Athena Database. With auto-completion and syntax highlighting.
We found that athenacli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.