Skip to content
This repository was archived by the owner on Mar 31, 2021. It is now read-only.

Commit a129eb5

Browse files
authored
Updated release metadata file setup.py (#38)
1 parent df4f0c5 commit a129eb5

File tree

3 files changed

+64
-48
lines changed

3 files changed

+64
-48
lines changed

README.md

+58-43
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,62 @@
11
# Open Distro for Elasticsearch SQL CLI
22

33
The SQL CLI component in Open Distro for Elasticsearch (ODFE) is a stand-alone Python application and can be launched by a 'wake' word `odfesql`.
4-
It serves as a support only for [Open Distro SQL plugin for Elasticsearch](https://opendistro.github.io/for-elasticsearch-docs/docs/sql/).
5-
User must have the ODFE SQL plugin installed to your Elasticsearch instance to connect.
6-
Users can run this CLI from MacOS and Linux, and connect to any valid Elasticsearch end-point such as Amazon Elasticsearch.
4+
5+
It only supports [Open Distro for Elasticsearch (ODFE) SQL Plugin](https://opendistro.github.io/for-elasticsearch-docs/docs/sql/)
6+
You must have the ODFE SQL plugin installed to your Elasticsearch instance to connect.
7+
Users can run this CLI from MacOS and Linux, and connect to any valid Elasticsearch end-point such as Amazon Elasticsearch Service (AES).
78

89
![](./screenshots/usage.gif)
910

1011

11-
## Features
1212

13-
- Multi-line input
14-
- Autocomplete for SQL syntax and index names
15-
- Syntax highlighting
16-
- Formatted output:
17-
- Tabular format
18-
- Field names with color
19-
- Enabled horizontal display (by default) and vertical display when output is too wide for your terminal, for better visualization
20-
- Pagination for large output
21-
- Connect to Elasticsearch with/without security enabled on either **Elasticsearch OSS or Amazon Elasticsearch domains**.
22-
- Supports loading configuration files
23-
- Supports all SQL plugin queries
13+
## Features
2414

15+
* Multi-line input
16+
* Autocomplete for SQL syntax and index names
17+
* Syntax highlighting
18+
* Formatted output:
19+
* Tabular format
20+
* Field names with color
21+
* Enabled horizontal display (by default) and vertical display when output is too wide for your terminal, for better visualization
22+
* Pagination for large output
23+
* Connect to Elasticsearch with/without security enabled on either **Elasticsearch OSS or Amazon Elasticsearch Service domains**.
24+
* Supports loading configuration files
25+
* Supports all SQL plugin queries
2526

2627
## Install
2728

28-
Launch your local Elasticsearch instance and make sure you have the Open Distro SQL plugin for Elasticsearch installed.
29+
Launch your local Elasticsearch instance and make sure you have the Open Distro for Elasticsearch SQL plugin installed.
2930

3031
To install the SQL CLI:
3132

33+
3234
1. We suggest you install and activate a python3 virtual environment to avoid changing your local environment:
35+
3336
```
3437
pip install virtualenv
3538
virtualenv venv
3639
cd venv
3740
source ./bin/activate
3841
```
3942
40-
2. Install the CLI:
43+
44+
1. Install the CLI:
45+
4146
```
42-
pip3 install odfesql
47+
pip3 install odfe-sql-cli
4348
```
4449
45-
The SQL CLI only works with Python 3, because Python 2 is no longer maintained since 01/01/2020. See https://pythonclock.org/
50+
The SQL CLI only works with Python 3, since Python 2 is no longer maintained since 01/01/2020. See https://pythonclock.org/
51+
52+
53+
1. To launch the CLI, run:
4654
47-
3. To launch the CLI, run:
4855
```
49-
odfesql https://localhost:9200 --username admin --password admin
56+
odfesql https://localhost:9200 --username admin password admin
5057
```
51-
By default, the `odfesql` command connects to http://localhost:9200.
58+
By default, the `odfesql` command connects to [http://localhost:9200](http://localhost:9200/).
59+
5260
5361
5462
## Configure
@@ -57,65 +65,72 @@ When you first launch the SQL CLI, a configuration file is automatically created
5765
5866
You can also configure the following connection properties:
5967
60-
- `endpoint`: You do not need to specify an option, anything that follows the launch command `odfesql` is considered as the endpoint. If you do not provide an endpoint, by default, the SQL CLI connects to http://localhost:9200.
61-
- `-u/-w`: Supports username and password for HTTP basic authentication, such as:
62-
- Elasticsearch with X-pack security enabled
63-
- Elasticsearch OSS with [Open Distro Security Plugin](https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/) installed
64-
- Amazon Elasticsearch domain with [Fine Grained Access Control](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/fgac.html) enabled
65-
- `--aws-auth`: Turns on AWS sigV4 authentication to connect to an Amazon Elasticsearch endpoint. Use with the AWS CLI (`aws configure`) to retrieve the local AWS configuration to authenticate and connect.
68+
69+
* `endpoint`: You do not need to specify an option, anything that follows the launch command `odfesql` is considered as the endpoint. If you do not provide an endpoint, by default, the SQL CLI connects to [http://localhost:9200](http://localhost:9200/).
70+
* `-u/-w`: Supports username and password for HTTP basic authentication, such as:
71+
* Elasticsearch OSS with [Open Distro for Elasticsearch Security Plugin](https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/) installed
72+
* Amazon Elasticsearch Service domain with [Fine Grained Access Control](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/fgac.html) enabled
73+
* Elasticsearch with X-pack security enabled
74+
* `--aws-auth`: Turns on AWS sigV4 authentication to connect to an Amazon Elasticsearch Service endpoint. Use with the AWS CLI (`aws configure`) to retrieve the local AWS configuration to authenticate and connect.
6675
6776
For a list of all available configurations, see [clirc](https://github.com/opendistro-for-elasticsearch/sql-cli/blob/master/src/conf/clirc).
6877
6978
79+
7080
## Using the CLI
7181
7282
1. Save the sample [accounts test data](https://github.com/opendistro-for-elasticsearch/sql/blob/master/src/test/resources/doctest/testdata/accounts.json) file.
7383
2. Index the sample data.
84+
7485
```
75-
curl -H "Content-Type: application/x-ndjson" -POST https://localhost:9200/data/_bulk -u admin:admin --insecure --data-binary "@accounts.json"
86+
curl -H "Content-Type: application/x-ndjson" -POST https://localhost:9200/data/_bulk -u admin:admin --insecure data-binary "@accounts.json"
7687
```
7788
78-
3. Run a simple SQL command in ODFE SQL CLI:
89+
90+
1. Run a simple SQL command in ODFE SQL CLI:
91+
7992
```
8093
SELECT * FROM accounts;
8194
```
8295
8396
By default, you see a maximum output of 200 rows. To show more results, add a `LIMIT` clause with the desired value.
8497
85-
The CLI supports all types of query that ODFE SQL supports. Refer to [ODFE SQL basic usage](https://github.com/opendistro-for-elasticsearch/sql#basic-usage)
98+
The CLI supports all types of query that ODFE SQL supports. Refer to [ODFE SQL basic usage documentation.](https://github.com/opendistro-for-elasticsearch/sql#basic-usage)
99+
86100
87101
## Query options
88102
89103
Run single query from command line with options
90104
91-
- `--help`: help page for options
92-
- `-q`: follow by a single query
93-
- `-f`: support *jdbc/raw* format output
94-
- `-v`: display data vertically
95-
- `-e`: translate sql to DSL
105+
106+
* `--help`: help page for options
107+
* `-q`: follow by a single query
108+
* `-f`: support *jdbc/raw* format output
109+
* `-v`: display data vertically
110+
* `-e`: translate sql to DSL
96111
97112
## CLI Options
98-
- `-p`: always use pager to display output
99-
- `--clirc`: provide path of config file to load
100113
114+
* `-p`: always use pager to display output
115+
* `--clirc`: provide path of config file to load
101116
102117
## Code of Conduct
103118
104119
This project has adopted an [Open Source Code of Conduct](https://opendistro.github.io/for-elasticsearch/codeofconduct.html).
105120
106121
107-
## Security issue notifications
108122
109-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security
110-
via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/).
111-
Please do **not** create a public GitHub issue.
123+
## Security issue notifications
112124
125+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue for security bugs you report.
113126
114127
## Licensing
115128
116-
See the [LICENSE](./LICENSE.TXT) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
129+
See the [LICENSE](https://github.com/opendistro-for-elasticsearch/sql-cli/blob/master/LICENSE.TXT) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
130+
117131
118132
119133
## Copyright
120134
121135
Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
136+

development_guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ https uses 443 by default.
4949
2. `python3 -m pip install --user --upgrade twine`
5050
3. `python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
5151
6. Install your package from TestPyPI and do manual test
52-
1. `pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple odfesql`
52+
1. `pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple odfe-sql-cli`
5353
7. Upload to PyPI
5454
1. Register an account on [PyPI](https://pypi.org/), note that these are two separate servers and the credentials from the test server are not shared with the main server.
5555
2. Use `twine upload dist/*` to upload your package and enter your credentials for the account you registered on PyPI.You don’t need to specify --repository; the package will upload to https://pypi.org/ by default.

setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1))
3636
)
3737

38-
description = "CLI for Elasticsearch Open Distro SQL with auto-completion and syntax highlighting."
38+
description = "Open Distro for Elasticsearch SQL CLI with auto-completion and syntax highlighting"
3939

4040
with open("README.md", "r") as fh:
4141
long_description = fh.read()
4242

4343
setup(
44-
name="odfesql",
45-
author="Zhongnan Su",
46-
author_email="szhongna@amazon.com",
44+
name="odfe-sql-cli",
45+
author="Open Distro for Elasticsearch",
46+
author_email="odfe-infra@amazon.com",
4747
version=version,
4848
license="Apache 2.0",
4949
url="https://opendistro.github.io/for-elasticsearch-docs/",
@@ -65,6 +65,7 @@
6565
"Programming Language :: Python :: 3.5",
6666
"Programming Language :: Python :: 3.6",
6767
"Programming Language :: Python :: 3.7",
68+
"Programming Language :: Python :: 3.8",
6869
"Programming Language :: SQL",
6970
"Topic :: Database",
7071
"Topic :: Database :: Front-Ends",

0 commit comments

Comments
 (0)