This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git
The following commit(s) were added to refs/heads/main by this push:
new aaa6752 refact: improve project structure & add some basic CI (#17)
aaa6752 is described below
commit aaa67529079d8d4b756a3187db54e232b0f6b1e8
Author: Simon Cheung <[email protected]>
AuthorDate: Fri Oct 20 18:28:49 2023 +0800
refact: improve project structure & add some basic CI (#17)
* chore: add some basic CI
---------
Co-authored-by: imbajin <[email protected]>
---
.github/ISSUE_TEMPLATE/bug_report.yml | 6 +-
.github/ISSUE_TEMPLATE/question_ask.yml | 6 +-
.github/workflows/check-dependencies.yml | 41 ++++++++++
.github/workflows/codeql.yml | 64 ++++++++++++++++
.github/workflows/pylint.yml | 27 +++++++
.licenserc.yaml | 89 ++++++++++++++++++++++
hugegraph-llm/README.md | 14 ++--
hugegraph-llm/examples/build_kg_test.py | 4 +-
.../src/{ => hugegraph_llm/llms}/__init__.py | 0
.../{operators/llm => hugegraph_llm/llms}/base.py | 0
.../llm => hugegraph_llm/llms}/openai_llm.py | 2 +-
.../operators/build_kg_operator.py | 8 +-
.../operators/hugegraph_op}/__init__.py | 0
.../operators/hugegraph_op}/commit_data_to_kg.py | 4 +-
.../operators/llm_op}/__init__.py | 0
.../operators/llm_op}/disambiguate_data.py | 4 +-
.../operators/llm_op}/parse_text_to_data.py | 4 +-
.../operators/llm_op}/unstructured_data_utils.py | 0
hugegraph-llm/src/operators/llm/__init__.py | 16 ----
.../README.md | 12 +--
.../example/__init__.py | 0
.../example/client_test.py | 1 -
.../example/hugegraph_test.py | 2 +-
.../example/test.py | 6 +-
.../requirements.txt | 0
.../src/pyhugegraph/api}/__init__.py | 0
.../src/pyhugegraph}/api/common.py | 2 +-
.../src/pyhugegraph}/api/graph.py | 12 +--
.../src/pyhugegraph}/api/graphs.py | 10 +--
.../src/pyhugegraph}/api/gremlin.py | 10 +--
.../src/pyhugegraph}/api/schema.py | 24 +++---
.../src/pyhugegraph/api/schema_manage}/__init__.py | 0
.../pyhugegraph}/api/schema_manage/edge_label.py | 8 +-
.../pyhugegraph}/api/schema_manage/index_label.py | 8 +-
.../pyhugegraph}/api/schema_manage/property_key.py | 8 +-
.../pyhugegraph}/api/schema_manage/vertex_label.py | 8 +-
.../src/pyhugegraph}/client.py | 12 +--
.../src/pyhugegraph/structure}/__init__.py | 0
.../src/pyhugegraph}/structure/edge_data.py | 0
.../src/pyhugegraph}/structure/edge_label_data.py | 0
.../src/pyhugegraph}/structure/graph_instance.py | 0
.../src/pyhugegraph}/structure/index_label_data.py | 0
.../pyhugegraph}/structure/property_key_data.py | 0
.../src/pyhugegraph}/structure/respon_data.py | 0
.../src/pyhugegraph}/structure/vertex_data.py | 0
.../pyhugegraph}/structure/vertex_label_data.py | 0
.../src/pyhugegraph/utils}/__init__.py | 0
.../src/pyhugegraph}/utils/constants.py | 0
.../src/pyhugegraph}/utils/exceptions.py | 0
.../src/pyhugegraph}/utils/huge_decorator.py | 2 +-
.../src/pyhugegraph}/utils/huge_requests.py | 0
.../src/pyhugegraph}/utils/util.py | 2 +-
hugegraph-python/src/utils/__init__.py | 16 ----
53 files changed, 313 insertions(+), 119 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml
b/.github/ISSUE_TEMPLATE/bug_report.yml
index d3229f1..2084581 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -12,7 +12,7 @@ body:
1. We need as much detailed information as possible to reproduce the
problem, the more detailed information (including
logs/screenshots/configurations, etc.) will be responded and processed faster.
我们需要尽可能**详细**的信息来**复现**问题, 越详细的信息 (包括**日志 / 截图 / 配置**等)会**越快**被响应和处理。
2. Please keep the original template category (for example: [Bug]) for
the Issue title. You can add blank lines or use serial numbers between long
descriptions to keep the typesetting clear.
- Issue 标题请保持原有模板分类(例如:`[Bug]`), 长段描述之间可以增加`空行`或使用`序号`标记, 保持排版清晰。
+ Issue 标题请保持原有模板分类(例如:`[Bug]`), 长段描述之间可以增加`空行`或使用`序号`标记,保持排版清晰。
3. Please submit an issue in the corresponding module, lack of valid
information / long time (>14 days) unanswered issues may be closed (will be
reopened when updated).
请在对应的模块提交 issue, 缺乏有效信息 / 长时间 (> 14 天) 没有回复的 issue 可能会被
**关闭**(更新时会再开启)。
@@ -42,7 +42,7 @@ body:
value: |
- Server Version: v1.x.x
- Toolchain Version: v1.x.x
- - Data Size: xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) -->
+ - Data Size: xx vertices, xx edges <!-- (like 1000W 点,9000W 边) -->>
validations:
required: true
@@ -51,7 +51,7 @@ body:
label: Expected & Actual behavior (期望与实际表现)
description: |
we can refer [How to create a minimal reproducible
Example](https://stackoverflow.com/help/minimal-reproducible-example), if
possible, please provide screenshots or GIF.
- 可以参考
[如何提供最简的可复现用例](https://stackoverflow.com/help/minimal-reproducible-example),请提供清晰的截图,
动图录屏更佳。
+ 可以参考
[如何提供最简的可复现用例](https://stackoverflow.com/help/minimal-reproducible-example),请提供清晰的截图,动图录屏更佳。
placeholder: |
type the main problem here
diff --git a/.github/ISSUE_TEMPLATE/question_ask.yml
b/.github/ISSUE_TEMPLATE/question_ask.yml
index 452c7dd..416102e 100644
--- a/.github/ISSUE_TEMPLATE/question_ask.yml
+++ b/.github/ISSUE_TEMPLATE/question_ask.yml
@@ -10,7 +10,7 @@ body:
1. We need as much detailed information as possible to reproduce the
problem, the more detailed information (including
logs/screenshots/configurations, etc.) will be responded and processed faster.
我们需要尽可能**详细**的信息来**复现**问题, 越详细的信息 (包括**日志 / 截图 / 配置**等)会**越快**被响应和处理。
2. Please keep the original template category (for example: [Bug]) for
the Issue title. You can add blank lines or use serial numbers between long
descriptions to keep the typesetting clear.
- Issue 标题请保持原有模板分类(例如:`[Bug]`), 长段描述之间可以增加`空行`或使用`序号`标记, 保持排版清晰。
+ Issue 标题请保持原有模板分类(例如:`[Bug]`), 长段描述之间可以增加`空行`或使用`序号`标记,保持排版清晰。
3. Please submit an issue in the corresponding module, lack of valid
information / long time (>14 days) unanswered issues may be closed (will be
reopened when updated).
请在对应的模块提交 issue, 缺乏有效信息 / 长时间 (> 14 天) 没有回复的 issue 可能会被
**关闭**(更新时会再开启)。
@@ -43,7 +43,7 @@ body:
value: |
- Server Version: 1.x.x
- Toolchain Version: 1.x.x
- - Data Size: xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) -->
+ - Data Size: xx vertices, xx edges <!-- (like 1000W 点,9000W 边) -->>
validations:
required: true
@@ -52,7 +52,7 @@ body:
label: Your Question (问题描述)
description: |
For issues related to graph usage/configuration, please refer to
[REST-API
documentation](https://hugegraph.apache.org/docs/clients/restful-api/), and
[Server configuration
documentation](https://hugegraph.apache.org/docs/config/config-option/) (if
possible, please provide screenshots or GIF).
- 图使用 / 配置相关问题,请优先参考 [REST-API
文档](https://hugegraph.apache.org/docs/clients/restful-api/), 以及 [Server
配置文档](https://hugegraph.apache.org/docs/config/config-option/) (请提供清晰的截图,
动图录屏更佳)
+ 图使用 / 配置相关问题,请优先参考 [REST-API
文档](https://hugegraph.apache.org/docs/clients/restful-api/), 以及 [Server
配置文档](https://hugegraph.apache.org/docs/config/config-option/) (请提供清晰的截图,动图录屏更佳)
placeholder: |
type the main problem here
diff --git a/.github/workflows/check-dependencies.yml
b/.github/workflows/check-dependencies.yml
new file mode 100644
index 0000000..b9781c0
--- /dev/null
+++ b/.github/workflows/check-dependencies.yml
@@ -0,0 +1,41 @@
+name: "3rd-party check"
+
+on:
+ push:
+ branches:
+ - main
+ - 'release-*'
+ pull_request:
+
+permissions:
+ contents: read
+ pull-requests: write
+
+jobs:
+ dependency-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: 'Checkout Repository'
+ uses: actions/checkout@v4
+ - name: 'Dependency Review'
+ uses: actions/dependency-review-action@v3
+ # Refer: https://github.com/actions/dependency-review-action
+ with:
+ fail-on-severity: low
+ comment-summary-in-pr: on-failure
+ # Action will fail if dependencies don't match the list
+ #allow-licenses: Apache-2.0, MIT
+ deny-licenses: GPL-3.0, AGPL-1.0, AGPL-3.0, LGPL-2.0, CC-BY-3.0
+
+ check-license:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Check License Header
+ uses: apache/skywalking-eyes@main
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ log: info
+ token: ${{ github.token }}
+ config: .licenserc.yaml
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000..174922f
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,64 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+
+jobs:
+ analyze:
+ name: Analyze
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
+ # - https://gh.io/supported-runners-and-hardware-resources
+ # - https://gh.io/using-larger-runners
+ # Consider using larger runners for possible analysis time improvements.
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') ||
'ubuntu-latest' }}
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'python' ]
+ # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin',
'javascript-typescript', 'python', 'ruby', 'swift' ]
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a
config file.
+ # By default, queries listed here will override any specified in a
config file.
+ # Prefix the list here with "+" to use these queries and those in the
config file.
+
+ # For more details on CodeQL's query packs, refer to:
https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java,
or Swift).
+ # If this step fails, then you should remove it and run the build manually
(see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following
three lines.
+ # modify them (or add more) to build your code if your project, please
refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
new file mode 100644
index 0000000..7566659
--- /dev/null
+++ b/.github/workflows/pylint.yml
@@ -0,0 +1,27 @@
+name: "Pylint"
+
+on:
+ push:
+ branches:
+ - 'release-*'
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.9", "3.10"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v3
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install pylint
+ - name: Analysing the code with pylint
+ run: |
+ pylint $(git ls-files '*.py')
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 0000000..1f8c6c9
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,89 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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
+#
+# http://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.
+#
+
+header: # `header` section is configurations for source codes license header.
+ license:
+ spdx-id: Apache-2.0 # the spdx id of the license, it's convenient when
your license is standard SPDX license.
+ copyright-owner: Apache Software Foundation # the copyright owner to
replace the [owner] in the `spdx-id` template.
+ content: | # `license` will be used as the content when `fix` command
needs to insert a license header.
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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
+ http://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.
+ # `pattern` is optional regexp if all the file headers are the same as
`license` or the license of `spdx-id` and `copyright-owner`.
+ pattern: |
+ Licensed to the Apache Software Foundation under one or more contributor
+ license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright
+ ownership. The Apache Software Foundation licenses this file to you 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
+ http://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.
+ paths: # `paths` are the path list that will be checked (and fixed) by
license-eye, default is ['**'].
+ - '**'
+
+ paths-ignore: # `paths-ignore` are the path list that will be ignored by
license-eye.
+ - '.gitignore'
+ - '.gitattributes'
+ - 'LICENSE'
+ - 'NOTICE'
+ - 'DISCLAIMER'
+ - '**/*.versionsBackup'
+ - '**/*.proto'
+ - '**/*.log'
+ - '**/*.txt'
+ - '**/*.json'
+ - '**/*.conf'
+ - '**/*.map'
+ - 'dist/**/*'
+ - '**/*.md'
+ - '**/logs/*.log'
+ - '**/META-INF/**/*'
+ - '**/target/*'
+ - 'style/*'
+ - 'ChangeLog'
+ - 'CONFIG.ini'
+ - 'GROUPS'
+ - 'OWNERS'
+ - '.github/**/*'
+ - '**/*.iml'
+ - '**/*.iws'
+ - '**/*.ipr'
+ - '**/META-INF/MANIFEST.MF'
+ - '.repository/**'
+
+ comment: on-failure
+ # on what condition license-eye will comment on the pull request,
`on-failure`, `always`, `never`.
+
+ # license-location-threshold specifies the index threshold where the license
header can be located,
+ # after all, a "header" cannot be TOO far from the file start.
+ license-location-threshold: 80
diff --git a/hugegraph-llm/README.md b/hugegraph-llm/README.md
index 3fb6441..ab1eec2 100644
--- a/hugegraph-llm/README.md
+++ b/hugegraph-llm/README.md
@@ -2,21 +2,25 @@
## Summary
-The hugegraph-llm is a tool for the implementation and research related to
large language models. This project includes runnable demos, it can also be
used as a third-party library.
+The hugegraph-llm is a tool for the implementation and research related to
large language models.
+This project includes runnable demos, it can also be used as a third-party
library.
-As we know, graph systems can help large models address challenges like
timeliness and hallucination, while large models can assist graph systems with
cost-related issues.
+As we know, graph systems can help large models address challenges like
timeliness and hallucination,
+while large models can assist graph systems with cost-related issues.
-With this project, we aim to reduce the cost of using graph systems, and
decrease the complexity of building knowledge graphs. This project will offers
more applications and integration solutions for graph systems and large
language models.
+With this project, we aim to reduce the cost of using graph systems, and
decrease the complexity of
+building knowledge graphs. This project will offer more applications and
integration solutions for
+graph systems and large language models.
1. Construct knowledge graph by LLM + HugeGraph
2. Use natural language to operate graph databases (gremlin)
3. Knowledge graph supplements answer context (RAG)
# Examples
-## Examples(knowledge graph construction by llm)
+## Examples (knowledge graph construction by llm)
1. Start the HugeGraph database, you can do it via Docker. Refer to this
[link](https://hub.docker.com/r/hugegraph/hugegraph) for guidance
-2. Run example like python hugegraph-llm/examples/build_kg_test.py
+2. Run example like `python hugegraph-llm/examples/build_kg_test.py`
Note: If you need a proxy to access OpenAI's API, please set your HTTP proxy
in `build_kg_test.py`.
diff --git a/hugegraph-llm/examples/build_kg_test.py
b/hugegraph-llm/examples/build_kg_test.py
index ef6dad5..e1bdfb3 100644
--- a/hugegraph-llm/examples/build_kg_test.py
+++ b/hugegraph-llm/examples/build_kg_test.py
@@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.
import os
-from src.operators.build_kg_operator import KgBuilder
-from src.operators.llm.openai_llm import OpenAIChat
+from hugegraph_llm.operators.build_kg_operator import KgBuilder
+from hugegraph_llm.llms.openai_llm import OpenAIChat
if __name__ == "__main__":
# If you need a proxy to access OpenAI's API, please set your HTTP proxy
here
diff --git a/hugegraph-llm/src/__init__.py
b/hugegraph-llm/src/hugegraph_llm/llms/__init__.py
similarity index 100%
rename from hugegraph-llm/src/__init__.py
rename to hugegraph-llm/src/hugegraph_llm/llms/__init__.py
diff --git a/hugegraph-llm/src/operators/llm/base.py
b/hugegraph-llm/src/hugegraph_llm/llms/base.py
similarity index 100%
rename from hugegraph-llm/src/operators/llm/base.py
rename to hugegraph-llm/src/hugegraph_llm/llms/base.py
diff --git a/hugegraph-llm/src/operators/llm/openai_llm.py
b/hugegraph-llm/src/hugegraph_llm/llms/openai_llm.py
similarity index 98%
rename from hugegraph-llm/src/operators/llm/openai_llm.py
rename to hugegraph-llm/src/hugegraph_llm/llms/openai_llm.py
index b8da930..ded7f34 100644
--- a/hugegraph-llm/src/operators/llm/openai_llm.py
+++ b/hugegraph-llm/src/hugegraph_llm/llms/openai_llm.py
@@ -19,7 +19,7 @@ import openai
import tiktoken
from retry import retry
-from src.operators.llm.base import BaseLLM
+from hugegraph_llm.llms.base import BaseLLM
class OpenAIChat(BaseLLM):
diff --git a/hugegraph-llm/src/operators/build_kg_operator.py
b/hugegraph-llm/src/hugegraph_llm/operators/build_kg_operator.py
similarity index 88%
rename from hugegraph-llm/src/operators/build_kg_operator.py
rename to hugegraph-llm/src/hugegraph_llm/operators/build_kg_operator.py
index 0b6753f..ee0d154 100644
--- a/hugegraph-llm/src/operators/build_kg_operator.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/build_kg_operator.py
@@ -14,13 +14,13 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from src.operators.build_kg.commit_data_to_kg import CommitDataToKg
-from src.operators.build_kg.disambiguate_data import DisambiguateData
-from src.operators.build_kg.parse_text_to_data import (
+from hugegraph_llm.operators.hugegraph_op.commit_data_to_kg import
CommitDataToKg
+from hugegraph_llm.operators.llm_op.disambiguate_data import DisambiguateData
+from hugegraph_llm.operators.llm_op.parse_text_to_data import (
ParseTextToData,
ParseTextToDataWithSchemas,
)
-from src.operators.llm.base import BaseLLM
+from hugegraph_llm.llms.base import BaseLLM
class KgBuilder:
diff --git a/hugegraph-llm/src/operators/__init__.py
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/__init__.py
similarity index 100%
rename from hugegraph-llm/src/operators/__init__.py
rename to hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/__init__.py
diff --git a/hugegraph-llm/src/operators/build_kg/commit_data_to_kg.py
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/commit_data_to_kg.py
similarity index 98%
rename from hugegraph-llm/src/operators/build_kg/commit_data_to_kg.py
rename to
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/commit_data_to_kg.py
index 79aec79..7d1c929 100644
--- a/hugegraph-llm/src/operators/build_kg/commit_data_to_kg.py
+++
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/commit_data_to_kg.py
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import os
-from hugegraph.connection import PyHugeGraph
+from pyhugegraph.client import PyHugeClient
def generate_new_relationships(nodes_schemas_data, relationships_data):
@@ -140,7 +140,7 @@ def generate_relationships(data):
class CommitDataToKg:
def __init__(self):
- self.client = PyHugeGraph(
+ self.client = PyHugeClient(
"127.0.0.1", "8080", user="admin", pwd="admin", graph="hugegraph"
)
self.schema = self.client.schema()
diff --git a/hugegraph-llm/src/operators/build_kg/__init__.py
b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/__init__.py
similarity index 100%
rename from hugegraph-llm/src/operators/build_kg/__init__.py
rename to hugegraph-llm/src/hugegraph_llm/operators/llm_op/__init__.py
diff --git a/hugegraph-llm/src/operators/build_kg/disambiguate_data.py
b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/disambiguate_data.py
similarity index 98%
rename from hugegraph-llm/src/operators/build_kg/disambiguate_data.py
rename to hugegraph-llm/src/hugegraph_llm/operators/llm_op/disambiguate_data.py
index cd7f3fe..e982d99 100644
--- a/hugegraph-llm/src/operators/build_kg/disambiguate_data.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/disambiguate_data.py
@@ -18,13 +18,13 @@ import json
import re
from itertools import groupby
-from src.operators.build_kg.unstructured_data_utils import (
+from hugegraph_llm.operators.llm_op.unstructured_data_utils import (
nodes_text_to_list_of_dict,
relationships_text_to_list_of_dict,
relationships_schemas_text_to_list_of_dict,
nodes_schemas_text_to_list_of_dict,
)
-from src.operators.llm.base import BaseLLM
+from hugegraph_llm.llms.base import BaseLLM
def disambiguate_nodes() -> str:
diff --git a/hugegraph-llm/src/operators/build_kg/parse_text_to_data.py
b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/parse_text_to_data.py
similarity index 98%
rename from hugegraph-llm/src/operators/build_kg/parse_text_to_data.py
rename to hugegraph-llm/src/hugegraph_llm/operators/llm_op/parse_text_to_data.py
index 8e1a3fb..1b67f76 100644
--- a/hugegraph-llm/src/operators/build_kg/parse_text_to_data.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/parse_text_to_data.py
@@ -17,13 +17,13 @@
import re
from typing import List
-from src.operators.build_kg.unstructured_data_utils import (
+from hugegraph_llm.operators.llm_op.unstructured_data_utils import (
nodes_text_to_list_of_dict,
nodes_schemas_text_to_list_of_dict,
relationships_schemas_text_to_list_of_dict,
relationships_text_to_list_of_dict,
)
-from src.operators.llm.base import BaseLLM
+from hugegraph_llm.llms.base import BaseLLM
def generate_system_message() -> str:
diff --git a/hugegraph-llm/src/operators/build_kg/unstructured_data_utils.py
b/hugegraph-llm/src/hugegraph_llm/operators/llm_op/unstructured_data_utils.py
similarity index 100%
rename from hugegraph-llm/src/operators/build_kg/unstructured_data_utils.py
rename to
hugegraph-llm/src/hugegraph_llm/operators/llm_op/unstructured_data_utils.py
diff --git a/hugegraph-llm/src/operators/llm/__init__.py
b/hugegraph-llm/src/operators/llm/__init__.py
deleted file mode 100644
index 13a8339..0000000
--- a/hugegraph-llm/src/operators/llm/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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
-#
-# http://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.
diff --git a/hugegraph-python/README.md b/hugegraph-python-client/README.md
similarity index 93%
rename from hugegraph-python/README.md
rename to hugegraph-python-client/README.md
index 4210647..ff15a42 100644
--- a/hugegraph-python/README.md
+++ b/hugegraph-python-client/README.md
@@ -1,4 +1,5 @@
# hugegraph-python
+
A Python SDK for Apache HugeGraph
# Installation
@@ -8,12 +9,13 @@ pip3 install hugegraph-python
```
## Install from source
+
release soon
# Examples
```python
-from src.client import PyHugeClient
+from pyhugegraph.client import PyHugeClient
client = PyHugeClient("127.0.0.1", "8080", user="admin", pwd="admin",
graph="hugegraph")
@@ -28,8 +30,9 @@ schema = client.schema()
schema.propertyKey("name").asText().ifNotExist().create()
schema.propertyKey("birthDate").asText().ifNotExist().create()
schema.vertexLabel("Person").properties("name",
"birthDate").usePrimaryKeyId().primaryKeys(
- "name").ifNotExist().create()
-schema.vertexLabel("Movie").properties("name").usePrimaryKeyId().primaryKeys("name").ifNotExist().create()
+ "name").ifNotExist().create()
+schema.vertexLabel("Movie").properties("name").usePrimaryKeyId().primaryKeys(
+ "name").ifNotExist().create()
schema.edgeLabel("ActedIn").sourceLabel("Person").targetLabel("Movie").ifNotExist().create()
print(schema.getVertexLabels())
@@ -58,5 +61,4 @@ g.close()
g = client.gremlin()
res = g.exec("g.V().limit(10)")
print(res)
-
-```
\ No newline at end of file
+```
diff --git a/hugegraph-python/example/__init__.py
b/hugegraph-python-client/example/__init__.py
similarity index 100%
rename from hugegraph-python/example/__init__.py
rename to hugegraph-python-client/example/__init__.py
diff --git a/hugegraph-python/example/client_test.py
b/hugegraph-python-client/example/client_test.py
similarity index 99%
rename from hugegraph-python/example/client_test.py
rename to hugegraph-python-client/example/client_test.py
index f68c727..323780b 100644
--- a/hugegraph-python/example/client_test.py
+++ b/hugegraph-python-client/example/client_test.py
@@ -21,4 +21,3 @@ class HugeGraphTest(unittest.TestCase):
result = client.exec("g.V().limit(10)")
self.assertIsInstance(result, MagicMock)
-
diff --git a/hugegraph-python/example/hugegraph_test.py
b/hugegraph-python-client/example/hugegraph_test.py
similarity index 96%
rename from hugegraph-python/example/hugegraph_test.py
rename to hugegraph-python-client/example/hugegraph_test.py
index e41908a..23b8de6 100644
--- a/hugegraph-python/example/hugegraph_test.py
+++ b/hugegraph-python-client/example/hugegraph_test.py
@@ -28,7 +28,7 @@ class HugeGraph:
) -> None:
"""Create a new HugeGraph wrapper instance."""
try:
- from src.client import PyHugeClient
+ from pyhugegraph.client import PyHugeClient
except ImportError:
raise ValueError(
"Please install HugeGraph Python client first: "
diff --git a/hugegraph-python/example/test.py
b/hugegraph-python-client/example/test.py
similarity index 96%
rename from hugegraph-python/example/test.py
rename to hugegraph-python-client/example/test.py
index 056ccae..adf3c2e 100644
--- a/hugegraph-python/example/test.py
+++ b/hugegraph-python-client/example/test.py
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-from src.client import PyHugeClient
+from pyhugegraph.client import PyHugeClient
if __name__ == '__main__':
client = PyHugeClient("127.0.0.1", "8080", user="admin", pwd="admin",
graph="test")
@@ -26,7 +26,8 @@ if __name__ == '__main__':
schema.propertyKey("birthDate").asText().ifNotExist().create()
schema.vertexLabel("Person").properties("name",
"birthDate").usePrimaryKeyId().primaryKeys(
"name").ifNotExist().create()
-
schema.vertexLabel("Movie").properties("name").usePrimaryKeyId().primaryKeys("name").ifNotExist().create()
+
schema.vertexLabel("Movie").properties("name").usePrimaryKeyId().primaryKeys(
+ "name").ifNotExist().create()
schema.edgeLabel("ActedIn").sourceLabel("Person").targetLabel("Movie").ifNotExist().create()
print(schema.getVertexLabels())
@@ -51,7 +52,6 @@ if __name__ == '__main__':
# update property
g.eliminateVertex("vertex_id", {"property_key": "property_value"})
-
print(g.getVertexById(p1.id).label)
# g.removeVertexById("12:Al Pacino")
g.close()
diff --git a/hugegraph-python/requirements.txt
b/hugegraph-python-client/requirements.txt
similarity index 100%
rename from hugegraph-python/requirements.txt
rename to hugegraph-python-client/requirements.txt
diff --git a/hugegraph-python/src/__init__.py
b/hugegraph-python-client/src/pyhugegraph/api/__init__.py
similarity index 100%
rename from hugegraph-python/src/__init__.py
rename to hugegraph-python-client/src/pyhugegraph/api/__init__.py
diff --git a/hugegraph-python/src/api/common.py
b/hugegraph-python-client/src/pyhugegraph/api/common.py
similarity index 94%
rename from hugegraph-python/src/api/common.py
rename to hugegraph-python-client/src/pyhugegraph/api/common.py
index 42b6c0a..8daefec 100644
--- a/hugegraph-python/src/api/common.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/common.py
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from src.utils.constants import Constants
+from pyhugegraph.utils.constants import Constants
class ParameterHolder:
diff --git a/hugegraph-python/src/api/graph.py
b/hugegraph-python-client/src/pyhugegraph/api/graph.py
similarity index 94%
rename from hugegraph-python/src/api/graph.py
rename to hugegraph-python-client/src/pyhugegraph/api/graph.py
index 2deaa89..0d0c278 100644
--- a/hugegraph-python/src/api/graph.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/graph.py
@@ -17,12 +17,12 @@
import json
-from src.utils.huge_requests import HugeSession
-from src.api.common import HugeParamsBase
-from src.structure.vertex_data import VertexData
-from src.structure.edge_data import EdgeData
-from src.utils.exceptions import NotFoundError, CreateError, RemoveError,
UpdateError
-from src.utils.util import create_exception, check_if_authorized,
check_if_success
+from pyhugegraph.utils.huge_requests import HugeSession
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.structure.vertex_data import VertexData
+from pyhugegraph.structure.edge_data import EdgeData
+from pyhugegraph.utils.exceptions import NotFoundError, CreateError,
RemoveError, UpdateError
+from pyhugegraph.utils.util import create_exception, check_if_authorized,
check_if_success
class GraphManager(HugeParamsBase):
diff --git a/hugegraph-python/src/api/graphs.py
b/hugegraph-python-client/src/pyhugegraph/api/graphs.py
similarity index 88%
rename from hugegraph-python/src/api/graphs.py
rename to hugegraph-python-client/src/pyhugegraph/api/graphs.py
index b22ec3a..b44aa6d 100644
--- a/hugegraph-python/src/api/graphs.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/graphs.py
@@ -19,12 +19,12 @@ import re
import requests
-from src.api.common import HugeParamsBase
+from pyhugegraph.api.common import HugeParamsBase
-from src.utils.constants import Constants
-from src.utils.exceptions import NotFoundError
-from src.utils.huge_requests import HugeSession
-from src.utils.util import check_if_success
+from pyhugegraph.utils.constants import Constants
+from pyhugegraph.utils.exceptions import NotFoundError
+from pyhugegraph.utils.huge_requests import HugeSession
+from pyhugegraph.utils.util import check_if_success
class GraphsManager(HugeParamsBase):
diff --git a/hugegraph-python/src/api/gremlin.py
b/hugegraph-python-client/src/pyhugegraph/api/gremlin.py
similarity index 83%
rename from hugegraph-python/src/api/gremlin.py
rename to hugegraph-python-client/src/pyhugegraph/api/gremlin.py
index 38a7c30..562a5bd 100644
--- a/hugegraph-python/src/api/gremlin.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/gremlin.py
@@ -19,11 +19,11 @@ import re
import requests
-from src.api.common import HugeParamsBase
-from src.structure.respon_data import ResponseData
-from src.utils.exceptions import NotFoundError
-from src.utils.huge_requests import HugeSession
-from src.utils.util import check_if_success
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.structure.respon_data import ResponseData
+from pyhugegraph.utils.exceptions import NotFoundError
+from pyhugegraph.utils.huge_requests import HugeSession
+from pyhugegraph.utils.util import check_if_success
class GremlinManager(HugeParamsBase):
diff --git a/hugegraph-python/src/api/schema.py
b/hugegraph-python-client/src/pyhugegraph/api/schema.py
similarity index 87%
rename from hugegraph-python/src/api/schema.py
rename to hugegraph-python-client/src/pyhugegraph/api/schema.py
index 9001028..c0f6c83 100644
--- a/hugegraph-python/src/api/schema.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/schema.py
@@ -18,18 +18,18 @@
import json
-from src.api.common import HugeParamsBase
-from src.api.schema_manage.edge_label import EdgeLabel
-from src.api.schema_manage.index_label import IndexLabel
-from src.api.schema_manage.property_key import PropertyKey
-from src.api.schema_manage.vertex_label import VertexLabel
-from src.structure.edge_label_data import EdgeLabelData
-from src.structure.index_label_data import IndexLabelData
-from src.structure.property_key_data import PropertyKeyData
-from src.structure.vertex_label_data import VertexLabelData
-from src.utils.exceptions import NotFoundError
-from src.utils.huge_requests import HugeSession
-from src.utils.util import check_if_success
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.api.schema_manage.edge_label import EdgeLabel
+from pyhugegraph.api.schema_manage.index_label import IndexLabel
+from pyhugegraph.api.schema_manage.property_key import PropertyKey
+from pyhugegraph.api.schema_manage.vertex_label import VertexLabel
+from pyhugegraph.structure.edge_label_data import EdgeLabelData
+from pyhugegraph.structure.index_label_data import IndexLabelData
+from pyhugegraph.structure.property_key_data import PropertyKeyData
+from pyhugegraph.structure.vertex_label_data import VertexLabelData
+from pyhugegraph.utils.exceptions import NotFoundError
+from pyhugegraph.utils.huge_requests import HugeSession
+from pyhugegraph.utils.util import check_if_success
class SchemaManager(HugeParamsBase):
diff --git a/hugegraph-python/src/api/__init__.py
b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/__init__.py
similarity index 100%
rename from hugegraph-python/src/api/__init__.py
rename to hugegraph-python-client/src/pyhugegraph/api/schema_manage/__init__.py
diff --git a/hugegraph-python/src/api/schema_manage/edge_label.py
b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/edge_label.py
similarity index 93%
rename from hugegraph-python/src/api/schema_manage/edge_label.py
rename to
hugegraph-python-client/src/pyhugegraph/api/schema_manage/edge_label.py
index 31d81d9..502d084 100644
--- a/hugegraph-python/src/api/schema_manage/edge_label.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/edge_label.py
@@ -17,10 +17,10 @@
import json
-from src.api.common import HugeParamsBase
-from src.utils.exceptions import CreateError, UpdateError, RemoveError
-from src.utils.huge_decorator import decorator_params, decorator_create
-from src.utils.util import check_if_success, check_if_authorized
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.utils.exceptions import CreateError, UpdateError, RemoveError
+from pyhugegraph.utils.huge_decorator import decorator_params, decorator_create
+from pyhugegraph.utils.util import check_if_success, check_if_authorized
class EdgeLabel(HugeParamsBase):
diff --git a/hugegraph-python/src/api/schema_manage/index_label.py
b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/index_label.py
similarity index 91%
rename from hugegraph-python/src/api/schema_manage/index_label.py
rename to
hugegraph-python-client/src/pyhugegraph/api/schema_manage/index_label.py
index cc93a91..e29c8c7 100644
--- a/hugegraph-python/src/api/schema_manage/index_label.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/index_label.py
@@ -19,10 +19,10 @@ import json
import requests
-from src.api.common import HugeParamsBase
-from src.utils.huge_decorator import decorator_params, decorator_create
-from src.utils.exceptions import CreateError, RemoveError
-from src.utils.util import check_if_authorized, check_if_success
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.utils.huge_decorator import decorator_params, decorator_create
+from pyhugegraph.utils.exceptions import CreateError, RemoveError
+from pyhugegraph.utils.util import check_if_authorized, check_if_success
class IndexLabel(HugeParamsBase):
diff --git a/hugegraph-python/src/api/schema_manage/property_key.py
b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/property_key.py
similarity index 93%
rename from hugegraph-python/src/api/schema_manage/property_key.py
rename to
hugegraph-python-client/src/pyhugegraph/api/schema_manage/property_key.py
index 6f9cce4..7a7f0e7 100644
--- a/hugegraph-python/src/api/schema_manage/property_key.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/property_key.py
@@ -19,10 +19,10 @@ import json
import requests
-from src.api.common import HugeParamsBase
-from src.utils.exceptions import CreateError, UpdateError, RemoveError
-from src.utils.huge_decorator import decorator_params, decorator_create
-from src.utils.util import check_if_success, check_if_authorized
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.utils.exceptions import CreateError, UpdateError, RemoveError
+from pyhugegraph.utils.huge_decorator import decorator_params, decorator_create
+from pyhugegraph.utils.util import check_if_success, check_if_authorized
class PropertyKey(HugeParamsBase):
diff --git a/hugegraph-python/src/api/schema_manage/vertex_label.py
b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/vertex_label.py
similarity index 93%
rename from hugegraph-python/src/api/schema_manage/vertex_label.py
rename to
hugegraph-python-client/src/pyhugegraph/api/schema_manage/vertex_label.py
index 462fe13..e031fd3 100644
--- a/hugegraph-python/src/api/schema_manage/vertex_label.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/schema_manage/vertex_label.py
@@ -19,10 +19,10 @@ import json
import requests
-from src.api.common import HugeParamsBase
-from src.utils.exceptions import CreateError, UpdateError, RemoveError
-from src.utils.huge_decorator import decorator_params, decorator_create
-from src.utils.util import check_if_success, check_if_authorized
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.utils.exceptions import CreateError, UpdateError, RemoveError
+from pyhugegraph.utils.huge_decorator import decorator_params, decorator_create
+from pyhugegraph.utils.util import check_if_success, check_if_authorized
class VertexLabel(HugeParamsBase):
diff --git a/hugegraph-python/src/client.py
b/hugegraph-python-client/src/pyhugegraph/client.py
similarity index 83%
rename from hugegraph-python/src/client.py
rename to hugegraph-python-client/src/pyhugegraph/client.py
index b039725..e12b73d 100644
--- a/hugegraph-python/src/client.py
+++ b/hugegraph-python-client/src/pyhugegraph/client.py
@@ -15,12 +15,12 @@
# specific language governing permissions and limitations
# under the License.
-from src.api.common import HugeParamsBase
-from src.api.graph import GraphManager
-from src.api.graphs import GraphsManager
-from src.api.gremlin import GremlinManager
-from src.api.schema import SchemaManager
-from src.structure.graph_instance import GraphInstance
+from pyhugegraph.api.common import HugeParamsBase
+from pyhugegraph.api.graph import GraphManager
+from pyhugegraph.api.graphs import GraphsManager
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.api.schema import SchemaManager
+from pyhugegraph.structure.graph_instance import GraphInstance
class PyHugeClient(HugeParamsBase):
diff --git a/hugegraph-python/src/api/schema_manage/__init__.py
b/hugegraph-python-client/src/pyhugegraph/structure/__init__.py
similarity index 100%
rename from hugegraph-python/src/api/schema_manage/__init__.py
rename to hugegraph-python-client/src/pyhugegraph/structure/__init__.py
diff --git a/hugegraph-python/src/structure/edge_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/edge_data.py
similarity index 100%
rename from hugegraph-python/src/structure/edge_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/edge_data.py
diff --git a/hugegraph-python/src/structure/edge_label_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/edge_label_data.py
similarity index 100%
rename from hugegraph-python/src/structure/edge_label_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/edge_label_data.py
diff --git a/hugegraph-python/src/structure/graph_instance.py
b/hugegraph-python-client/src/pyhugegraph/structure/graph_instance.py
similarity index 100%
rename from hugegraph-python/src/structure/graph_instance.py
rename to hugegraph-python-client/src/pyhugegraph/structure/graph_instance.py
diff --git a/hugegraph-python/src/structure/index_label_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/index_label_data.py
similarity index 100%
rename from hugegraph-python/src/structure/index_label_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/index_label_data.py
diff --git a/hugegraph-python/src/structure/property_key_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/property_key_data.py
similarity index 100%
rename from hugegraph-python/src/structure/property_key_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/property_key_data.py
diff --git a/hugegraph-python/src/structure/respon_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/respon_data.py
similarity index 100%
rename from hugegraph-python/src/structure/respon_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/respon_data.py
diff --git a/hugegraph-python/src/structure/vertex_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/vertex_data.py
similarity index 100%
rename from hugegraph-python/src/structure/vertex_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/vertex_data.py
diff --git a/hugegraph-python/src/structure/vertex_label_data.py
b/hugegraph-python-client/src/pyhugegraph/structure/vertex_label_data.py
similarity index 100%
rename from hugegraph-python/src/structure/vertex_label_data.py
rename to hugegraph-python-client/src/pyhugegraph/structure/vertex_label_data.py
diff --git a/hugegraph-python/src/structure/__init__.py
b/hugegraph-python-client/src/pyhugegraph/utils/__init__.py
similarity index 100%
rename from hugegraph-python/src/structure/__init__.py
rename to hugegraph-python-client/src/pyhugegraph/utils/__init__.py
diff --git a/hugegraph-python/src/utils/constants.py
b/hugegraph-python-client/src/pyhugegraph/utils/constants.py
similarity index 100%
rename from hugegraph-python/src/utils/constants.py
rename to hugegraph-python-client/src/pyhugegraph/utils/constants.py
diff --git a/hugegraph-python/src/utils/exceptions.py
b/hugegraph-python-client/src/pyhugegraph/utils/exceptions.py
similarity index 100%
rename from hugegraph-python/src/utils/exceptions.py
rename to hugegraph-python-client/src/pyhugegraph/utils/exceptions.py
diff --git a/hugegraph-python/src/utils/huge_decorator.py
b/hugegraph-python-client/src/pyhugegraph/utils/huge_decorator.py
similarity index 94%
rename from hugegraph-python/src/utils/huge_decorator.py
rename to hugegraph-python-client/src/pyhugegraph/utils/huge_decorator.py
index 9077bb8..3087778 100644
--- a/hugegraph-python/src/utils/huge_decorator.py
+++ b/hugegraph-python-client/src/pyhugegraph/utils/huge_decorator.py
@@ -17,7 +17,7 @@
from decorator import decorator
-from src.utils.exceptions import NotAuthorizedError
+from pyhugegraph.utils.exceptions import NotAuthorizedError
@decorator
diff --git a/hugegraph-python/src/utils/huge_requests.py
b/hugegraph-python-client/src/pyhugegraph/utils/huge_requests.py
similarity index 100%
rename from hugegraph-python/src/utils/huge_requests.py
rename to hugegraph-python-client/src/pyhugegraph/utils/huge_requests.py
diff --git a/hugegraph-python/src/utils/util.py
b/hugegraph-python-client/src/pyhugegraph/utils/util.py
similarity index 91%
rename from hugegraph-python/src/utils/util.py
rename to hugegraph-python-client/src/pyhugegraph/utils/util.py
index 9b9424b..c5368b0 100644
--- a/hugegraph-python/src/utils/util.py
+++ b/hugegraph-python-client/src/pyhugegraph/utils/util.py
@@ -17,7 +17,7 @@
import json
-from src.utils.exceptions import ServiceUnavailableException,
NotAuthorizedError, NotFoundError
+from pyhugegraph.utils.exceptions import ServiceUnavailableException,
NotAuthorizedError, NotFoundError
def create_exception(response_content):
diff --git a/hugegraph-python/src/utils/__init__.py
b/hugegraph-python/src/utils/__init__.py
deleted file mode 100644
index e0533d9..0000000
--- a/hugegraph-python/src/utils/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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
-#
-# http://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.