Official Skytable client library for Python
Project description
Skytable Python Client
Note: This library is currently in alpha
This is an alpha version of Skytable's official connector for Python 3.X.
Example
Install the dependency:
pip install skytable-py
Use in your code:
import asyncio
from skytable_py import Config, Query
c = Config("root", "mypassword123456789")
async def main():
db = None
try:
db = await c.connect()
# init space
assert (await db.run_simple_query(Query("create space apps"))).is_empty()
# init model
assert (await db.run_simple_query(Query("create model apps.auth(username: string, password: string)"))).is_empty()
# insert our test row
assert (await db.run_simple_query(Query("insert into apps.auth(?, ?)", "sayan", "mypassword"))).is_empty()
# fetch data
username, password = (await db.run_simple_query(Query("select * from apps.auth where username = ?", "sayan"))).row().columns
# output
print(f"username={username.string()}, password={password.string()}")
except Exception as e:
print(f"failed with error {e}")
finally:
if db:
await db.close()
if __name__ == "__main__":
asyncio.run(main())
License
This client library is distributed under the Apache-2.0 License.
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
skytable_py-0.1.1.tar.gz
(11.2 kB
view hashes)
Built Distribution
Close
Hashes for skytable_py-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9b3d8829770859a73a2a24c15e003ba26a741041ba6d003c7c7410a8cb67d64 |
|
MD5 | 43bd4f24b6a89ca14e2d0e9418929b63 |
|
BLAKE2b-256 | 219d2c7d63913935f390fb0d8da88f7a02e0ad30bc8394e70f0ecca44d5da388 |