graphxr-database-proxy 1.0.2__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/LICENSE +20 -20
  2. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/MANIFEST.in +27 -27
  3. {graphxr_database_proxy-1.0.2/src/graphxr_database_proxy.egg-info → graphxr_database_proxy-1.0.3}/PKG-INFO +209 -208
  4. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/README.md +163 -163
  5. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/README.zh.md +150 -150
  6. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/API_Reference.md +492 -492
  7. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/DEV_GUIDE.md +79 -74
  8. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/DEV_GUIDE.zh.md +82 -75
  9. graphxr_database_proxy-1.0.3/doc/DOCKER_PUBLISHING.md +18 -0
  10. graphxr_database_proxy-1.0.3/doc/DOCKER_PUBLISHING.zh.md +22 -0
  11. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/FRONTEND_INTEGRATION.zh.md +182 -182
  12. graphxr_database_proxy-1.0.3/doc/PYPI_PUBLISHING.md +302 -0
  13. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/PYPI_PUBLISHING.zh.md +261 -360
  14. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/USAGE.md +247 -193
  15. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/doc/USAGE.zh.md +203 -203
  16. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/auth_methods_example.py +295 -295
  17. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/env_variables_example.py +301 -301
  18. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/future_database_support.py +221 -221
  19. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/get_project_apis_example.py +238 -238
  20. graphxr_database_proxy-1.0.3/examples/google_adc.py +166 -0
  21. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/python_api_example.py +293 -293
  22. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/examples/quick_start.py +126 -126
  23. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/pyproject.toml +87 -86
  24. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/requirements.txt +9 -9
  25. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/setup.cfg +4 -4
  26. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/__init__.py +15 -15
  27. graphxr_database_proxy-1.0.3/src/graphxr_database_proxy/api/auth.py +50 -0
  28. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/api/database.py +273 -265
  29. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/api/google.py +468 -460
  30. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/api/projects.py +104 -98
  31. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/common/util.py +47 -47
  32. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/drivers/base.py +55 -55
  33. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/drivers/factory.py +35 -35
  34. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/drivers/spanner.py +870 -870
  35. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/launcher.py +63 -63
  36. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/main.py +122 -122
  37. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/models/google.py +49 -49
  38. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/models/project.py +486 -486
  39. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/proxy.py +536 -536
  40. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/proxyForDev.py +289 -289
  41. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/services/project_service.py +149 -149
  42. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3/src/graphxr_database_proxy.egg-info}/PKG-INFO +209 -208
  43. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy.egg-info/SOURCES.txt +6 -10
  44. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy.egg-info/requires.txt +1 -0
  45. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/favicon.ico +0 -0
  46. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/index.html +0 -1
  47. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/main.7391ee9773c403483393.css +0 -175
  48. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/main.7391ee9773c403483393.css.map +0 -1
  49. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/main.e566ea8f459c5b8df2b4.js +0 -2
  50. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/main.e566ea8f459c5b8df2b4.js.map +0 -1
  51. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/vendors.f303e096f3b6701f9410.js +0 -3
  52. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/vendors.f303e096f3b6701f9410.js.LICENSE.txt +0 -95
  53. graphxr_database_proxy-1.0.2/src/graphxr_database_proxy/static/vendors.f303e096f3b6701f9410.js.map +0 -1
  54. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/api/__init__.py +0 -0
  55. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/drivers/__init__.py +0 -0
  56. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/models/__init__.py +0 -0
  57. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy/services/__init__.py +0 -0
  58. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy.egg-info/dependency_links.txt +0 -0
  59. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy.egg-info/entry_points.txt +0 -0
  60. {graphxr_database_proxy-1.0.2 → graphxr_database_proxy-1.0.3}/src/graphxr_database_proxy.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Kineviz
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kineviz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
@@ -1,28 +1,28 @@
1
- # 包含静态文件
2
- recursive-include src/graphxr_database_proxy/static *
3
-
4
- # 包含文档文件
5
- include README.md
6
- include LICENSE
7
- include *.md
8
-
9
- # 包含配置文件
10
- include pyproject.toml
11
- include requirements.txt
12
-
13
- # 包含示例和文档
14
- recursive-include examples *.py
15
- recursive-include doc *.md
16
-
17
- # 排除不需要的文件
18
- global-exclude *.pyc
19
- global-exclude *.pyo
20
- global-exclude *~
21
- global-exclude .git*
22
- global-exclude .env*
23
- prune .venv
24
- prune __pycache__
25
- prune .pytest_cache
26
- prune node_modules
27
- prune frontend/node_modules
1
+ # 包含静态文件
2
+ recursive-include src/graphxr_database_proxy/static *
3
+
4
+ # 包含文档文件
5
+ include README.md
6
+ include LICENSE
7
+ include *.md
8
+
9
+ # 包含配置文件
10
+ include pyproject.toml
11
+ include requirements.txt
12
+
13
+ # 包含示例和文档
14
+ recursive-include examples *.py
15
+ recursive-include doc *.md
16
+
17
+ # 排除不需要的文件
18
+ global-exclude *.pyc
19
+ global-exclude *.pyo
20
+ global-exclude *~
21
+ global-exclude .git*
22
+ global-exclude .env*
23
+ prune .venv
24
+ prune __pycache__
25
+ prune .pytest_cache
26
+ prune node_modules
27
+ prune frontend/node_modules
28
28
  prune frontend/.webpack-cache
