Skip to main content

AstraPy is a Pythonic SDK for DataStax Astra

Project description

AstraPy

Actions Status

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


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.dev1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

astrapy-0.5.0.dev1-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file astrapy-0.5.0.dev1.tar.gz.

File metadata

  • Download URL: astrapy-0.5.0.dev1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for astrapy-0.5.0.dev1.tar.gz
Algorithm Hash digest
SHA256 078954f5683405e0fb7cc178b26aebaa5e2d3d2b9af413231b6c75772a1535a4
MD5 90eaec4b02456c9a1b4bb27c9be09ad7
BLAKE2b-256 b0013520be23e580a559b8b042100a0e9b378e7a15b8f9d9a25b30bf43d4206c

See more details on using hashes here.

File details

Details for the file astrapy-0.5.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: astrapy-0.5.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for astrapy-0.5.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a1aac9e2137e765e867b9e973d32ed8a2fb3e605214c8e8010de1c9bca1dd76
MD5 dcac3770f600c8c102dcc416727bf1a2
BLAKE2b-256 013fcbd98744c6c93181c1ee0a67418dd7f5cc346e2a08524a5bde1fcba229f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page