AstraPy is a Pythonic SDK for DataStax Astra
Project description
AstraPy
AstraPy is a Pythonic SDK for DataStax Astra and Stargate
Resources
Getting Started
Install AstraPy
pip install astrapy
Setup your Astra client
from astrapy.base import AstraClient
astra_client = AstraClient(
astra_database_id=ASTRA_DB_ID,
astra_database_region=ASTRA_DB_REGION,
astra_application_token=ASTRA_DB_APPLICATION_TOKEN,
)
vector_client = AstraVectorClient(astra_client=astra_client)
test_namespace = vector_client.namespace(ASTRA_DB_KEYSPACE)
test_collection = vector_client.namespace(ASTRA_DB_KEYSPACE).collection(TEST_COLLECTION_NAME)
####Getting started Check out the notebook which has examples for finding and inserting information into the database, including vector commands.
Take a look at the vector tests and the collection tests for specific endpoint examples.
Using the Ops Client
You can use the Ops client to work the with Astra DevOps API. Check the devops tests
# astra_client created above
# create a keyspace using the Ops API
astra_client.ops.create_keyspace(database=ASTRA_DB_ID, keyspace=KEYSPACE_NAME)
Using the REST Client
You can use the REST client to work with the Astra REST API. API Reference
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
astrapy-0.5.0.dev2.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for astrapy-0.5.0.dev2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8500b1bb8bfb8743cc895d09100e437e7e7cf70100ecae9d4d1cdf711c0aa4d7 |
|
MD5 | 42a3cdd33ca400e329b54566e224abb7 |
|
BLAKE2b-256 | 7742da7d01922a49c4bf3debd053f3a14feb2cd5d4c0c89a5b4b0bceb5d4e8ac |