This release is a pre-release and may not be stable for production use.
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
Release files for astrapy 0.5.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| astrapy-0.5.0.dev1.tar.gz | 12.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| astrapy-0.5.0.dev1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.8 kB
Release files / astrapy-0.5.0.dev1.tar.gz
| Download URL | astrapy-0.5.0.dev1.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
078954f5683405e0fb7cc178b26aebaa5e2d3d2b9af413231b6c75772a1535a4
|
|
BLAKE2b-256 checksum How to use checksums |
b0013520be23e580a559b8b042100a0e9b378e7a15b8f9d9a25b30bf43d4206c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / astrapy-0.5.0.dev1-py3-none-any.whl
| Download URL | astrapy-0.5.0.dev1-py3-none-any.whl |
|---|---|
| Size | 39.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a1aac9e2137e765e867b9e973d32ed8a2fb3e605214c8e8010de1c9bca1dd76
|
|
BLAKE2b-256 checksum How to use checksums |
013fcbd98744c6c93181c1ee0a67418dd7f5cc346e2a08524a5bde1fcba229f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|