Astrapy is a Python client library for interacting with the Data API on DataStax Astra DB. It provides a straightforward interface for working with both document collections (JSON) and tables. Currently at version 2.2.1, the library sees active development with frequent minor releases introducing new features and improvements.
pip install astrapyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to DataStax Astra DB, get a collection, insert a document, and retrieve it. It relies on environment variables for secure credential management.
Consult the migration guide and new API Reference for 2.x. Key changes include how `Database` and `Collection` objects are initialized and used, as well as new data type handling.
Upgrade your Python environment to 3.9 or newer before installing or upgrading to astrapy 2.2.0+.
Ensure you are on the latest stable version of `astrapy` to benefit from fixes related to `$vector: null` handling. Always test vector operations carefully, especially when explicitly setting vectors to null.
Replace `cursor.alive` with `cursor.state != CursorState.CLOSED` in your code.
No dependency data recorded yet.