id stringlengths 7 77 | text stringlengths 0 3.4k | metadata dict |
|---|---|---|
astrapy | {
"kind": "module",
"name": "astrapy",
"path": "astrapy",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": null,
"Any": null,
"cast": null,
"httpx": null,
"API_RESPONSE":... | |
astrapy.get_version | {
"kind": "function",
"name": "get_version",
"path": "astrapy.get_version",
"parameters": null,
"returns": [
{
"name": null,
"type": "str",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null... | |
astrapy.api_options | {
"kind": "module",
"name": "api_options",
"path": "astrapy.api_options",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": null,
"Any": null,
"cast": null,
"httpx": null,
... | |
astrapy.api_options.AO | {
"kind": "attribute",
"name": "AO",
"path": "astrapy.api_options.AO",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "AO = TypeVar('AO', bound='BaseAPIOptions')",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"re... | |
astrapy.api_options.BaseAPIOptions | A description of the options about how to interact with the Data API. | {
"kind": "class",
"name": "BaseAPIOptions",
"path": "astrapy.api_options.BaseAPIOptions",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": null,
"default": "None",
"value": null
}
],
"returns": null,
"gathered_types": null,
"value": nul... |
astrapy.api_options.BaseAPIOptions.max_time_ms | {
"kind": "attribute",
"name": "max_time_ms",
"path": "astrapy.api_options.BaseAPIOptions.max_time_ms",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "max_time_ms: int | None = None",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"... | |
astrapy.api_options.BaseAPIOptions.with_default | Return a new instance created by completing this instance with a default
API options object.
In other words, `optA.with_default(optB)` will take fields from optA
when possible and draw defaults from optB when optA has them set to anything
evaluating to False. (This relies on the __bool__ definition of the values,
such... | {
"kind": "function",
"name": "with_default",
"path": "astrapy.api_options.BaseAPIOptions.with_default",
"parameters": [
{
"name": "default",
"type": "BaseAPIOptions | None",
"description": "an API options instance to draw defaults from.",
"default": null,
"value": null
}
... |
astrapy.api_options.BaseAPIOptions.with_override | Return a new instance created by overriding the members of this instance
with those taken from a supplied "override" API options object.
In other words, `optA.with_default(optB)` will take fields from optB
when possible and fall back to optA when optB has them set to anything
evaluating to False. (This relies on the _... | {
"kind": "function",
"name": "with_override",
"path": "astrapy.api_options.BaseAPIOptions.with_override",
"parameters": [
{
"name": "override",
"type": "BaseAPIOptions | None",
"description": "an API options instance to preferentially draw fields from.",
"default": null,
"valu... |
astrapy.api_options.CollectionAPIOptions | A description of the options about how to interact with the Data API
regarding a collection.
Developers should not instantiate this class directly. | {
"kind": "class",
"name": "CollectionAPIOptions",
"path": "astrapy.api_options.CollectionAPIOptions",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "embedding_api_key",
"typ... |
astrapy.api_options.CollectionAPIOptions.embedding_api_key | {
"kind": "attribute",
"name": "embedding_api_key",
"path": "astrapy.api_options.CollectionAPIOptions.embedding_api_key",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.authentication.EmbeddingAPIKeyHeaderProvider",
"astrapy.authentication.EmbeddingHeadersProvider"
],
"value":... | |
astrapy.results | {
"kind": "module",
"name": "results",
"path": "astrapy.results",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": null,
"Any": "typing.Any",
"cast": null,
"httpx": null,
... | |
astrapy.results.OperationResult | Class that represents the generic result of a single mutation operation. | {
"kind": "class",
"name": "OperationResult",
"path": "astrapy.results.OperationResult",
"parameters": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": [
"ABC"
... |
astrapy.results.OperationResult.raw_results | {
"kind": "attribute",
"name": "raw_results",
"path": "astrapy.results.OperationResult.raw_results",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "raw_results: list[dict[str, Any]]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"... | |
astrapy.results.OperationResult.to_bulk_write_result | {
"kind": "function",
"name": "to_bulk_write_result",
"path": "astrapy.results.OperationResult.to_bulk_write_result",
"parameters": [
{
"name": "index_in_bulk_write",
"type": "int",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name"... | |
astrapy.results.DeleteResult | Class that represents the result of delete operations. | {
"kind": "class",
"name": "DeleteResult",
"path": "astrapy.results.DeleteResult",
"parameters": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": null,
"default": null,
"value": null
},
{
"name": "deleted_count",
"type": "int",
... |
astrapy.results.DeleteResult.deleted_count | {
"kind": "attribute",
"name": "deleted_count",
"path": "astrapy.results.DeleteResult.deleted_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "deleted_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null... | |
astrapy.results.DeleteResult.to_bulk_write_result | {
"kind": "function",
"name": "to_bulk_write_result",
"path": "astrapy.results.DeleteResult.to_bulk_write_result",
"parameters": [
{
"name": "index_in_bulk_write",
"type": "int",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name": n... | |
astrapy.results.InsertOneResult | Class that represents the result of insert_one operations. | {
"kind": "class",
"name": "InsertOneResult",
"path": "astrapy.results.InsertOneResult",
"parameters": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": null,
"default": null,
"value": null
},
{
"name": "inserted_id",
"type": "Any",
... |
astrapy.results.InsertOneResult.inserted_id | {
"kind": "attribute",
"name": "inserted_id",
"path": "astrapy.results.InsertOneResult.inserted_id",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "inserted_id: Any",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
... | |
astrapy.results.InsertOneResult.to_bulk_write_result | {
"kind": "function",
"name": "to_bulk_write_result",
"path": "astrapy.results.InsertOneResult.to_bulk_write_result",
"parameters": [
{
"name": "index_in_bulk_write",
"type": "int",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name"... | |
astrapy.results.InsertManyResult | Class that represents the result of insert_many operations. | {
"kind": "class",
"name": "InsertManyResult",
"path": "astrapy.results.InsertManyResult",
"parameters": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": null,
"default": null,
"value": null
},
{
"name": "inserted_ids",
"type": "list... |
astrapy.results.InsertManyResult.inserted_ids | {
"kind": "attribute",
"name": "inserted_ids",
"path": "astrapy.results.InsertManyResult.inserted_ids",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "inserted_ids: list[Any]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example... | |
astrapy.results.InsertManyResult.to_bulk_write_result | {
"kind": "function",
"name": "to_bulk_write_result",
"path": "astrapy.results.InsertManyResult.to_bulk_write_result",
"parameters": [
{
"name": "index_in_bulk_write",
"type": "int",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name... | |
astrapy.results.UpdateResult | Class that represents the result of any update operation. | {
"kind": "class",
"name": "UpdateResult",
"path": "astrapy.results.UpdateResult",
"parameters": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": null,
"default": null,
"value": null
},
{
"name": "update_info",
"type": "dict[str, Any... |
astrapy.results.UpdateResult.update_info | {
"kind": "attribute",
"name": "update_info",
"path": "astrapy.results.UpdateResult.update_info",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "update_info: dict[str, Any]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example":... | |
astrapy.results.UpdateResult.to_bulk_write_result | {
"kind": "function",
"name": "to_bulk_write_result",
"path": "astrapy.results.UpdateResult.to_bulk_write_result",
"parameters": [
{
"name": "index_in_bulk_write",
"type": "int",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name": n... | |
astrapy.results.BulkWriteResult | Class that represents the result of a bulk write operations.
Indices in the maps below refer to the position of each write operation
in the list of operations passed to the bulk_write command.
The numeric counts refer to the whole of the bulk write. | {
"kind": "class",
"name": "BulkWriteResult",
"path": "astrapy.results.BulkWriteResult",
"parameters": [
{
"name": "bulk_api_results",
"type": "dict[int, list[dict[str, Any]]]",
"description": null,
"default": null,
"value": null
},
{
"name": "deleted_count",
... |
astrapy.results.BulkWriteResult.bulk_api_results | {
"kind": "attribute",
"name": "bulk_api_results",
"path": "astrapy.results.BulkWriteResult.bulk_api_results",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "bulk_api_results: dict[int, list[dict[str, Any]]]",
"yields": null,
"imports": null,
"properties": null,
"bases": nu... | |
astrapy.results.BulkWriteResult.deleted_count | {
"kind": "attribute",
"name": "deleted_count",
"path": "astrapy.results.BulkWriteResult.deleted_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "deleted_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": n... | |
astrapy.results.BulkWriteResult.inserted_count | {
"kind": "attribute",
"name": "inserted_count",
"path": "astrapy.results.BulkWriteResult.inserted_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "inserted_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example"... | |
astrapy.results.BulkWriteResult.matched_count | {
"kind": "attribute",
"name": "matched_count",
"path": "astrapy.results.BulkWriteResult.matched_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "matched_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": n... | |
astrapy.results.BulkWriteResult.modified_count | {
"kind": "attribute",
"name": "modified_count",
"path": "astrapy.results.BulkWriteResult.modified_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "modified_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example"... | |
astrapy.results.BulkWriteResult.upserted_count | {
"kind": "attribute",
"name": "upserted_count",
"path": "astrapy.results.BulkWriteResult.upserted_count",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "upserted_count: int",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example"... | |
astrapy.results.BulkWriteResult.upserted_ids | {
"kind": "attribute",
"name": "upserted_ids",
"path": "astrapy.results.BulkWriteResult.upserted_ids",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "upserted_ids: dict[int, Any]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"exa... | |
astrapy.results.BulkWriteResult.zero | Return an empty BulkWriteResult, for use in no-ops and list reductions. | {
"kind": "function",
"name": "zero",
"path": "astrapy.results.BulkWriteResult.zero",
"parameters": null,
"returns": [
{
"name": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": n... |
astrapy.database | {
"kind": "module",
"name": "database",
"path": "astrapy.database",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": "logging",
"Any": "typing.Any",
"cast": null,
"httpx": nu... | |
astrapy.database.logger | {
"kind": "attribute",
"name": "logger",
"path": "astrapy.database.logger",
"parameters": null,
"returns": null,
"gathered_types": [
"__name__"
],
"value": "logger = logging.getLogger(__name__)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"exampl... | |
astrapy.database.Database | A Data API database. This is the object for doing database-level
DML, such as creating/deleting collections, and for obtaining Collection
objects themselves. This class has a synchronous interface.
The usual way of obtaining one Database is through the `get_database`
method of a `DataAPIClient`.
On Astra DB, a Databa... | {
"kind": "class",
"name": "Database",
"path": "astrapy.database.Database",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the full \"API Endpoint\" string used to reach the Data API.\nExample: \"https://<database_id>-<region>.apps.astra.datastax.com\"",
"de... |
astrapy.database.Database.environment | {
"kind": "attribute",
"name": "environment",
"path": "astrapy.database.Database.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": "environment = environment or Environment.PROD.lower()",
"yields": null,
"imports": null... | |
astrapy.database.Database.token_provider | {
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.database.Database.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports... | |
astrapy.database.Database.api_endpoint | {
"kind": "attribute",
"name": "api_endpoint",
"path": "astrapy.database.Database.api_endpoint",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_endpoint = api_endpoint.strip('/')",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
... | |
astrapy.database.Database.api_path | {
"kind": "attribute",
"name": "api_path",
"path": "astrapy.database.Database.api_path",
"parameters": null,
"returns": null,
"gathered_types": [
"_api_path"
],
"value": "api_path = _api_path",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example"... | |
astrapy.database.Database.api_version | {
"kind": "attribute",
"name": "api_version",
"path": "astrapy.database.Database.api_version",
"parameters": null,
"returns": null,
"gathered_types": [
"_api_version"
],
"value": "api_version = _api_version",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": nu... | |
astrapy.database.Database.callers | {
"kind": "attribute",
"name": "callers",
"path": "astrapy.database.Database.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"refer... | |
astrapy.database.Database.with_options | Create a clone of this database with some changed attributes. | {
"kind": "function",
"name": "with_options",
"path": "astrapy.database.Database.with_options",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "this is the keyspace all method calls will target, unless\none is explicitly specified in the call. If no keyspace is ... |
astrapy.database.Database.to_async | Create an AsyncDatabase from this one. Save for the arguments
explicitly provided as overrides, everything else is kept identical
to this database in the copy. | {
"kind": "function",
"name": "to_async",
"path": "astrapy.database.Database.to_async",
"parameters": [
{
"name": "api_endpoint",
"type": "str | None",
"description": "the full \"API Endpoint\" string used to reach the Data API.\nExample: \"https://<database_id>-<region>.apps.astra.datasta... |
astrapy.database.Database.set_caller | Set a new identity for the application/framework on behalf of which
the Data API calls are performed (the "caller"). | {
"kind": "function",
"name": "set_caller",
"path": "astrapy.database.Database.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe Data API calls are performed. This ends up in the reques... |
astrapy.database.Database.use_namespace | Switch to a new working namespace for this database.
This method changes (mutates) the Database instance.
*DEPRECATED* (removal in 2.0). Switch to the "use_keyspace" method.**
Note that this method does not create the namespace, which should exist
already (created for instance with a `DatabaseAdmin.create_namespace` ... | {
"kind": "function",
"name": "use_namespace",
"path": "astrapy.database.Database.use_namespace",
"parameters": [
{
"name": "namespace",
"type": "str",
"description": "the new namespace to use as the database working namespace.",
"default": null,
"value": null
}
],
"ret... |
astrapy.database.Database.use_keyspace | Switch to a new working keyspace for this database.
This method changes (mutates) the Database instance.
Note that this method does not create the keyspace, which should exist
already (created for instance with a `DatabaseAdmin.create_keyspace` call). | {
"kind": "function",
"name": "use_keyspace",
"path": "astrapy.database.Database.use_keyspace",
"parameters": [
{
"name": "keyspace",
"type": "str",
"description": "the new keyspace to use as the database working keyspace.",
"default": null,
"value": null
}
],
"returns"... |
astrapy.database.Database.info | Additional information on the database as a DatabaseInfo instance.
Some of the returned properties are dynamic throughout the lifetime
of the database (such as raw_info["keyspaces"]). For this reason,
each invocation of this method triggers a new request to the DevOps API. | {
"kind": "function",
"name": "info",
"path": "astrapy.database.Database.info",
"parameters": null,
"returns": [
{
"name": null,
"type": "DatabaseInfo",
"description": null
}
],
"gathered_types": [
"astrapy.info.DatabaseInfo"
],
"value": null,
"yields": null,
"imports... |
astrapy.database.Database.id | The ID of this database. | {
"kind": "attribute",
"name": "id",
"path": "astrapy.database.Database.id",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "id: str",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.id\n'01234567-89ab-cdef-0123-... |
astrapy.database.Database.name | The name of this database. Note that this bears no unicity guarantees.
Calling this method the first time involves a request
to the DevOps API (the resulting database name is then cached).
See the `info()` method for more details. | {
"kind": "function",
"name": "name",
"path": "astrapy.database.Database.name",
"parameters": null,
"returns": [
{
"name": null,
"type": "str",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": ... |
astrapy.database.Database.namespace | The namespace this database uses as target for all commands when
no method-call-specific namespace is specified.
*DEPRECATED* (removal in 2.0). Switch to the "keyspace" property.** | {
"kind": "attribute",
"name": "namespace",
"path": "astrapy.database.Database.namespace",
"parameters": null,
"returns": [
{
"name": null,
"type": "str | None",
"description": "the working namespace (a string), or None if not set."
}
],
"gathered_types": null,
"value": "namesp... |
astrapy.database.Database.keyspace | The keyspace this database uses as target for all commands when
no method-call-specific keyspace is specified. | {
"kind": "attribute",
"name": "keyspace",
"path": "astrapy.database.Database.keyspace",
"parameters": null,
"returns": [
{
"name": null,
"type": "str | None",
"description": "the working keyspace (a string), or None if not set."
}
],
"gathered_types": null,
"value": "keyspace:... |
astrapy.database.Database.get_collection | Spawn a `Collection` object instance representing a collection
on this database.
Creating a `Collection` instance does not have any effect on the
actual state of the database: in other words, for the created
`Collection` instance to be used meaningfully, the collection
must exist already (for instance, it should have ... | {
"kind": "function",
"name": "get_collection",
"path": "astrapy.database.Database.get_collection",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the name of the collection.",
"default": null,
"value": null
},
{
"name": "keyspace",
"type":... |
astrapy.database.Database.create_collection | Creates a collection on the database and return the Collection
instance that represents it.
This is a blocking operation: the method returns when the collection
is ready to be used. As opposed to the `get_collection` instance,
this method triggers causes the collection to be actually created on DB. | {
"kind": "function",
"name": "create_collection",
"path": "astrapy.database.Database.create_collection",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the name of the collection.",
"default": null,
"value": null
},
{
"name": "keyspace",
"... |
astrapy.database.Database.drop_collection | Drop a collection from the database, along with all documents therein. | {
"kind": "function",
"name": "drop_collection",
"path": "astrapy.database.Database.drop_collection",
"parameters": [
{
"name": "name_or_collection",
"type": "str | Collection",
"description": "either the name of a collection or\na `Collection` instance.",
"default": null,
"val... |
astrapy.database.Database.list_collections | List all collections in a given keyspace for this database. | {
"kind": "function",
"name": "list_collections",
"path": "astrapy.database.Database.list_collections",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to be inspected. If not specified,\nthe general setting for this database is assumed.",
"de... |
astrapy.database.Database.list_collection_names | List the names of all collections in a given keyspace of this database. | {
"kind": "function",
"name": "list_collection_names",
"path": "astrapy.database.Database.list_collection_names",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to be inspected. If not specified,\nthe general setting for this database is assumed.",... |
astrapy.database.Database.command | Send a POST request to the Data API for this database with
an arbitrary, caller-provided payload. | {
"kind": "function",
"name": "command",
"path": "astrapy.database.Database.command",
"parameters": [
{
"name": "body",
"type": "dict[str, Any]",
"description": "a JSON-serializable dictionary, the payload of the request.",
"default": null,
"value": null
},
{
"nam... |
astrapy.database.Database.get_database_admin | Return a DatabaseAdmin object corresponding to this database, for
use in admin tasks such as managing keyspaces.
This method, depending on the environment where the database resides,
returns an appropriate subclass of DatabaseAdmin. | {
"kind": "function",
"name": "get_database_admin",
"path": "astrapy.database.Database.get_database_admin",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission on the database to\nperform the desired tasks. If omit... |
astrapy.database.AsyncDatabase | A Data API database. This is the object for doing database-level
DML, such as creating/deleting collections, and for obtaining Collection
objects themselves. This class has an asynchronous interface.
The usual way of obtaining one AsyncDatabase is through the `get_async_database`
method of a `DataAPIClient`.
On Astra... | {
"kind": "class",
"name": "AsyncDatabase",
"path": "astrapy.database.AsyncDatabase",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the full \"API Endpoint\" string used to reach the Data API.\nExample: \"https://<database_id>-<region>.apps.astra.datastax.com\"",... |
astrapy.database.AsyncDatabase.environment | {
"kind": "attribute",
"name": "environment",
"path": "astrapy.database.AsyncDatabase.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": "environment = environment or Environment.PROD.lower()",
"yields": null,
"imports":... | |
astrapy.database.AsyncDatabase.token_provider | {
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.database.AsyncDatabase.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"ex... | |
astrapy.database.AsyncDatabase.api_endpoint | {
"kind": "attribute",
"name": "api_endpoint",
"path": "astrapy.database.AsyncDatabase.api_endpoint",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_endpoint = api_endpoint.strip('/')",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": nul... | |
astrapy.database.AsyncDatabase.api_path | {
"kind": "attribute",
"name": "api_path",
"path": "astrapy.database.AsyncDatabase.api_path",
"parameters": null,
"returns": null,
"gathered_types": [
"_api_path"
],
"value": "api_path = _api_path",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"exa... | |
astrapy.database.AsyncDatabase.api_version | {
"kind": "attribute",
"name": "api_version",
"path": "astrapy.database.AsyncDatabase.api_version",
"parameters": null,
"returns": null,
"gathered_types": [
"_api_version"
],
"value": "api_version = _api_version",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports... | |
astrapy.database.AsyncDatabase.callers | {
"kind": "attribute",
"name": "callers",
"path": "astrapy.database.AsyncDatabase.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"... | |
astrapy.database.AsyncDatabase.with_options | Create a clone of this database with some changed attributes. | {
"kind": "function",
"name": "with_options",
"path": "astrapy.database.AsyncDatabase.with_options",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "this is the keyspace all method calls will target, unless\none is explicitly specified in the call. If no keyspac... |
astrapy.database.AsyncDatabase.to_sync | Create a (synchronous) Database from this one. Save for the arguments
explicitly provided as overrides, everything else is kept identical
to this database in the copy. | {
"kind": "function",
"name": "to_sync",
"path": "astrapy.database.AsyncDatabase.to_sync",
"parameters": [
{
"name": "api_endpoint",
"type": "str | None",
"description": "the full \"API Endpoint\" string used to reach the Data API.\nExample: \"https://<database_id>-<region>.apps.astra.data... |
astrapy.database.AsyncDatabase.set_caller | Set a new identity for the application/framework on behalf of which
the Data API calls are performed (the "caller"). | {
"kind": "function",
"name": "set_caller",
"path": "astrapy.database.AsyncDatabase.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe Data API calls are performed. This ends up in the r... |
astrapy.database.AsyncDatabase.use_namespace | Switch to a new working namespace for this database.
This method changes (mutates) the AsyncDatabase instance.
*DEPRECATED* (removal in 2.0). Switch to the "use_keyspace" method.**
Note that this method does not create the namespace, which should exist
already (created for instance with a `DatabaseAdmin.async_create_... | {
"kind": "function",
"name": "use_namespace",
"path": "astrapy.database.AsyncDatabase.use_namespace",
"parameters": [
{
"name": "namespace",
"type": "str",
"description": "the new namespace to use as the database working namespace.",
"default": null,
"value": null
}
],
... |
astrapy.database.AsyncDatabase.use_keyspace | Switch to a new working keyspace for this database.
This method changes (mutates) the AsyncDatabase instance.
Note that this method does not create the keyspace, which should exist
already (created for instance with a `DatabaseAdmin.async_create_keyspace` call). | {
"kind": "function",
"name": "use_keyspace",
"path": "astrapy.database.AsyncDatabase.use_keyspace",
"parameters": [
{
"name": "keyspace",
"type": "str",
"description": "the new keyspace to use as the database working keyspace.",
"default": null,
"value": null
}
],
"ret... |
astrapy.database.AsyncDatabase.info | Additional information on the database as a DatabaseInfo instance.
Some of the returned properties are dynamic throughout the lifetime
of the database (such as raw_info["keyspaces"]). For this reason,
each invocation of this method triggers a new request to the DevOps API. | {
"kind": "function",
"name": "info",
"path": "astrapy.database.AsyncDatabase.info",
"parameters": null,
"returns": [
{
"name": null,
"type": "DatabaseInfo",
"description": null
}
],
"gathered_types": [
"astrapy.info.DatabaseInfo"
],
"value": null,
"yields": null,
"im... |
astrapy.database.AsyncDatabase.id | The ID of this database. | {
"kind": "attribute",
"name": "id",
"path": "astrapy.database.AsyncDatabase.id",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "id: str",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db.id\n'01234567-89ab... |
astrapy.database.AsyncDatabase.name | The name of this database. Note that this bears no unicity guarantees.
Calling this method the first time involves a request
to the DevOps API (the resulting database name is then cached).
See the `info()` method for more details. | {
"kind": "function",
"name": "name",
"path": "astrapy.database.AsyncDatabase.name",
"parameters": null,
"returns": [
{
"name": null,
"type": "str",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bas... |
astrapy.database.AsyncDatabase.namespace | The namespace this database uses as target for all commands when
no method-call-specific namespace is specified.
*DEPRECATED* (removal in 2.0). Switch to the "keyspace" property.** | {
"kind": "attribute",
"name": "namespace",
"path": "astrapy.database.AsyncDatabase.namespace",
"parameters": null,
"returns": [
{
"name": null,
"type": "str | None",
"description": "the working namespace (a string), or None if not set."
}
],
"gathered_types": null,
"value": "n... |
astrapy.database.AsyncDatabase.keyspace | The keyspace this database uses as target for all commands when
no method-call-specific keyspace is specified. | {
"kind": "attribute",
"name": "keyspace",
"path": "astrapy.database.AsyncDatabase.keyspace",
"parameters": null,
"returns": [
{
"name": null,
"type": "str | None",
"description": "the working keyspace (a string), or None if not set."
}
],
"gathered_types": null,
"value": "keys... |
astrapy.database.AsyncDatabase.get_collection | Spawn an `AsyncCollection` object instance representing a collection
on this database.
Creating an `AsyncCollection` instance does not have any effect on the
actual state of the database: in other words, for the created
`AsyncCollection` instance to be used meaningfully, the collection
must exist already (for instance... | {
"kind": "function",
"name": "get_collection",
"path": "astrapy.database.AsyncDatabase.get_collection",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the name of the collection.",
"default": null,
"value": null
},
{
"name": "keyspace",
"t... |
astrapy.database.AsyncDatabase.create_collection | Creates a collection on the database and return the AsyncCollection
instance that represents it.
This is a blocking operation: the method returns when the collection
is ready to be used. As opposed to the `get_collection` instance,
this method triggers causes the collection to be actually created on DB. | {
"kind": "function",
"name": "create_collection",
"path": "astrapy.database.AsyncDatabase.create_collection",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the name of the collection.",
"default": null,
"value": null
},
{
"name": "keyspace",
... |
astrapy.database.AsyncDatabase.drop_collection | Drop a collection from the database, along with all documents therein. | {
"kind": "function",
"name": "drop_collection",
"path": "astrapy.database.AsyncDatabase.drop_collection",
"parameters": [
{
"name": "name_or_collection",
"type": "str | AsyncCollection",
"description": "either the name of a collection or\nan `AsyncCollection` instance.",
"default": ... |
astrapy.database.AsyncDatabase.list_collections | List all collections in a given keyspace for this database. | {
"kind": "function",
"name": "list_collections",
"path": "astrapy.database.AsyncDatabase.list_collections",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to be inspected. If not specified,\nthe general setting for this database is assumed.",
... |
astrapy.database.AsyncDatabase.list_collection_names | List the names of all collections in a given keyspace of this database. | {
"kind": "function",
"name": "list_collection_names",
"path": "astrapy.database.AsyncDatabase.list_collection_names",
"parameters": [
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to be inspected. If not specified,\nthe general setting for this database is assum... |
astrapy.database.AsyncDatabase.command | Send a POST request to the Data API for this database with
an arbitrary, caller-provided payload. | {
"kind": "function",
"name": "command",
"path": "astrapy.database.AsyncDatabase.command",
"parameters": [
{
"name": "body",
"type": "dict[str, Any]",
"description": "a JSON-serializable dictionary, the payload of the request.",
"default": null,
"value": null
},
{
... |
astrapy.database.AsyncDatabase.get_database_admin | Return a DatabaseAdmin object corresponding to this database, for
use in admin tasks such as managing keyspaces.
This method, depending on the environment where the database resides,
returns an appropriate subclass of DatabaseAdmin. | {
"kind": "function",
"name": "get_database_admin",
"path": "astrapy.database.AsyncDatabase.get_database_admin",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission on the database to\nperform the desired tasks. If... |
astrapy.client | {
"kind": "module",
"name": "client",
"path": "astrapy.client",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": "logging",
"Any": "typing.Any",
"cast": null,
"httpx": null,
... | |
astrapy.client.logger | {
"kind": "attribute",
"name": "logger",
"path": "astrapy.client.logger",
"parameters": null,
"returns": null,
"gathered_types": [
"__name__"
],
"value": "logger = logging.getLogger(__name__)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example"... | |
astrapy.client.DataAPIClient | A client for using the Data API. This is the main entry point and sits
at the top of the conceptual "client -> database -> collection" hierarchy.
A client is created first, optionally passing it a suitable Access Token.
Starting from the client, then:
- databases (Database and AsyncDatabase) are created for workin... | {
"kind": "class",
"name": "DataAPIClient",
"path": "astrapy.client.DataAPIClient",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an Access Token to the database. Example: `\"AstraCS:xyz...\"`.\nThis can be either a literal token string or a subcl... |
astrapy.client.DataAPIClient.token_provider | {
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.client.DataAPIClient.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"expo... | |
astrapy.client.DataAPIClient.environment | {
"kind": "attribute",
"name": "environment",
"path": "astrapy.client.DataAPIClient.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": "environment = environment or Environment.PROD.lower()",
"yields": null,
"imports": n... | |
astrapy.client.DataAPIClient.callers | {
"kind": "attribute",
"name": "callers",
"path": "astrapy.client.DataAPIClient.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"re... | |
astrapy.client.DataAPIClient.with_options | Create a clone of this DataAPIClient with some changed attributes. | {
"kind": "function",
"name": "with_options",
"path": "astrapy.client.DataAPIClient.with_options",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an Access Token to the database. Example: `\"AstraCS:xyz...\"`.\nThis can be either a literal token st... |
astrapy.client.DataAPIClient.set_caller | Set a new identity for the application/framework on behalf of which
the API calls will be performed (the "caller").
New objects spawned from this client afterwards will inherit the new settings. | {
"kind": "function",
"name": "set_caller",
"path": "astrapy.client.DataAPIClient.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe API API calls are performed. This ends up in the requ... |
astrapy.client.DataAPIClient.get_database | Get a Database object from this client, for doing data-related work. | {
"kind": "function",
"name": "get_database",
"path": "astrapy.client.DataAPIClient.get_database",
"parameters": [
{
"name": "api_endpoint_or_id",
"type": "str | None",
"description": "positional parameter that can stand for both\n`api_endpoint` and `id`. Passing them together is an error.... |
astrapy.client.DataAPIClient.get_async_database | Get an AsyncDatabase object from this client, for doing data-related work. | {
"kind": "function",
"name": "get_async_database",
"path": "astrapy.client.DataAPIClient.get_async_database",
"parameters": [
{
"name": "api_endpoint_or_id",
"type": "str | None",
"description": "positional parameter that can stand for both\n`api_endpoint` and `id`. Passing them together ... |
astrapy.client.DataAPIClient.get_database_by_api_endpoint | Get a Database object from this client, for doing data-related work.
The Database is specified by an API Endpoint instead of the ID and a region.
Note that using this method is generally equivalent to passing
an API Endpoint as parameter to the `get_database` method (see). | {
"kind": "function",
"name": "get_database_by_api_endpoint",
"path": "astrapy.client.DataAPIClient.get_database_by_api_endpoint",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the full \"API Endpoint\" string used to reach the Data API.\nExample: \"https://DATAB... |
astrapy.client.DataAPIClient.get_async_database_by_api_endpoint | Get an AsyncDatabase object from this client, for doing data-related work.
The Database is specified by an API Endpoint instead of the ID and a region.
Note that using this method is generally equivalent to passing
an API Endpoint as parameter to the `get_async_database` method (see).
This method has identical behavi... | {
"kind": "function",
"name": "get_async_database_by_api_endpoint",
"path": "astrapy.client.DataAPIClient.get_async_database_by_api_endpoint",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name":... |
astrapy.client.DataAPIClient.get_admin | Get an AstraDBAdmin instance corresponding to this client, for
admin work such as managing databases. | {
"kind": "function",
"name": "get_admin",
"path": "astrapy.client.DataAPIClient.get_admin",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Astra DB Admin instead of the\nclient token. This may be useful when switching... |
astrapy.cursors | {
"kind": "module",
"name": "cursors",
"path": "astrapy.cursors",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": {
"annotations": "__future__.annotations",
"logging": "logging",
"Any": "typing.Any",
"cast": null,
"httpx": null... | |
astrapy.cursors.logger | {
"kind": "attribute",
"name": "logger",
"path": "astrapy.cursors.logger",
"parameters": null,
"returns": null,
"gathered_types": [
"__name__"
],
"value": "logger = logging.getLogger(__name__)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.