Python library for Sql Data Api
Project description
sql-data-api-client-Python
SQL Data Api client for Python
Usage
pip install SqlDataApi
import SqlDataApi as sql
"""Sql Data Api"""
sql.SqlDataApi.set_api_url("https://localhost:44302")
sql.SqlDataApi.set_authentication("12121212-token-21121212")
# query data
result = sql.SqlDataApi("SQL-Shared").run_query_to_array("test1.Sample100",
filter="country = @country",
filter_params={"country": "UK"}
)
print(result)
# save data
status = sql.SqlDataApi("SQL-Shared").save_array("test1.Sample100", result)
print(status)
# execute stored procedure
sp_res = sql.SqlDataApi("northwind-db-connection").execute_sp_to_array("northwind.NorthwindEmployeesSummary", {'startDate': "2019-01-01", 'endDate': "2020-05-14"})
print(sp_res)
"""
result = sql.SqlDataApi("SQL-Shared").run_query_to_array("test1.Sample100",
filter="country = @country",
filter_params={"country": "UK"}
)
# load to frame
dataFrame = pd.DataFrame.from_records(result)
# manipulate dataFrame here ...
listOfItems = json.loads(dataFrame.to_json(orient='records'))
# save data
status = sql.SqlDataApi("SQL-Shared").save_array("test1.Sample100", listOfItems)
print(status)
"""
License
A permissive MIT License (c) FalconSoft Ltd.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SqlDataApi-0.1.12.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for SqlDataApi-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67d26e0b10b3e7f368d0fe099e34d7d787de582b871c6e15580f47fa81d4be6 |
|
MD5 | 561a65f902ba2cf6aabbee3c04d27916 |
|
BLAKE2b-256 | 3883d5d68fad9d96f0240095dcd464a0a753520e1b3136bab511fccc9b8ebb73 |