Skip to content

Commit c976feb

Browse files
author
Satvik
committed
add pyproject.toml
1 parent b2fb5f0 commit c976feb

File tree

5 files changed

+79
-31
lines changed

5 files changed

+79
-31
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,5 @@ cython_debug/
161161
test/
162162

163163
*.sqlite
164-
examples/testDialect.py
164+
examples/testDialect.py
165+
this_was_old_setup.txt

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Satvik Nema
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+
SOFTWARE.

examples/testDialect.py

+30-30
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,36 @@
2727
# print(i)
2828

2929

30-
engine = create_engine("rest://stg.wsp-store-info.walmart.com?ishttps=0")
31-
connection = engine.connect()
32-
33-
endpoint = '/wsp-store-info/v1/layers/pipelinestores'
34-
35-
params = {
36-
'hlong': '-98.04269584580887',
37-
'llat': '30.660521215372583',
38-
'hlat': '34.51010643175928',
39-
'llong': '-117.87603469278673',
40-
'pipelinestores': 'APPROVED_LX,IDEA_LX,PROJECTS_LX'
41-
}
42-
43-
headers = {
44-
'Content-Type': 'application/json',
45-
'WM_CONSUMER.ID': '7aa13f7b-5e29-451b-bcfa-ba1b62471b89',
46-
'WM_SVC.ENV': 'stg',
47-
'WM_SVC.NAME': 'WSP-STORE-INFO',
48-
'sessionId': 'czBuMDJxbQ==',
49-
}
50-
51-
jsonpath = "$[*]"
52-
53-
virtual_table = get_virtual_table(endpoint=endpoint,
54-
params=params,
55-
headers=headers,
56-
jsonpath=jsonpath)
57-
print(virtual_table)
58-
for i in connection.execute(f'SELECT * FROM "{virtual_table}"'):
59-
print(i)
30+
# engine = create_engine("rest://stg.wsp-store-info.walmart.com?ishttps=0")
31+
# connection = engine.connect()
32+
#
33+
# endpoint = '/wsp-store-info/v1/layers/pipelinestores'
34+
#
35+
# params = {
36+
# 'hlong': '-98.04269584580887',
37+
# 'llat': '30.660521215372583',
38+
# 'hlat': '34.51010643175928',
39+
# 'llong': '-117.87603469278673',
40+
# 'pipelinestores': 'APPROVED_LX,IDEA_LX,PROJECTS_LX'
41+
# }
42+
#
43+
# headers = {
44+
# 'Content-Type': 'application/json',
45+
# 'WM_CONSUMER.ID': '7aa13f7b-5e29-451b-bcfa-ba1b62471b89',
46+
# 'WM_SVC.ENV': 'stg',
47+
# 'WM_SVC.NAME': 'WSP-STORE-INFO',
48+
# 'sessionId': 'czBuMDJxbQ==',
49+
# }
50+
#
51+
# jsonpath = "$[*]"
52+
#
53+
# virtual_table = get_virtual_table(endpoint=endpoint,
54+
# params=params,
55+
# headers=headers,
56+
# jsonpath=jsonpath)
57+
# print(virtual_table)
58+
# for i in connection.execute(f'SELECT * FROM "{virtual_table}"'):
59+
# print(i)
6060

6161

6262

pyproject.toml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "rest-db-api"
7+
version = "0.0.1"
8+
description = "A rest db api designed to be integrated with apache superset"
9+
authors = [
10+
{ name="Satvik Nema", email="[email protected]" },
11+
]
12+
readme = "README.md"
13+
requires-python = ">=3.7"
14+
license = {file = "LICENSE"}
15+
keywords = ["rest", "dbapi", "sqlalchemy", "adapter", "superset"]
16+
classifiers = [
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
]
21+
22+
[project.entry-points."shillelagh.adapter"]
23+
myrestadapter = "restDbApi.rest_api_adapter:RestAdapter"
24+
25+
[project.entry-points."sqlalchemy.dialects"]
26+
rest = "restDbApi.rest_api_dialect:RestApiDialect"

setup.py this_was_old_setup.txt

File renamed without changes.

0 commit comments

Comments
 (0)