@@ -1,208 +1,209 @@
1
- Metadata-Version: 2.4
2
- Name: graphxr-database-proxy
3
- Version: 1.0.2
4
- Summary: GraphXR Database Proxy - Secure middleware for connecting GraphXR to databases
5
- Author-email: Sean Li <sean@kineviz.com>, Kineviz <support@kineviz.com>
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/Kineviz/graphxr-database-proxy
8
- Project-URL: Documentation, https://docs.kineviz.com/graphxr-database-proxy
9
- Project-URL: Repository, https://github.com/Kineviz/graphxr-database-proxy
10
- Project-URL: Bug Tracker, https://github.com/Kineviz/graphxr-database-proxy/issues
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: fastapi>=0.104.0
22
- Requires-Dist: uvicorn[standard]>=0.24.0
23
- Requires-Dist: pydantic>=2.0.0
24
- Requires-Dist: python-multipart>=0.0.6
25
- Requires-Dist: google-cloud-spanner>=3.40.0
26
- Requires-Dist: google-auth-oauthlib>=1.0.0
27
- Requires-Dist: google-auth>=2.0.0
28
- Requires-Dist: aiofiles>=23.0.0
29
- Requires-Dist: pyyaml>=6.0
30
- Provides-Extra: ui
31
- Requires-Dist: aiofiles>=23.0.0; extra == "ui"
32
- Provides-Extra: dev
33
- Requires-Dist: pytest>=7.0.0; extra == "dev"
34
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
35
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
36
- Requires-Dist: black>=23.0.0; extra == "dev"
37
- Requires-Dist: isort>=5.12.0; extra == "dev"
38
- Requires-Dist: flake8>=6.0.0; extra == "dev"
39
- Requires-Dist: mypy>=1.5.0; extra == "dev"
40
- Requires-Dist: pre-commit>=3.0.0; extra == "dev"
41
- Provides-Extra: all
42
- Requires-Dist: graphxr-database-proxy[dev,ui]; extra == "all"
43
- Dynamic: license-file
44
-
45
- # GraphXR Database Proxy
46
-
47
- [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
48
- [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
49
- [![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com)
50
-
51
- > **Language**: [English](https://github.com/Kineviz/graphxr-database-proxy/blob/main/readme.md) | [中文](https://github.com/Kineviz/graphxr-database-proxy/blob/main/readme.zh.md)
52
-
53
- A secure middleware that connects [GraphXR](https://www.kineviz.com/graphxr) to various backend databases with zero trust architecture.
54
-
55
- ## Features
56
-
57
- - **Zero Trust Security**: Strict authentication and authorization at the proxy layer
58
- - **Direct Browser Connectivity**: REST/GraphQL APIs for efficient data access
59
- - **Multi-Database Support**: Spanner Graph, Neo4j, and more
60
- - **Open Source**: Fully auditable and customizable
61
- - **Pure Python**: Easy to deploy and maintain
62
-
63
- ## ⚡ Quick Start for Spanner Graph
64
-
65
- 1. Run the following commands to start graphxr-database-proxy (requires [uv](https://docs.astral.sh/uv/), [node.js](https://nodejs.org/en/download/))
66
-
67
- ```
68
- git clone https://github.com/Kineviz/graphxr-database-proxy.git
69
- cd graphxr-database-proxy
70
- uv venv
71
- source .venv/bin/activate # or .venv/bin/activate on Windows
72
- uv pip install -e ".[ui]"
73
- uv pip install -r requirements.txt
74
- cd frontend && npm install && npm run build && cd -
75
- graphxr-proxy --ui
76
- ```
77
-
78
- 2. Visit http://localhost:9080/
79
- 3. Click "Create New Project"
80
- 4. Project Name: "Test"
81
- 5. Database Type: "Google Cloud Spanner"
82
- 6. Authentication Type: "Service Account"
83
- 7. Upload the credential file you exported from GCP Console or gcloud CLI. [Export Instructions](https://github.com/Kineviz/try-graphxr-spannergraph#)
84
- 8. Select "Instance ID" e.g. "demo"
85
- 9. Select "Database ID" e.g. "cymbal"
86
- 10. Select "Property Graph" e.g. "ECommerceGraph"
87
- 11. Click "Create"
88
- 12. For the new project, under Actions, copy the API URL. e.g. "http://localhost:9080/api/spanner/Test"
89
- 13. Go back to GraphXR's Create Project wizard and paste the API URL into GraphXR for a project with a "Database Proxy" database type.
90
-
91
- ## Other ways to start graphxr-database-proxy
92
-
93
- ### Install
94
-
95
- ```bash
96
- # Install from PyPI
97
- pip install graphxr-database-proxy[ui]
98
-
99
- # Or from source
100
- git clone https://github.com/Kineviz/graphxr-database-proxy.git
101
- cd graphxr-database-proxy
102
- uv venv
103
- source .venv/bin/activate # or .venv/bin/activate on Windows
104
- uv pip install -e ".[ui]"
105
- uv pip install -r requirements.txt
106
- cd frontend && npm install && npm run build && cd -
107
- pip install -e .[ui]
108
- ```
109
-
110
- ### Configure & Run
111
-
112
- **Option 1: Web UI (Recommended)**
113
- ```bash
114
- graphxr-proxy --ui
115
- ```
116
- > Open http://localhost:9080/admin for configuration
117
-
118
- **Option 2: Python Code with Service Account JSON**
119
- ```python
120
- from graphxr_database_proxy import DatabaseProxy
121
-
122
- proxy = DatabaseProxy()
123
-
124
- service_account_json = {
125
- "type": "service_account",
126
- "project_id": "your-gcp-project-id",
127
- "private_key": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n",
128
- "client_email": "your-service-account@your-gcp-project-id.iam.gserviceaccount.com",
129
- ...
130
- }
131
-
132
- project_id = proxy.add_project(
133
- project_name="project_name",
134
- database_type="spanner",
135
- project_id="gcp-project-id",
136
- instance_id="spanner-instance-id",
137
- database_id="spanner-database-id",
138
- credentials=service_account_json,
139
- graph_name="graph_name" # Optional
140
- )
141
-
142
- proxy.start(
143
- host="0.0.0.0",
144
- port=9080,
145
- show_apis=True
146
- )
147
- ```
148
-
149
- **Option 3: Python Code with Google Cloud ADC**
150
- > Your should have set up Google Application Default Credentials (ADC) on the machine running the proxy. See [Google Cloud ADC Documentation](https://cloud.google.com/docs/authentication/production#automatically).
151
-
152
- ```python
153
- from graphxr_database_proxy import DatabaseProxy
154
- proxy = DatabaseProxy()
155
-
156
- google_adc_credentials={
157
- "type": "google_ADC"
158
- },
159
-
160
- project_id = proxy.add_project(
161
- project_name="project_name",
162
- database_type="spanner",
163
- project_id="gcp-project-id",
164
- instance_id="spanner-instance-id",
165
- database_id="spanner-database-id",
166
- credentials=google_adc_credentials,
167
- graph_name="graph_name" # Optional
168
- )
169
-
170
- proxy.start(
171
- host="0.0.0.0",
172
- port=9080,
173
- show_apis=True
174
- )
175
- ```
176
-
177
- ## 🐳 Docker
178
-
179
- ```bash
180
- docker run -d -p 9080:9080 \
181
- --name graphxr-database-proxy \
182
- -v ${HOME}/graphxr-database-proxy/config:/app/config \
183
- kineviz/graphxr-database-proxy:latest
184
- ```
185
- > You can visit http://localhost:9080/admin for configuration after starting the container.
186
-
187
-
188
-
189
- ## 🤝 Contributing
190
-
191
- 1. Fork the repository
192
- 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
193
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
194
- 4. Push to the branch (`git push origin feature/amazing-feature`)
195
- 5. Open a Pull Request
196
-
197
- ## 📄 License
198
-
199
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
200
-
201
- ## 🆘 Support
202
-
203
- - 🐛 [Issue Tracker](https://github.com/Kineviz/graphxr-database-proxy/issues)
204
- - 📧 Email: support@kineviz.com
205
-
206
- ---
207
-
208
- **Built with ❤️ by [Kineviz](https://www.kineviz.com)**
1
+ Metadata-Version: 2.4
2
+ Name: graphxr-database-proxy
3
+ Version: 1.0.3
4
+ Summary: GraphXR Database Proxy - Secure middleware for connecting GraphXR to databases
5
+ Author-email: Sean Li <sean@kineviz.com>, Kineviz <support@kineviz.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Kineviz/graphxr-database-proxy
8
+ Project-URL: Documentation, https://docs.kineviz.com/graphxr-database-proxy
9
+ Project-URL: Repository, https://github.com/Kineviz/graphxr-database-proxy
10
+ Project-URL: Bug Tracker, https://github.com/Kineviz/graphxr-database-proxy/issues
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: fastapi>=0.104.0
22
+ Requires-Dist: uvicorn[standard]>=0.24.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: python-multipart>=0.0.6
25
+ Requires-Dist: google-cloud-spanner>=3.40.0
26
+ Requires-Dist: google-cloud-resource-manager>=1.10.0
27
+ Requires-Dist: google-auth-oauthlib>=1.0.0
28
+ Requires-Dist: google-auth>=2.0.0
29
+ Requires-Dist: aiofiles>=23.0.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Provides-Extra: ui
32
+ Requires-Dist: aiofiles>=23.0.0; extra == "ui"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
35
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
36
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
+ Requires-Dist: black>=23.0.0; extra == "dev"
38
+ Requires-Dist: isort>=5.12.0; extra == "dev"
39
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
41
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
42
+ Provides-Extra: all
43
+ Requires-Dist: graphxr-database-proxy[dev,ui]; extra == "all"
44
+ Dynamic: license-file
45
+
46
+ # GraphXR Database Proxy
47
+
48
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
49
+ [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
50
+ [![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com)
51
+
52
+ > **Language**: [English](https://github.com/Kineviz/graphxr-database-proxy/blob/main/readme.md) | [中文](https://github.com/Kineviz/graphxr-database-proxy/blob/main/readme.zh.md)
53
+
54
+ A secure middleware that connects [GraphXR](https://www.kineviz.com/graphxr) to various backend databases with zero trust architecture.
55
+
56
+ ## Features
57
+
58
+ - **Zero Trust Security**: Strict authentication and authorization at the proxy layer
59
+ - **Direct Browser Connectivity**: REST/GraphQL APIs for efficient data access
60
+ - **Multi-Database Support**: Spanner Graph, Neo4j, and more
61
+ - **Open Source**: Fully auditable and customizable
62
+ - **Pure Python**: Easy to deploy and maintain
63
+
64
+ ## ⚡ Quick Start for Spanner Graph
65
+
66
+ 1. Run the following commands to start graphxr-database-proxy (requires [uv](https://docs.astral.sh/uv/), [node.js](https://nodejs.org/en/download/))
67
+
68
+ ```
69
+ git clone https://github.com/Kineviz/graphxr-database-proxy.git
70
+ cd graphxr-database-proxy
71
+ uv venv
72
+ source .venv/bin/activate # or .venv/bin/activate on Windows
73
+ uv pip install -e ".[ui]"
74
+ uv pip install -r requirements.txt
75
+ cd frontend && npm install && npm run build && cd -
76
+ graphxr-proxy --ui
77
+ ```
78
+
79
+ 2. Visit http://localhost:9080/
80
+ 3. Click "Create New Project"
81
+ 4. Project Name: "Test"
82
+ 5. Database Type: "Google Cloud Spanner"
83
+ 6. Authentication Type: "Service Account"
84
+ 7. Upload the credential file you exported from GCP Console or gcloud CLI. [Export Instructions](https://github.com/Kineviz/try-graphxr-spannergraph#)
85
+ 8. Select "Instance ID" e.g. "demo"
86
+ 9. Select "Database ID" e.g. "cymbal"
87
+ 10. Select "Property Graph" e.g. "ECommerceGraph"
88
+ 11. Click "Create"
89
+ 12. For the new project, under Actions, copy the API URL. e.g. "http://localhost:9080/api/spanner/Test"
90
+ 13. Go back to GraphXR's Create Project wizard and paste the API URL into GraphXR for a project with a "Database Proxy" database type.
91
+
92
+ ## Other ways to start graphxr-database-proxy
93
+
94
+ ### Install
95
+
96
+ ```bash
97
+ # Install from PyPI
98
+ pip install graphxr-database-proxy[ui]
99
+
100
+ # Or from source
101
+ git clone https://github.com/Kineviz/graphxr-database-proxy.git
102
+ cd graphxr-database-proxy
103
+ uv venv
104
+ source .venv/bin/activate # or .venv/bin/activate on Windows
105
+ uv pip install -e ".[ui]"
106
+ uv pip install -r requirements.txt
107
+ cd frontend && npm install && npm run build && cd -
108
+ pip install -e .[ui]
109
+ ```
110
+
111
+ ### Configure & Run
112
+
113
+ **Option 1: Web UI (Recommended)**
114
+ ```bash
115
+ graphxr-proxy --ui
116
+ ```
117
+ > Open http://localhost:9080/admin for configuration
118
+
119
+ **Option 2: Python Code with Service Account JSON**
120
+ ```python
121
+ from graphxr_database_proxy import DatabaseProxy
122
+
123
+ proxy = DatabaseProxy()
124
+
125
+ service_account_json = {
126
+ "type": "service_account",
127
+ "project_id": "your-gcp-project-id",
128
+ "private_key": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n",
129
+ "client_email": "your-service-account@your-gcp-project-id.iam.gserviceaccount.com",
130
+ ...
131
+ }
132
+
133
+ project_id = proxy.add_project(
134
+ project_name="project_name",
135
+ database_type="spanner",
136
+ project_id="gcp-project-id",
137
+ instance_id="spanner-instance-id",
138
+ database_id="spanner-database-id",
139
+ credentials=service_account_json,
140
+ graph_name="graph_name" # Optional
141
+ )
142
+
143
+ proxy.start(
144
+ host="0.0.0.0",
145
+ port=9080,
146
+ show_apis=True
147
+ )
148
+ ```
149
+
150
+ **Option 3: Python Code with Google Cloud ADC**
151
+ > Your should have set up Google Application Default Credentials (ADC) on the machine running the proxy. See [Google Cloud ADC Documentation](https://cloud.google.com/docs/authentication/production#automatically).
152
+
153
+ ```python
154
+ from graphxr_database_proxy import DatabaseProxy
155
+ proxy = DatabaseProxy()
156
+
157
+ google_adc_credentials={
158
+ "type": "google_ADC"
159
+ },
160
+
161
+ project_id = proxy.add_project(
162
+ project_name="project_name",
163
+ database_type="spanner",
164
+ project_id="gcp-project-id",
165
+ instance_id="spanner-instance-id",
166
+ database_id="spanner-database-id",
167
+ credentials=google_adc_credentials,
168
+ graph_name="graph_name" # Optional
169
+ )
170
+
171
+ proxy.start(
172
+ host="0.0.0.0",
173
+ port=9080,
174
+ show_apis=True
175
+ )
176
+ ```
177
+
178
+ ## 🐳 Docker
179
+
180
+ ```bash
181
+ docker run -d -p 9080:9080 \
182
+ --name graphxr-database-proxy \
183
+ -v ${HOME}/graphxr-database-proxy/config:/app/config \
184
+ kineviz/graphxr-database-proxy:latest
185
+ ```
186
+ > You can visit http://localhost:9080/admin for configuration after starting the container.
187
+
188
+
189
+
190
+ ## 🤝 Contributing
191
+
192
+ 1. Fork the repository
193
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
194
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
195
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
196
+ 5. Open a Pull Request
197
+
198
+ ## 📄 License
199
+
200
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
201
+
202
+ ## 🆘 Support
203
+
204
+ - 🐛 [Issue Tracker](https://github.com/Kineviz/graphxr-database-proxy/issues)
205
+ - 📧 Email: support@kineviz.com
206
+
207
+ ---
208
+
209
+ **Built with ❤️ by [Kineviz](https://www.kineviz.com)**