Skip to content

Commit

Permalink
[Enhancement] improve python client package info (StarRocks#18783)
Browse files Browse the repository at this point in the history
Signed-off-by: miomiocat <[email protected]>
  • Loading branch information
miomiocat authored Mar 2, 2023
1 parent 7082c98 commit 0383a29
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
6 changes: 2 additions & 4 deletions contrib/starrocks-python-client/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# StarRocks Python Client
A StarRocks client for the Python programming language.

StarRocks is the next-generation data platform designed to make data-intensive real-time analytics fast and easy. It delivers query speeds 5 to 10 times faster than other popular solutions. StarRocks can perform real-time analytics well while updating historical records. It can also enhance real-time analytics with historical data from data lakes easily. With StarRocks, you can get rid of the de-normalized tables and get the best performance and flexibility.

## Installation
```
pip install starrocks
Expand Down Expand Up @@ -36,7 +38,3 @@ connection = engine.connect()
rows = connection.execute(text("SELECT * FROM hive_table")).fetchall()
```

## Resources
1. [SQLAlchemy documentation](https://docs.sqlalchemy.org/en/13/index.html)
2. [SQLAlchemy dialects](https://docs.sqlalchemy.org/en/13/dialects/index.html)
16 changes: 11 additions & 5 deletions contrib/starrocks-python-client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@

_version_re = re.compile(r"__version__\s+=\s+(.*)")

with open("starrocks/sqlalchemy/__init__.py", "rb") as f:
with open("starrocks/__init__.py", "rb") as f:
python_client_version = _version_re.search(f.read().decode("utf-8"))
assert python_client_version is not None
version = str(ast.literal_eval(python_client_version.group(1)))

with open('README.md') as readme:
long_description = readme.read()

setup(
name="starrocks",
version=version,
description="StarRocks Dialect for SQLAlchemy",
description="Python interface to StarRocks",
long_description=long_description,
long_description_content_type="text/markdown",
license="Apache 2.0",
author="StarRocks Team",
url="https://github.com/StarRocks/starrocks",
license="Apache 2.0",
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: Apache Software License",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
Expand All @@ -48,6 +53,7 @@
"sqlalchemy-utils>=0.38.3, <0.39",
],
packages=find_packages(include=["starrocks", "starrocks.*"]),
package_data={"": ["LICENSE", "README.md"]},
include_package_data=True,
zip_safe=False,
entry_points={
Expand Down
18 changes: 18 additions & 0 deletions contrib/starrocks-python-client/starrocks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#! /usr/bin/python3
# Copyright 2021-present StarRocks, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "1.0.2"

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "1.0.0"
from sqlalchemy.dialects import registry

from .util import _url as URL # noqa

registry.register("starrocks", "starrocks.sqlalchemy.dialect", "StarRocksDialect")

0 comments on commit 0383a29

Please sign in to comment.