Dataset Viewer
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": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": null,
"time": null,
"Iterable": null,
"__version__": null,
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": null,
"ThreadPoolExecutor": null,
"TracebackType": null,
"TYPE_CHECKING": null,
"Sequence": null,
"deprecation": null,
"APICommander": null,
"CollectionAPIOptions": null,
"coerce_embedding_headers_provider": null,
"CallerType": null,
"DocumentType": null,
"FilterType": null,
"ProjectionType": null,
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": null,
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": "astrapy.database.AsyncDatabase",
"Database": "astrapy.database.Database",
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": null,
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": null,
"SET_CALLER_DEPRECATION_NOTICE": null,
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": null,
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": null,
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": null,
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": null,
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": null,
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": null,
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": null,
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": null,
"partial": null,
"Callable": null,
"Iterator": null,
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": "importlib",
"os": "os",
"toml": "toml",
"astrapy": "astrapy",
"AstraDBAdmin": "astrapy.admin.AstraDBAdmin",
"AstraDBDatabaseAdmin": "astrapy.admin.AstraDBDatabaseAdmin",
"DataAPIDatabaseAdmin": "astrapy.admin.DataAPIDatabaseAdmin",
"DataAPIClient": "astrapy.client.DataAPIClient",
"AsyncCollection": "astrapy.collection.AsyncCollection",
"Collection": "astrapy.collection.Collection",
"field": null,
"TypeVar": null,
"EmbeddingAPIKeyHeaderProvider": null,
"ABC": null,
"abstractmethod": null,
"fetch_database_info": null,
"parse_api_endpoint": null,
"coerce_token_provider": null,
"redact_secret": null,
"Environment": null,
"AsyncCommandCursor": null,
"CommandCursor": null,
"API_PATH_ENV_MAP": null,
"API_VERSION_ENV_MAP": null,
"DEFAULT_ASTRA_DB_KEYSPACE": null,
"CollectionAlreadyExistsException": null,
"DevOpsAPIException": null,
"CollectionDescriptor": null,
"CollectionVectorServiceOptions": null,
"DatabaseInfo": null,
"DatabaseAdmin": null,
"TokenProvider": null,
"api_endpoint_parsing_error_message": null,
"build_api_endpoint": null,
"check_id_endpoint_parg_kwargs": null,
"generic_api_url_parsing_error_message": null,
"normalize_region_for_id": null,
"parse_generic_api_url": null,
"check_deprecated_id_region": null,
"hashlib": null,
"Enum": null,
"Generic": null,
"Optional": null,
"Tuple": null,
"CursorIsStartedException": null,
"DataAPITimeoutException": null,
"normalize_payload_value": null,
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": true,
"is_package": true,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": [
"DataAPIClient",
"Collection",
"AsyncCollection",
"AsyncDatabase",
"__version__",
"AstraDBAdmin",
"DataAPIDatabaseAdmin",
"Database",
"AstraDBDatabaseAdmin"
],
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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,
"API_RESPONSE": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": null,
"time": null,
"Iterable": null,
"__version__": null,
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": null,
"ThreadPoolExecutor": null,
"TracebackType": null,
"TYPE_CHECKING": null,
"Sequence": null,
"deprecation": null,
"APICommander": null,
"CollectionAPIOptions": null,
"coerce_embedding_headers_provider": null,
"CallerType": null,
"DocumentType": null,
"FilterType": null,
"ProjectionType": null,
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": null,
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": null,
"Database": null,
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": null,
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": null,
"SET_CALLER_DEPRECATION_NOTICE": null,
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": null,
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": null,
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": null,
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": null,
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": null,
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": "astrapy.authentication.EmbeddingHeadersProvider",
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": "dataclasses.dataclass",
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": null,
"partial": null,
"Callable": null,
"Iterator": null,
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": null,
"os": null,
"toml": null,
"astrapy": null,
"AstraDBAdmin": null,
"AstraDBDatabaseAdmin": null,
"DataAPIDatabaseAdmin": null,
"DataAPIClient": null,
"AsyncCollection": null,
"Collection": null,
"field": "dataclasses.field",
"TypeVar": "typing.TypeVar",
"EmbeddingAPIKeyHeaderProvider": "astrapy.authentication.EmbeddingAPIKeyHeaderProvider",
"ABC": null,
"abstractmethod": null,
"fetch_database_info": null,
"parse_api_endpoint": null,
"coerce_token_provider": null,
"redact_secret": null,
"Environment": null,
"AsyncCommandCursor": null,
"CommandCursor": null,
"API_PATH_ENV_MAP": null,
"API_VERSION_ENV_MAP": null,
"DEFAULT_ASTRA_DB_KEYSPACE": null,
"CollectionAlreadyExistsException": null,
"DevOpsAPIException": null,
"CollectionDescriptor": null,
"CollectionVectorServiceOptions": null,
"DatabaseInfo": null,
"DatabaseAdmin": null,
"TokenProvider": null,
"api_endpoint_parsing_error_message": null,
"build_api_endpoint": null,
"check_id_endpoint_parg_kwargs": null,
"generic_api_url_parsing_error_message": null,
"normalize_region_for_id": null,
"parse_generic_api_url": null,
"check_deprecated_id_region": null,
"hashlib": null,
"Enum": null,
"Generic": null,
"Optional": null,
"Tuple": null,
"CursorIsStartedException": null,
"DataAPITimeoutException": null,
"normalize_payload_value": null,
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": false,
"is_package": false,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration of each\noperation on the collection. Individual timeouts can be provided to\neach collection method call and will take precedence, with this value\nbeing an overall default.\nNote that for some methods involving multiple API calls (such as\n`find`, `delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense."
}
]
}
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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 as that of the EmbeddingHeadersTokenProvider instances)
|
{
"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
}
],
"returns": [
{
"name": null,
"type": "AO",
"description": "a new instance of this class obtained by merging this one and the default."
}
],
"gathered_types": [
"AO",
"BaseAPIOptions"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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 __bool__ definition of the values,
such as that of the EmbeddingHeadersTokenProvider instances)
|
{
"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,
"value": null
}
],
"returns": [
{
"name": null,
"type": "AO",
"description": "a new instance of this class obtained by merging the override and this one."
}
],
"gathered_types": [
"AO",
"BaseAPIOptions"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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",
"type": "EmbeddingHeadersProvider",
"description": null,
"default": "lambda: EmbeddingAPIKeyHeaderProvider(None)()",
"value": null
}
],
"returns": null,
"gathered_types": [
"astrapy.authentication.EmbeddingAPIKeyHeaderProvider",
"astrapy.authentication.EmbeddingHeadersProvider",
"BaseAPIOptions"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"BaseAPIOptions"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration of each\noperation on the collection. Individual timeouts can be provided to\neach collection method call and will take precedence, with this value\nbeing an overall default.\nNote that for some methods involving multiple API calls (such as\n`find`, `delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense."
},
{
"name": "embedding_api_key",
"type": "EmbeddingHeadersProvider",
"description": "an `astrapy.authentication.EmbeddingHeadersProvider`\nobject, encoding embedding-related API keys that will be passed\nas headers when interacting with the collection (on each Data API request).\nThe default value is `EmbeddingAPIKeyHeaderProvider(None)`, i.e.\nno embedding-specific headers, whereas if the collection is configured\nwith an embedding service other choices for this parameter can be\nmeaningfully supplied. is configured for the collection,"
}
]
}
|
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": "embedding_api_key: EmbeddingHeadersProvider = field(default_factory=lambda: EmbeddingAPIKeyHeaderProvider(None))",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"API_RESPONSE": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": null,
"time": null,
"Iterable": null,
"__version__": null,
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": null,
"ThreadPoolExecutor": null,
"TracebackType": null,
"TYPE_CHECKING": null,
"Sequence": null,
"deprecation": null,
"APICommander": null,
"CollectionAPIOptions": null,
"coerce_embedding_headers_provider": null,
"CallerType": null,
"DocumentType": null,
"FilterType": null,
"ProjectionType": null,
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": null,
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": null,
"Database": null,
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": null,
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": null,
"SET_CALLER_DEPRECATION_NOTICE": null,
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": null,
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": null,
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": null,
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": null,
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": null,
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": null,
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": "dataclasses.dataclass",
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": null,
"partial": null,
"Callable": null,
"Iterator": null,
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": null,
"os": null,
"toml": null,
"astrapy": null,
"AstraDBAdmin": null,
"AstraDBDatabaseAdmin": null,
"DataAPIDatabaseAdmin": null,
"DataAPIClient": null,
"AsyncCollection": null,
"Collection": null,
"field": null,
"TypeVar": null,
"EmbeddingAPIKeyHeaderProvider": null,
"ABC": "abc.ABC",
"abstractmethod": "abc.abstractmethod",
"fetch_database_info": null,
"parse_api_endpoint": null,
"coerce_token_provider": null,
"redact_secret": null,
"Environment": null,
"AsyncCommandCursor": null,
"CommandCursor": null,
"API_PATH_ENV_MAP": null,
"API_VERSION_ENV_MAP": null,
"DEFAULT_ASTRA_DB_KEYSPACE": null,
"CollectionAlreadyExistsException": null,
"DevOpsAPIException": null,
"CollectionDescriptor": null,
"CollectionVectorServiceOptions": null,
"DatabaseInfo": null,
"DatabaseAdmin": null,
"TokenProvider": null,
"api_endpoint_parsing_error_message": null,
"build_api_endpoint": null,
"check_id_endpoint_parg_kwargs": null,
"generic_api_url_parsing_error_message": null,
"normalize_region_for_id": null,
"parse_generic_api_url": null,
"check_deprecated_id_region": null,
"hashlib": null,
"Enum": null,
"Generic": null,
"Optional": null,
"Tuple": null,
"CursorIsStartedException": null,
"DataAPITimeoutException": null,
"normalize_payload_value": null,
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": false,
"is_package": false,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"ABC"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": [
"astrapy.results.DeleteResult",
"astrapy.results.InsertManyResult",
"astrapy.results.UpdateResult",
"astrapy.results.InsertOneResult"
],
"attributes": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": "response/responses from the Data API call.\nDepending on the exact delete method being used, this\nlist of raw responses can contain exactly one or a number of items."
}
]
}
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": [
"astrapy.results.OperationResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.results.OperationResult"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "deleted_count",
"type": "int",
"description": "number of deleted documents"
},
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": "response/responses from the Data API call.\nDepending on the exact delete method being used, this\nlist of raw responses can contain exactly one or a number of items."
}
]
}
|
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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": [
"astrapy.results.OperationResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.results.OperationResult"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": "one-item list with the response from the Data API call"
},
{
"name": "inserted_id",
"type": "Any",
"description": "the ID of the inserted document"
}
]
}
|
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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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[Any]",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": [
"astrapy.results.OperationResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.results.OperationResult"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": "responses from the Data API calls"
},
{
"name": "inserted_ids",
"type": "list[Any]",
"description": "list of the IDs of the inserted documents"
}
]
}
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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]",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": [
"astrapy.results.OperationResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.results.OperationResult"
],
"exports": null,
"example": null,
"references": null,
"note": "the \"update_info\" field has the following fields: \"n\" (int),\n\"updatedExisting\" (bool), \"ok\" (float), \"nModified\" (int)\nand optionally \"upserted\" containing the ID of an upserted document.",
"implemented_by": null,
"attributes": [
{
"name": "raw_results",
"type": "list[dict[str, Any]]",
"description": "responses from the Data API calls"
},
{
"name": "update_info",
"type": "dict[str, Any]",
"description": "a dictionary reporting about the update"
}
]
}
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"type": "BulkWriteResult",
"description": null
}
],
"gathered_types": [
"astrapy.results.BulkWriteResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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",
"type": "int",
"description": null,
"default": null,
"value": null
},
{
"name": "inserted_count",
"type": "int",
"description": null,
"default": null,
"value": null
},
{
"name": "matched_count",
"type": "int",
"description": null,
"default": null,
"value": null
},
{
"name": "modified_count",
"type": "int",
"description": null,
"default": null,
"value": null
},
{
"name": "upserted_count",
"type": "int",
"description": null,
"default": null,
"value": null
},
{
"name": "upserted_ids",
"type": "dict[int, Any]",
"description": null,
"default": null,
"value": null
}
],
"returns": null,
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": [
{
"name": "bulk_api_results",
"type": "dict[int, list[dict[str, Any]]]",
"description": "a map from indices to the corresponding raw responses"
},
{
"name": "deleted_count",
"type": "int",
"description": "number of deleted documents"
},
{
"name": "inserted_count",
"type": "int",
"description": "number of inserted documents"
},
{
"name": "matched_count",
"type": "int",
"description": "number of matched documents"
},
{
"name": "modified_count",
"type": "int",
"description": "number of modified documents"
},
{
"name": "upserted_count",
"type": "int",
"description": "number of upserted documents"
},
{
"name": "upserted_ids",
"type": "dict[int, Any]",
"description": "a (sparse) map from indices to ID of the upserted document"
}
]
}
|
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": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": null,
"API_RESPONSE": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": null,
"time": null,
"Iterable": null,
"__version__": "astrapy.__version__",
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": "warnings",
"ThreadPoolExecutor": null,
"TracebackType": "types.TracebackType",
"TYPE_CHECKING": "typing.TYPE_CHECKING",
"Sequence": "typing.Sequence",
"deprecation": "deprecation",
"APICommander": "astrapy.api_commander.APICommander",
"CollectionAPIOptions": "astrapy.api_options.CollectionAPIOptions",
"coerce_embedding_headers_provider": "astrapy.authentication.coerce_embedding_headers_provider",
"CallerType": "astrapy.constants.CallerType",
"DocumentType": null,
"FilterType": null,
"ProjectionType": null,
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": null,
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": null,
"Database": null,
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": "astrapy.defaults.DEFAULT_DATA_API_AUTH_HEADER",
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": "astrapy.defaults.NAMESPACE_DEPRECATION_NOTICE_METHOD",
"SET_CALLER_DEPRECATION_NOTICE": "astrapy.defaults.SET_CALLER_DEPRECATION_NOTICE",
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": "astrapy.exceptions.DataAPIFaultyResponseException",
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": "astrapy.exceptions.MultiCallTimeoutManager",
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": "astrapy.exceptions.base_timeout_info",
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": "astrapy.meta.check_caller_parameters",
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": "astrapy.meta.check_namespace_keyspace",
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": "astrapy.authentication.EmbeddingHeadersProvider",
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": null,
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": null,
"partial": null,
"Callable": null,
"Iterator": null,
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": null,
"os": null,
"toml": null,
"astrapy": null,
"AstraDBAdmin": null,
"AstraDBDatabaseAdmin": null,
"DataAPIDatabaseAdmin": null,
"DataAPIClient": null,
"AsyncCollection": "astrapy.collection.AsyncCollection",
"Collection": "astrapy.collection.Collection",
"field": null,
"TypeVar": null,
"EmbeddingAPIKeyHeaderProvider": null,
"ABC": null,
"abstractmethod": null,
"fetch_database_info": "astrapy.admin.fetch_database_info",
"parse_api_endpoint": "astrapy.admin.parse_api_endpoint",
"coerce_token_provider": "astrapy.authentication.coerce_token_provider",
"redact_secret": "astrapy.authentication.redact_secret",
"Environment": "astrapy.constants.Environment",
"AsyncCommandCursor": "astrapy.cursors.AsyncCommandCursor",
"CommandCursor": "astrapy.cursors.CommandCursor",
"API_PATH_ENV_MAP": "astrapy.defaults.API_PATH_ENV_MAP",
"API_VERSION_ENV_MAP": "astrapy.defaults.API_VERSION_ENV_MAP",
"DEFAULT_ASTRA_DB_KEYSPACE": "astrapy.defaults.DEFAULT_ASTRA_DB_KEYSPACE",
"CollectionAlreadyExistsException": "astrapy.exceptions.CollectionAlreadyExistsException",
"DevOpsAPIException": "astrapy.exceptions.DevOpsAPIException",
"CollectionDescriptor": "astrapy.info.CollectionDescriptor",
"CollectionVectorServiceOptions": "astrapy.info.CollectionVectorServiceOptions",
"DatabaseInfo": "astrapy.info.DatabaseInfo",
"DatabaseAdmin": "astrapy.admin.DatabaseAdmin",
"TokenProvider": "astrapy.authentication.TokenProvider",
"api_endpoint_parsing_error_message": null,
"build_api_endpoint": null,
"check_id_endpoint_parg_kwargs": null,
"generic_api_url_parsing_error_message": null,
"normalize_region_for_id": null,
"parse_generic_api_url": null,
"check_deprecated_id_region": null,
"hashlib": null,
"Enum": null,
"Generic": null,
"Optional": null,
"Tuple": null,
"CursorIsStartedException": null,
"DataAPITimeoutException": null,
"normalize_payload_value": null,
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": false,
"is_package": false,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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 Database comes with an "API Endpoint", which implies
a Database object instance reaches a specific region (relevant point in
case of multi-region databases).
|
{
"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\"",
"default": null,
"value": null
},
{
"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 subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"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 supplied\nwhen creating a Database, on Astra DB the name \"default_keyspace\" is set,\nwhile on other environments the keyspace is left unspecified: in this case,\nmost operations are unavailable until a keyspace is set (through an explicit\n`use_keyspace` invocation or equivalent).",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`. Removal 2.0.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a string representing the target Data API environment.\nIt can be left unspecified for the default value of `Environment.PROD`;\nother values include `Environment.OTHER`, `Environment.DSE`.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default (sensibly chosen based on the environment).",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> my_client = astrapy.DataAPIClient(\"AstraCS:...\")\n>>> my_db = my_client.get_database(\n... \"https://01234567-....apps.astra.datastax.com\"\n... )",
"references": [
"astrapy.client.DataAPIClient"
],
"note": "creating an instance of Database does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
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,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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 supplied\nwhen creating a Database, the name \"default_keyspace\" is set.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "a new `Database` instance."
}
],
"gathered_types": [
"astrapy.database.Database",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_2 = my_db.with_options(\n... keyspace=\"the_other_keyspace\",\n... callers=[(\"the_caller\", \"0.1.0\")],\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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.datastax.com\"",
"default": "None",
"value": "None"
},
{
"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 subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"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 supplied\nwhen creating a Database, the name \"default_keyspace\" is set.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a string representing the target Data API environment.\nValues are, for example, `Environment.PROD`, `Environment.OTHER`,\nor `Environment.DSE`.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": "the new copy, an `AsyncDatabase` instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db = my_db.to_async()\n>>> asyncio.run(my_async_db.list_collection_names())",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.set_caller(caller_name=\"the_caller\", caller_version=\"0.1.0\")",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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` call).
|
{
"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
}
],
"returns": [
{
"name": null,
"type": "None",
"description": "None."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.list_collection_names()\n['coll_1', 'coll_2']\n>>> my_db.use_namespace(\"an_empty_namespace\")\n>>> my_db.list_collection_names()\n[]",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": [
{
"name": null,
"type": "None",
"description": "None."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.list_collection_names()\n['coll_1', 'coll_2']\n>>> my_db.use_keyspace(\"an_empty_keyspace\")\n>>> my_db.list_collection_names()\n[]",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.info().region\n'eu-west-1'\n\n>>> my_db.info().raw_info['datacenters'][0]['dateCreated']\n'2023-01-30T12:34:56Z'",
"references": null,
"note": "see the DatabaseInfo documentation for a caveat about the difference\nbetween the `region` and the `raw_info[\"region\"]` attributes.",
"implemented_by": null,
"attributes": null
}
|
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-456789abcdef'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": null,
"exports": null,
"example": ">>> my_db.name()\n'the_application_database'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": "namespace: str | None",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.namespace\n'the_keyspace'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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: str | None",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.keyspace\n'the_keyspace'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 been created
previously by calling the `create_collection` method).
|
{
"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": "str | None",
"description": "the keyspace containing the collection. If no keyspace\nis specified, the general setting for this database is used.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "embedding_api_key",
"type": "str | EmbeddingHeadersProvider | None",
"description": "optional API key(s) for interacting with the collection.\nIf an embedding service is configured, and this parameter is not None,\neach Data API call will include the necessary embedding-related headers\nas specified by this parameter. If a string is passed, it translates\ninto the one \"embedding api key\" header\n(i.e. `astrapy.authentication.EmbeddingAPIKeyHeaderProvider`).\nFor some vectorize providers/models, if using header-based\nauthentication, specialized subclasses of\n`astrapy.authentication.EmbeddingHeadersProvider` should be supplied.",
"default": "None",
"value": "None"
},
{
"name": "collection_max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration\nof each operation on the collection. Individual timeouts can be\nprovided to each collection method call and will take precedence, with\nthis value being an overall default.\nNote that for some methods involving multiple API calls (such as `find`,\n`delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Collection",
"description": "a `Collection` instance, representing the desired collection\n(but without any form of validation)."
}
],
"gathered_types": [
"astrapy.authentication.EmbeddingHeadersProvider"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_col = my_db.get_collection(\"my_collection\")\n>>> my_col.count_documents({}, upper_bound=100)\n41",
"references": null,
"note": "The attribute and indexing syntax forms achieve the same effect\nas this method. In other words, the following are equivalent:\n my_db.get_collection(\"coll_name\")\n my_db.coll_name\n my_db[\"coll_name\"]",
"implemented_by": null,
"attributes": null
}
|
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",
"type": "str | None",
"description": "the keyspace where the collection is to be created.\nIf not specified, the general setting for this database is used.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "dimension",
"type": "int | None",
"description": "for vector collections, the dimension of the vectors\n(i.e. the number of their components).",
"default": "None",
"value": "None"
},
{
"name": "metric",
"type": "str | None",
"description": "the similarity metric used for vector searches.\nAllowed values are `VectorMetric.DOT_PRODUCT`, `VectorMetric.EUCLIDEAN`\nor `VectorMetric.COSINE` (default).",
"default": "None",
"value": "None"
},
{
"name": "service",
"type": "CollectionVectorServiceOptions | dict[str, Any] | None",
"description": "a dictionary describing a service for\nembedding computation, e.g. `{\"provider\": \"ab\", \"modelName\": \"xy\"}`.\nAlternatively, a CollectionVectorServiceOptions object to the same effect.",
"default": "None",
"value": "None"
},
{
"name": "indexing",
"type": "dict[str, Any] | None",
"description": "optional specification of the indexing options for\nthe collection, in the form of a dictionary such as\n {\"deny\": [...]}\nor\n {\"allow\": [...]}",
"default": "None",
"value": "None"
},
{
"name": "default_id_type",
"type": "str | None",
"description": "this sets what type of IDs the API server will\ngenerate when inserting documents that do not specify their\n`_id` field explicitly. Can be set to any of the values\n`DefaultIdType.UUID`, `DefaultIdType.OBJECTID`,\n`DefaultIdType.UUIDV6`, `DefaultIdType.UUIDV7`,\n`DefaultIdType.DEFAULT`.",
"default": "None",
"value": "None"
},
{
"name": "additional_options",
"type": "dict[str, Any] | None",
"description": "any further set of key-value pairs that will\nbe added to the \"options\" part of the payload when sending\nthe Data API command to create a collection.",
"default": "None",
"value": "None"
},
{
"name": "check_exists",
"type": "bool | None",
"description": "whether to run an existence check for the collection\nname before attempting to create the collection:\nIf check_exists is True, an error is raised when creating\nan existing collection.\nIf it is False, the creation is attempted. In this case, for\npreexisting collections, the command will succeed or fail\ndepending on whether the options match or not.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
},
{
"name": "embedding_api_key",
"type": "str | EmbeddingHeadersProvider | None",
"description": "optional API key(s) for interacting with the collection.\nIf an embedding service is configured, and this parameter is not None,\neach Data API call will include the necessary embedding-related headers\nas specified by this parameter. If a string is passed, it translates\ninto the one \"embedding api key\" header\n(i.e. `astrapy.authentication.EmbeddingAPIKeyHeaderProvider`).\nFor some vectorize providers/models, if using header-based authentication,\nspecialized subclasses of `astrapy.authentication.EmbeddingHeadersProvider`\nshould be supplied.",
"default": "None",
"value": "None"
},
{
"name": "collection_max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration of each\noperation on the collection. Individual timeouts can be provided to\neach collection method call and will take precedence, with this value\nbeing an overall default.\nNote that for some methods involving multiple API calls (such as\n`find`, `delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Collection",
"description": "a (synchronous) `Collection` instance, representing the"
},
{
"name": null,
"type": "Collection",
"description": "newly-created collection."
}
],
"gathered_types": [
"astrapy.authentication.EmbeddingHeadersProvider",
"astrapy.info.CollectionVectorServiceOptions"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> new_col = my_db.create_collection(\"my_v_col\", dimension=3)\n>>> new_col.insert_one({\"name\": \"the_row\", \"$vector\": [0.4, 0.5, 0.7]})\nInsertOneResult(raw_results=..., inserted_id='e22dd65e-...-...-...')",
"references": null,
"note": "A collection is considered a vector collection if at least one of\n`dimension` or `service` are provided and not null. In that case,\nand only in that case, is `metric` an accepted parameter.\nNote, moreover, that if passing both these parameters, then\nthe dimension must be compatible with the chosen service.",
"implemented_by": null,
"attributes": null
}
|
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,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "a dictionary in the form {\"ok\": 1} if the command succeeds."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.list_collection_names()\n['a_collection', 'my_v_col', 'another_col']\n>>> my_db.drop_collection(\"my_v_col\")\n{'ok': 1}\n>>> my_db.list_collection_names()\n['a_collection', 'another_col']",
"references": null,
"note": "when providing a collection name, it is assumed that the collection\nis to be found in the keyspace that was set at database instance level.",
"implemented_by": null,
"attributes": null
}
|
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.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "CommandCursor[CollectionDescriptor]",
"description": "a `CommandCursor` to iterate over CollectionDescriptor instances,"
},
{
"name": null,
"type": "CommandCursor[CollectionDescriptor]",
"description": "each corresponding to a collection."
}
],
"gathered_types": [
"astrapy.info.CollectionDescriptor",
"astrapy.cursors.CommandCursor"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> ccur = my_db.list_collections()\n>>> ccur\n<astrapy.cursors.CommandCursor object at ...>\n>>> list(ccur)\n[CollectionDescriptor(name='my_v_col', options=CollectionOptions())]\n>>> for coll_dict in my_db.list_collections():\n... print(coll_dict)\n...\nCollectionDescriptor(name='my_v_col', options=CollectionOptions())",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "a list of the collection names as strings, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.list_collection_names()\n['a_collection', 'another_col']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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
},
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to use. Requests always target a keyspace:\nif not specified, the general setting for this database is assumed.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "collection_name",
"type": "str | None",
"description": "if provided, the collection name is appended at the end\nof the endpoint. In this way, this method allows collection-level\narbitrary POST requests as well.",
"default": "None",
"value": "None"
},
{
"name": "raise_api_errors",
"type": "bool",
"description": "if True, responses with a nonempty 'errors' field\nresult in an astrapy exception being raised.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "a dictionary with the response of the HTTP request."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.command({\"findCollections\": {}})\n{'status': {'collections': ['my_coll']}}\n>>> my_db.command({\"countDocuments\": {}}, collection_name=\"my_coll\")\n{'status': {'count': 123}}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 omitted (as it can generally be done),\nthe token of this Database is used.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.\nNote that this parameter is allowed only for Astra DB environments.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.\nNote that this parameter is allowed only for Astra DB environments.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DatabaseAdmin",
"description": "A DatabaseAdmin instance targeting this database. More precisely,"
},
{
"name": null,
"type": "DatabaseAdmin",
"description": "for Astra DB an instance of `AstraDBDatabaseAdmin` is returned;"
},
{
"name": null,
"type": "DatabaseAdmin",
"description": "for other environments, an instance of `DataAPIDatabaseAdmin` is returned."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.admin.DatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin = my_db.get_database_admin()\n>>> if \"new_keyspace\" not in my_db_admin.list_keyspaces():\n... my_db_admin.create_keyspace(\"new_keyspace\")\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'new_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 DB, an AsyncDatabase comes with an "API Endpoint", which implies
an AsyncDatabase object instance reaches a specific region (relevant point in
case of multi-region databases).
|
{
"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\"",
"default": null,
"value": null
},
{
"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 subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"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 supplied\nwhen creating a Database, on Astra DB the name \"default_keyspace\" is set,\nwhile on other environments the keyspace is left unspecified: in this case,\nmost operations are unavailable until a keyspace is set (through an explicit\n`use_keyspace` invocation or equivalent).",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`. Removal 2.0.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a string representing the target Data API environment.\nIt can be left unspecified for the default value of `Environment.PROD`;\nother values include `Environment.OTHER`, `Environment.DSE`.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default (sensibly chosen based on the environment).",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> my_client = astrapy.DataAPIClient(\"AstraCS:...\")\n>>> my_db = my_client.get_async_database(\n... \"https://01234567-....apps.astra.datastax.com\"\n... )",
"references": [
"astrapy.client.DataAPIClient"
],
"note": "creating an instance of AsyncDatabase does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
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": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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 keyspace is supplied\nwhen creating a Database, the name \"default_keyspace\" is set.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": "a new `AsyncDatabase` instance."
}
],
"gathered_types": [
"astrapy.constants.CallerType",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db_2 = my_async_db.with_options(\n... keyspace=\"the_other_keyspace\",\n... callers=[(\"the_caller\", \"0.1.0\")],\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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.datastax.com\"",
"default": "None",
"value": "None"
},
{
"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 subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"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 supplied\nwhen creating a Database, the name \"default_keyspace\" is set.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which the Data API calls are performed. These end up\nin the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a string representing the target Data API environment.\nValues are, for example, `Environment.PROD`, `Environment.OTHER`,\nor `Environment.DSE`.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "the new copy, a `Database` instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.Database",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_sync_db = my_async_db.to_sync()\n>>> my_sync_db.list_collection_names()\n['a_collection', 'another_collection']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db.set_caller(caller_name=\"the_caller\", caller_version=\"0.1.0\")",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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_namespace` call).
|
{
"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
}
],
"returns": [
{
"name": null,
"type": "None",
"description": "None."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_async_db.list_collection_names())\n['coll_1', 'coll_2']\n>>> my_async_db.use_namespace(\"an_empty_namespace\")\n>>> asyncio.run(my_async_db.list_collection_names())\n[]",
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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
}
],
"returns": [
{
"name": null,
"type": "None",
"description": "None."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_async_db.list_collection_names())\n['coll_1', 'coll_2']\n>>> my_async_db.use_keyspace(\"an_empty_keyspace\")\n>>> asyncio.run(my_async_db.list_collection_names())\n[]",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db.info().region\n'eu-west-1'\n\n>>> my_async_db.info().raw_info['datacenters'][0]['dateCreated']\n'2023-01-30T12:34:56Z'",
"references": null,
"note": "see the DatabaseInfo documentation for a caveat about the difference\nbetween the `region` and the `raw_info[\"region\"]` attributes.",
"implemented_by": null,
"attributes": null
}
|
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-cdef-0123-456789abcdef'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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,
"bases": null,
"exports": null,
"example": ">>> my_async_db.name()\n'the_application_database'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": "namespace: str | None",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db.namespace\n'the_keyspace'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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": "keyspace: str | None",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_async_db.keyspace\n'the_keyspace'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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, it should have been created
previously by calling the `create_collection` method).
|
{
"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",
"type": "str | None",
"description": "the keyspace containing the collection. If no keyspace\nis specified, the setting for this database is used.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "embedding_api_key",
"type": "str | EmbeddingHeadersProvider | None",
"description": "optional API key(s) for interacting with the collection.\nIf an embedding service is configured, and this parameter is not None,\neach Data API call will include the necessary embedding-related headers\nas specified by this parameter. If a string is passed, it translates\ninto the one \"embedding api key\" header\n(i.e. `astrapy.authentication.EmbeddingAPIKeyHeaderProvider`).\nFor some vectorize providers/models, if using header-based\nauthentication, specialized subclasses of\n`astrapy.authentication.EmbeddingHeadersProvider` should be supplied.",
"default": "None",
"value": "None"
},
{
"name": "collection_max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration\nof each operation on the collection. Individual timeouts can be\nprovided to each collection method call and will take precedence, with\nthis value being an overall default.\nNote that for some methods involving multiple API calls (such as `find`,\n`delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncCollection",
"description": "an `AsyncCollection` instance, representing the desired collection\n(but without any form of validation)."
}
],
"gathered_types": [
"astrapy.authentication.EmbeddingHeadersProvider",
"astrapy.collection.AsyncCollection"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def count_docs(adb: AsyncDatabase, c_name: str) -> int:\n... async_col = await adb.get_collection(c_name)\n... return await async_col.count_documents({}, upper_bound=100)\n...\n>>> asyncio.run(count_docs(my_async_db, \"my_collection\"))\n45",
"references": null,
"note": "as this method, returning an AsyncCollection, albeit\nin a synchronous way. In other words, the following are equivalent:\n await my_async_db.get_collection(\"coll_name\")\n my_async_db.coll_name\n my_async_db[\"coll_name\"]",
"implemented_by": null,
"attributes": null
}
|
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",
"type": "str | None",
"description": "the keyspace where the collection is to be created.\nIf not specified, the general setting for this database is used.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "dimension",
"type": "int | None",
"description": "for vector collections, the dimension of the vectors\n(i.e. the number of their components).",
"default": "None",
"value": "None"
},
{
"name": "metric",
"type": "str | None",
"description": "the similarity metric used for vector searches.\nAllowed values are `VectorMetric.DOT_PRODUCT`, `VectorMetric.EUCLIDEAN`\nor `VectorMetric.COSINE` (default).",
"default": "None",
"value": "None"
},
{
"name": "service",
"type": "CollectionVectorServiceOptions | dict[str, Any] | None",
"description": "a dictionary describing a service for\nembedding computation, e.g. `{\"provider\": \"ab\", \"modelName\": \"xy\"}`.\nAlternatively, a CollectionVectorServiceOptions object to the same effect.",
"default": "None",
"value": "None"
},
{
"name": "indexing",
"type": "dict[str, Any] | None",
"description": "optional specification of the indexing options for\nthe collection, in the form of a dictionary such as\n {\"deny\": [...]}\nor\n {\"allow\": [...]}",
"default": "None",
"value": "None"
},
{
"name": "default_id_type",
"type": "str | None",
"description": "this sets what type of IDs the API server will\ngenerate when inserting documents that do not specify their\n`_id` field explicitly. Can be set to any of the values\n`DefaultIdType.UUID`, `DefaultIdType.OBJECTID`,\n`DefaultIdType.UUIDV6`, `DefaultIdType.UUIDV7`,\n`DefaultIdType.DEFAULT`.",
"default": "None",
"value": "None"
},
{
"name": "additional_options",
"type": "dict[str, Any] | None",
"description": "any further set of key-value pairs that will\nbe added to the \"options\" part of the payload when sending\nthe Data API command to create a collection.",
"default": "None",
"value": "None"
},
{
"name": "check_exists",
"type": "bool | None",
"description": "whether to run an existence check for the collection\nname before attempting to create the collection:\nIf check_exists is True, an error is raised when creating\nan existing collection.\nIf it is False, the creation is attempted. In this case, for\npreexisting collections, the command will succeed or fail\ndepending on whether the options match or not.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
},
{
"name": "embedding_api_key",
"type": "str | EmbeddingHeadersProvider | None",
"description": "optional API key(s) for interacting with the collection.\nIf an embedding service is configured, and this parameter is not None,\neach Data API call will include the necessary embedding-related headers\nas specified by this parameter. If a string is passed, it translates\ninto the one \"embedding api key\" header\n(i.e. `astrapy.authentication.EmbeddingAPIKeyHeaderProvider`).\nFor some vectorize providers/models, if using header-based authentication,\nspecialized subclasses of `astrapy.authentication.EmbeddingHeadersProvider`\nshould be supplied.",
"default": "None",
"value": "None"
},
{
"name": "collection_max_time_ms",
"type": "int | None",
"description": "a default timeout, in millisecond, for the duration of each\noperation on the collection. Individual timeouts can be provided to\neach collection method call and will take precedence, with this value\nbeing an overall default.\nNote that for some methods involving multiple API calls (such as\n`find`, `delete_many`, `insert_many` and so on), it is strongly suggested\nto provide a specific timeout as the default one likely wouldn't make\nmuch sense.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncCollection",
"description": "an `AsyncCollection` instance, representing the newly-created collection."
}
],
"gathered_types": [
"astrapy.authentication.EmbeddingHeadersProvider",
"astrapy.info.CollectionVectorServiceOptions",
"astrapy.collection.AsyncCollection"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def create_and_insert(adb: AsyncDatabase) -> Dict[str, Any]:\n... new_a_col = await adb.create_collection(\"my_v_col\", dimension=3)\n... return await new_a_col.insert_one(\n... {\"name\": \"the_row\", \"$vector\": [0.4, 0.5, 0.7]},\n... )\n...\n>>> asyncio.run(create_and_insert(my_async_db))\nInsertOneResult(raw_results=..., inserted_id='08f05ecf-...-...-...')",
"references": null,
"note": "A collection is considered a vector collection if at least one of\n`dimension` or `service` are provided and not null. In that case,\nand only in that case, is `metric` an accepted parameter.\nNote, moreover, that if passing both these parameters, then\nthe dimension must be compatible with the chosen service.",
"implemented_by": null,
"attributes": null
}
|
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": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "a dictionary in the form {\"ok\": 1} if the command succeeds."
}
],
"gathered_types": [
"astrapy.collection.AsyncCollection"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_async_db.list_collection_names())\n['a_collection', 'my_v_col', 'another_col']\n>>> asyncio.run(my_async_db.drop_collection(\"my_v_col\"))\n{'ok': 1}\n>>> asyncio.run(my_async_db.list_collection_names())\n['a_collection', 'another_col']",
"references": null,
"note": "when providing a collection name, it is assumed that the collection\nis to be found in the keyspace that was set at database instance level.",
"implemented_by": null,
"attributes": null
}
|
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.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncCommandCursor[CollectionDescriptor]",
"description": "an `AsyncCommandCursor` to iterate over CollectionDescriptor instances,"
},
{
"name": null,
"type": "AsyncCommandCursor[CollectionDescriptor]",
"description": "each corresponding to a collection."
}
],
"gathered_types": [
"astrapy.info.CollectionDescriptor",
"astrapy.cursors.AsyncCommandCursor"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def a_list_colls(adb: AsyncDatabase) -> None:\n... a_ccur = adb.list_collections()\n... print(\"* a_ccur:\", a_ccur)\n... print(\"* list:\", [coll async for coll in a_ccur])\n... async for coll in adb.list_collections():\n... print(\"* coll:\", coll)\n...\n>>> asyncio.run(a_list_colls(my_async_db))\n* a_ccur: <astrapy.cursors.AsyncCommandCursor object at ...>\n* list: [CollectionDescriptor(name='my_v_col', options=CollectionOptions())]\n* coll: CollectionDescriptor(name='my_v_col', options=CollectionOptions())",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 assumed.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "a list of the collection names as strings, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_async_db.list_collection_names())\n['a_collection', 'another_col']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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
},
{
"name": "keyspace",
"type": "str | None",
"description": "the keyspace to use. Requests always target a keyspace:\nif not specified, the general setting for this database is assumed.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "collection_name",
"type": "str | None",
"description": "if provided, the collection name is appended at the end\nof the endpoint. In this way, this method allows collection-level\narbitrary POST requests as well.",
"default": "None",
"value": "None"
},
{
"name": "raise_api_errors",
"type": "bool",
"description": "if True, responses with a nonempty 'errors' field\nresult in an astrapy exception being raised.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the underlying HTTP request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "a dictionary with the response of the HTTP request."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_async_db.command({\"findCollections\": {}}))\n{'status': {'collections': ['my_coll']}}\n>>> asyncio.run(my_async_db.command(\n... {\"countDocuments\": {}},\n... collection_name=\"my_coll\",\n... )\n{'status': {'count': 123}}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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 omitted (as it can generally be done),\nthe token of this Database is used.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.\nNote that this parameter is allowed only for Astra DB environments.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.\nNote that this parameter is allowed only for Astra DB environments.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DatabaseAdmin",
"description": "A DatabaseAdmin instance targeting this database. More precisely,"
},
{
"name": null,
"type": "DatabaseAdmin",
"description": "for Astra DB an instance of `AstraDBDatabaseAdmin` is returned;"
},
{
"name": null,
"type": "DatabaseAdmin",
"description": "for other environments, an instance of `DataAPIDatabaseAdmin` is returned."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.admin.DatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin = my_async_db.get_database_admin()\n>>> if \"new_keyspace\" not in my_db_admin.list_keyspaces():\n... my_db_admin.create_keyspace(\"new_keyspace\")\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'new_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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,
"API_RESPONSE": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": null,
"time": null,
"Iterable": null,
"__version__": "astrapy.__version__",
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": null,
"ThreadPoolExecutor": null,
"TracebackType": null,
"TYPE_CHECKING": "typing.TYPE_CHECKING",
"Sequence": "typing.Sequence",
"deprecation": "deprecation",
"APICommander": null,
"CollectionAPIOptions": null,
"coerce_embedding_headers_provider": null,
"CallerType": "astrapy.constants.CallerType",
"DocumentType": null,
"FilterType": null,
"ProjectionType": null,
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": null,
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": "astrapy.AsyncDatabase",
"Database": "astrapy.Database",
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": null,
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": null,
"SET_CALLER_DEPRECATION_NOTICE": "astrapy.defaults.SET_CALLER_DEPRECATION_NOTICE",
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": null,
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": null,
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": null,
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": "astrapy.meta.check_caller_parameters",
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": "astrapy.meta.check_namespace_keyspace",
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": null,
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": null,
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": null,
"partial": null,
"Callable": null,
"Iterator": null,
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": null,
"os": null,
"toml": null,
"astrapy": null,
"AstraDBAdmin": "astrapy.admin.AstraDBAdmin",
"AstraDBDatabaseAdmin": null,
"DataAPIDatabaseAdmin": null,
"DataAPIClient": null,
"AsyncCollection": null,
"Collection": null,
"field": null,
"TypeVar": null,
"EmbeddingAPIKeyHeaderProvider": null,
"ABC": null,
"abstractmethod": null,
"fetch_database_info": null,
"parse_api_endpoint": "astrapy.admin.parse_api_endpoint",
"coerce_token_provider": "astrapy.authentication.coerce_token_provider",
"redact_secret": "astrapy.authentication.redact_secret",
"Environment": "astrapy.constants.Environment",
"AsyncCommandCursor": null,
"CommandCursor": null,
"API_PATH_ENV_MAP": null,
"API_VERSION_ENV_MAP": null,
"DEFAULT_ASTRA_DB_KEYSPACE": null,
"CollectionAlreadyExistsException": null,
"DevOpsAPIException": null,
"CollectionDescriptor": null,
"CollectionVectorServiceOptions": null,
"DatabaseInfo": null,
"DatabaseAdmin": null,
"TokenProvider": "astrapy.authentication.TokenProvider",
"api_endpoint_parsing_error_message": "astrapy.admin.api_endpoint_parsing_error_message",
"build_api_endpoint": "astrapy.admin.build_api_endpoint",
"check_id_endpoint_parg_kwargs": "astrapy.admin.check_id_endpoint_parg_kwargs",
"generic_api_url_parsing_error_message": "astrapy.admin.generic_api_url_parsing_error_message",
"normalize_region_for_id": "astrapy.admin.normalize_region_for_id",
"parse_generic_api_url": "astrapy.admin.parse_generic_api_url",
"check_deprecated_id_region": "astrapy.meta.check_deprecated_id_region",
"hashlib": null,
"Enum": null,
"Generic": null,
"Optional": null,
"Tuple": null,
"CursorIsStartedException": null,
"DataAPITimeoutException": null,
"normalize_payload_value": null,
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": false,
"is_package": false,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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 working with data
- AstraDBAdmin objects can be created for admin-level work
|
{
"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 subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a string representing the target Data API environment.\nIt can be left unspecified for the default value of `Environment.PROD`;\nother values include `Environment.OTHER`, `Environment.DSE`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API and DevOps API calls are performed.\nThese end up in the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API and\nDevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> my_client = DataAPIClient(\"AstraCS:...\")\n>>> my_db0 = my_client.get_database(\n... \"https://01234567-....apps.astra.datastax.com\"\n... )\n>>> my_coll = my_db0.create_collection(\"movies\", dimension=2)\n>>> my_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.1, 0.3]})\n>>> my_db1 = my_client.get_database(\"01234567-...\")\n>>> my_db2 = my_client.get_database(\"01234567-...\", region=\"us-east1\")\n>>> my_adm0 = my_client.get_admin()\n>>> my_adm1 = my_client.get_admin(token=more_powerful_token_override)\n>>> database_list = my_adm0.list_databases()",
"references": [
"astrapy.client.DataAPIClient"
],
"note": null,
"implemented_by": null,
"attributes": null
}
|
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,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
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 string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API and DevOps API calls are performed.\nThese end up in the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API and\nDevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DataAPIClient",
"description": "a new DataAPIClient instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.client.DataAPIClient",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> another_client = my_client.with_options(\n... callers=[(\"caller_identity\", \"1.2.0\")],\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_client.set_caller(caller_name=\"the_caller\", caller_version=\"0.1.0\")",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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.",
"default": "None",
"value": "None"
},
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.\nActual admin work can be achieved by using the AstraDBAdmin object.",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of the client token.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "if provided, it is passed to the Database; otherwise\nthe Database class will apply an environment-specific default.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "id",
"type": "str | None",
"description": "the target database ID. This is alternative to using the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "the region to use for connecting to the database. The\ndatabase must be located in that region. This parameter can be used\nonly if the database is specified by its ID (instead of API Endpoint).\nIf this parameter is not passed, and cannot be inferred\nfrom the API endpoint, an additional DevOps API request is made\nto determine the default region and use it subsequently.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "a Database object with which to work on Data API collections."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db0 = my_client.get_database(\"01234567-...\")\n>>> my_db1 = my_client.get_database(\n... \"https://01234567-...us-west1.apps.astra.datastax.com\",\n... )\n>>> my_db2 = my_client.get_database(\"01234567-...\", token=\"AstraCS:...\")\n>>> my_db3 = my_client.get_database(\"01234567-...\", region=\"us-west1\")\n>>> my_coll = my_db0.create_collection(\"movies\", dimension=2)\n>>> my_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.3, 0.4]})",
"references": null,
"note": "This method does not perform any admin-level operation through\nthe DevOps API. For actual creation of a database, see the\n`create_database` method of class AstraDBAdmin.",
"implemented_by": null,
"attributes": null
}
|
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 is an error.",
"default": "None",
"value": "None"
},
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.\nActual admin work can be achieved by using the AstraDBAdmin object.",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of the client token.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "if provided, it is passed to the Database; otherwise\nthe Database class will apply an environment-specific default.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "id",
"type": "str | None",
"description": "the target database ID. This is alternative to using the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "the region to use for connecting to the database. The\ndatabase must be located in that region. This parameter can be used\nonly if the database is specified by its ID (instead of API Endpoint).\nIf this parameter is not passed, and cannot be inferred\nfrom the API endpoint, an additional DevOps API request is made\nto determine the default region and use it subsequently.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": "a Database object with which to work on Data API collections."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def create_use_db(cl: DataAPIClient, api_ep: str) -> None:\n... async_db = cl.get_async_database(api_ep)\n... my_a_coll = await async_db.create_collection(\"movies\", dimension=2)\n... await my_a_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.3, 0.4]})\n...\n>>> asyncio.run(\n... create_use_db(\n... my_client,\n... \"https://01234567-...us-west1.apps.astra.datastax.com\",\n... )\n... )",
"references": null,
"note": "This method does not perform any admin-level operation through\nthe DevOps API. For actual creation of a database, see the\n`create_database` method of class AstraDBAdmin.",
"implemented_by": null,
"attributes": null
}
|
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://DATABASE_ID-REGION.apps.astra.datastax.com\"",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of the client token.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "if provided, it is passed to the Database; otherwise\nthe Database class will apply an environment-specific default.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "a Database object with which to work on Data API collections."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db0 = my_client.get_database_by_api_endpoint(\"01234567-...\")\n>>> my_db1 = my_client.get_database_by_api_endpoint(\n... \"https://01234567-....apps.astra.datastax.com\",\n... token=\"AstraCS:...\",\n... )\n>>> my_db2 = my_client.get_database_by_api_endpoint(\n... \"https://01234567-....apps.astra.datastax.com\",\n... keyspace=\"the_other_keyspace\",\n... )\n>>> my_coll = my_db0.create_collection(\"movies\", dimension=2)\n>>> my_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.5, 0.6]})",
"references": null,
"note": "This method does not perform any admin-level operation through\nthe DevOps API. For actual creation of a database, see the\n`create_database` method of class AstraDBAdmin.",
"implemented_by": null,
"attributes": null
}
|
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 behavior and signature as the sync
counterpart `get_database_by_api_endpoint`: please see that one
for more details.
|
{
"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": "token",
"type": "str | TokenProvider | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "namespace",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "api_path",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "api_version",
"type": "str | None",
"description": null,
"default": "None",
"value": null
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": null
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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 to a more powerful,\nadmin-capable permission set.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBAdmin",
"description": "An AstraDBAdmin instance, wich which to perform management at the"
},
{
"name": null,
"type": "AstraDBAdmin",
"description": "database level."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.admin.AstraDBAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_adm0 = my_client.get_admin()\n>>> my_adm1 = my_client.get_admin(token=more_powerful_token_override)\n>>> database_list = my_adm0.list_databases()\n>>> my_db_admin = my_adm0.create_database(\n... \"the_other_database\",\n... cloud_provider=\"AWS\",\n... region=\"eu-west-1\",\n... )\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
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,
"API_RESPONSE": null,
"amake_request": null,
"make_request": null,
"TypedDict": null,
"APIRequestError": null,
"api_request": null,
"async_api_request": null,
"async_raw_api_request": null,
"raw_api_request": null,
"OPS_API_RESPONSE": null,
"DEFAULT_DEV_OPS_API_VERSION": null,
"DEFAULT_DEV_OPS_AUTH_HEADER": null,
"DEFAULT_DEV_OPS_URL": null,
"TimeoutInfoWideType": null,
"http_methods": null,
"to_httpx_timeout": null,
"Dict": null,
"List": null,
"Protocol": null,
"Union": null,
"datetime": null,
"json": "json",
"time": "time",
"Iterable": "typing.Iterable",
"__version__": null,
"DEFAULT_REDACTED_HEADERS": null,
"DEFAULT_TIMEOUT": null,
"UUID": null,
"ObjectId": null,
"uuid1": null,
"uuid3": null,
"uuid4": null,
"uuid5": null,
"uuid6": null,
"uuid7": null,
"uuid8": null,
"AstraDB": null,
"AstraDBCollection": null,
"AsyncAstraDB": null,
"AsyncAstraDBCollection": null,
"logger": null,
"AstraDBOps": null,
"asyncio": null,
"warnings": "warnings",
"ThreadPoolExecutor": null,
"TracebackType": null,
"TYPE_CHECKING": "typing.TYPE_CHECKING",
"Sequence": null,
"deprecation": "deprecation",
"APICommander": null,
"CollectionAPIOptions": null,
"coerce_embedding_headers_provider": null,
"CallerType": null,
"DocumentType": "astrapy.constants.DocumentType",
"FilterType": null,
"ProjectionType": "astrapy.constants.ProjectionType",
"ReturnDocument": null,
"SortType": null,
"VectorType": null,
"normalize_optional_projection": "astrapy.constants.normalize_optional_projection",
"AsyncCursor": null,
"Cursor": null,
"AsyncDatabase": null,
"Database": null,
"DEFAULT_BULK_WRITE_CONCURRENCY": null,
"DEFAULT_DATA_API_AUTH_HEADER": null,
"DEFAULT_INSERT_MANY_CHUNK_SIZE": null,
"DEFAULT_INSERT_MANY_CONCURRENCY": null,
"NAMESPACE_DEPRECATION_NOTICE_METHOD": null,
"SET_CALLER_DEPRECATION_NOTICE": null,
"BulkWriteException": null,
"CollectionNotFoundException": null,
"CumulativeOperationException": null,
"DataAPIFaultyResponseException": "astrapy.exceptions.DataAPIFaultyResponseException",
"DataAPIResponseException": null,
"DeleteManyException": null,
"InsertManyException": null,
"MultiCallTimeoutManager": null,
"TooManyDocumentsToCountException": null,
"UpdateManyException": null,
"base_timeout_info": null,
"CollectionInfo": null,
"CollectionOptions": null,
"check_caller_parameters": null,
"check_deprecated_vector_ize": null,
"check_namespace_keyspace": null,
"BulkWriteResult": null,
"DeleteResult": null,
"InsertManyResult": null,
"InsertOneResult": null,
"UpdateResult": null,
"EmbeddingHeadersProvider": null,
"AsyncBaseOperation": null,
"BaseOperation": null,
"dataclass": null,
"TimeoutInfo": null,
"OperationResult": null,
"DEFAULT_REDACTED_HEADER_NAMES": null,
"DEFAULT_REQUEST_TIMEOUT_MS": null,
"HEADER_REDACT_PLACEHOLDER": null,
"DataAPIHttpException": null,
"DevOpsAPIFaultyResponseException": null,
"DevOpsAPIHttpException": null,
"DevOpsAPIResponseException": null,
"to_dataapi_timeout_exception": null,
"to_devopsapi_timeout_exception": null,
"HttpMethod": null,
"log_httpx_request": null,
"log_httpx_response": null,
"normalize_for_api": null,
"restore_from_api": null,
"compose_full_user_agent": null,
"detect_astrapy_user_agent": null,
"DeprecatedWarning": null,
"CALLER_NAME_VERSION_DEPRECATION_NOTICE_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_NS_SUBJECT": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_DETAILS": null,
"NAMESPACE_DEPRECATION_NOTICE_UPDATEDBNS_SUBJECT": null,
"inspect": null,
"queue": null,
"threading": null,
"weakref": null,
"AsyncGenerator": null,
"AsyncIterator": "collections.abc.AsyncIterator",
"partial": null,
"Callable": "typing.Callable",
"Iterator": "typing.Iterator",
"API_DOC": null,
"AsyncPaginableRequestMethod": null,
"PaginableRequestMethod": null,
"DEFAULT_AUTH_HEADER": null,
"DEFAULT_INSERT_NUM_DOCUMENTS": null,
"DEFAULT_JSON_API_PATH": null,
"DEFAULT_JSON_API_VERSION": null,
"DEFAULT_KEYSPACE_NAME": null,
"convert_vector_to_floats": null,
"make_payload": null,
"importlib": null,
"os": null,
"toml": null,
"astrapy": null,
"AstraDBAdmin": null,
"AstraDBDatabaseAdmin": null,
"DataAPIDatabaseAdmin": null,
"DataAPIClient": null,
"AsyncCollection": "astrapy.collection.AsyncCollection",
"Collection": "astrapy.collection.Collection",
"field": null,
"TypeVar": "typing.TypeVar",
"EmbeddingAPIKeyHeaderProvider": null,
"ABC": null,
"abstractmethod": null,
"fetch_database_info": null,
"parse_api_endpoint": null,
"coerce_token_provider": null,
"redact_secret": null,
"Environment": null,
"AsyncCommandCursor": null,
"CommandCursor": null,
"API_PATH_ENV_MAP": null,
"API_VERSION_ENV_MAP": null,
"DEFAULT_ASTRA_DB_KEYSPACE": null,
"CollectionAlreadyExistsException": null,
"DevOpsAPIException": null,
"CollectionDescriptor": null,
"CollectionVectorServiceOptions": null,
"DatabaseInfo": null,
"DatabaseAdmin": null,
"TokenProvider": null,
"api_endpoint_parsing_error_message": null,
"build_api_endpoint": null,
"check_id_endpoint_parg_kwargs": null,
"generic_api_url_parsing_error_message": null,
"normalize_region_for_id": null,
"parse_generic_api_url": null,
"check_deprecated_id_region": null,
"hashlib": "hashlib",
"Enum": "enum.Enum",
"Generic": "typing.Generic",
"Optional": "typing.Optional",
"Tuple": "typing.Tuple",
"CursorIsStartedException": "astrapy.exceptions.CursorIsStartedException",
"DataAPITimeoutException": "astrapy.exceptions.DataAPITimeoutException",
"normalize_payload_value": "astrapy.transform_payload.normalize_payload_value",
"DATA_API_ENVIRONMENT_CASSANDRA": null,
"DATA_API_ENVIRONMENT_DEV": null,
"DATA_API_ENVIRONMENT_DSE": null,
"DATA_API_ENVIRONMENT_HCD": null,
"DATA_API_ENVIRONMENT_OTHER": null,
"DATA_API_ENVIRONMENT_PROD": null,
"DATA_API_ENVIRONMENT_TEST": null,
"reduce": null,
"re": null,
"API_ENDPOINT_TEMPLATE_ENV_MAP": null,
"DEFAULT_DEV_OPS_AUTH_PREFIX": null,
"DEV_OPS_DATABASE_POLL_INTERVAL_S": null,
"DEV_OPS_DATABASE_STATUS_ACTIVE": null,
"DEV_OPS_DATABASE_STATUS_INITIALIZING": null,
"DEV_OPS_DATABASE_STATUS_MAINTENANCE": null,
"DEV_OPS_DATABASE_STATUS_PENDING": null,
"DEV_OPS_DATABASE_STATUS_TERMINATING": null,
"DEV_OPS_DEFAULT_DATABASES_PAGE_SIZE": null,
"DEV_OPS_KEYSPACE_POLL_INTERVAL_S": null,
"DEV_OPS_RESPONSE_HTTP_ACCEPTED": null,
"DEV_OPS_RESPONSE_HTTP_CREATED": null,
"DEV_OPS_URL_ENV_MAP": null,
"DEV_OPS_VERSION_ENV_MAP": null,
"AdminDatabaseInfo": null,
"FindEmbeddingProvidersResult": null,
"check_update_db_namespace_keyspace": null,
"base64": null,
"EMBEDDING_HEADER_API_KEY": null,
"EMBEDDING_HEADER_AWS_ACCESS_ID": null,
"EMBEDDING_HEADER_AWS_SECRET_ID": null,
"SECRETS_REDACT_CHAR": null,
"SECRETS_REDACT_ENDING": null,
"SECRETS_REDACT_ENDING_LENGTH": null
},
"properties": {
"is_init_module": false,
"is_package": false,
"is_subpackage": false,
"is_namespace_package": false,
"is_namespace_subpackage": false
},
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": 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": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
End of preview. Expand
in Data Studio
AstraPy Documentation
This data file contains the AstraPy documentation in a specialized format for use
in the GraphRAG code_generation
example.
Generation
The file was generated using astrapy
version 1.5.2
via the convert
method in
graph_rag_example_helpers.examples.code_generation.converter
.
See the help on the method for more information about how to use it.
Structure
The JSONL file contains one JSON object per line, with the following structure:
id: the path to the object in the package
text: the description of the object (if any, can be empty)
metadata: Always includes `name`, `path`, `kind` keys. The remaining keys below are included when available.
name: the name of the object
path: the path to the object in the package
kind: either `module`, `class`, `function`, or `attribute`
parameters: the parameters for a class or function. Includes type information, default values, and descriptions
attributes: the attributes on a class or module. Includes type information and descriptions
gathered_types: list of non-standard types in the parameters and attributes
imports: list of non-standard types imported by the class or module
exports: list of non-standard types exported by the module
properties: list of boolean properties about the module
example: any code examples for the class, function, or module
references: list of any non-standard types used in the example code
returns: the return type and description
yields: the yield type and description
bases: list of base types inherited by the class
implemented_by: list of types that implement the a base class
- Downloads last month
- 11