arcticdb.Arctic

class arcticdb.Arctic(uri: str, encoding_version: EncodingVersion = EncodingVersion.V1)[source]

Top-level library management class. Arctic instances can be configured against an S3 environment and enable the creation, deletion and retrieval of Arctic libraries.

__init__(uri: str, encoding_version: EncodingVersion = EncodingVersion.V1)[source]

Initializes a top-level Arctic library management instance.

For more information on how to use Arctic Library instances please see the documentation on Library.

Parameters:

uri

URI specifying the backing store used to access, configure, and create Arctic libraries.

The S3 URI connection scheme has the form s3(s)://<s3 end point>:<s3 bucket>[?options].

Use s3s as the protocol if communicating with a secure endpoint.

Options is a query string that specifies connection specific options as <name>=<value> pairs joined with &.

Available options for S3:

Option

Description

port

port to use for S3 connection

region

S3 region

use_virtual_addressing

Whether to use virtual addressing to access the S3 bucket

access

S3 access key

secret

S3 secret access key

path_prefix

Path within S3 bucket to use for data storage

aws_auth

If true, authentication to endpoint will be computed via AWS environment vars/config files. If no options are provided aws_auth will be assumed to be true.

force_uri_lib_config

Override the credentials and endpoint of an S3 storage with the URI of the Arctic object. Use if accessing a replicated (to different region/bucket) library.

Note: When connecting to AWS, region can be automatically deduced from the endpoint if the given endpoint specifies the region and region is not set.

The Azure URI connection scheme has the form azure://[options]. It is based on the Azure Connection String, with additional options for configuring ArcticDB. Please refer to https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string for more details.

options is a string that specifies connection specific options as <name>=<value> pairs joined with ; (the final key value pair should not include a trailing ;).

Additional options specific for ArcticDB:

Option

Description

Container

Azure container for blobs

Path_prefix

Path within Azure container to use for data storage

CA_cert_path

Azure CA certificate path. If not set, default path will be used. Note: For Linux distribution, default path is set to /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem. If the certificate cannot be found in the provided path, an Azure exception with no meaningful error code will be thrown. For more details, please see https://github.com/Azure/azure-sdk-for-cpp/issues/4738. For example, Failed to iterate azure blobs 'C' 0:.

Default certificate path in various Linux distributions: “/etc/ssl/certs/ca-certificates.crt” Debian/Ubuntu/Gentoo etc. “/etc/pki/tls/certs/ca-bundle.crt” Fedora/RHEL 6 “/etc/ssl/ca-bundle.pem” OpenSUSE “/etc/pki/tls/cacert.pem” OpenELEC “/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem” CentOS/RHEL 7 “/etc/ssl/cert.pem” Alpine Linux

Note: Support for Azure Blob Storage is currently only available in non-Conda binaries distribution.

Exception: Azure exceptions message always ends with {AZURE_SDK_HTTP_STATUS_CODE}:{AZURE_SDK_REASON_PHRASE}.

Please refer to https://github.com/Azure/azure-sdk-for-cpp/blob/24ed290815d8f9dbcd758a60fdc5b6b9205f74e0/sdk/core/azure-core/inc/azure/core/http/http_status_code.hpp for more details of provided status codes.

Note that due to a bug in Azure C++ SDK (https://github.com/Azure/azure-sdk-for-cpp/issues/4738), Azure may not give meaningful status codes and reason phrases in the exception. To debug these instances, please set the environment variable export AZURE_LOG_LEVEL to 1 to turn on the SDK debug logging.

Examples

>>> ac = Arctic('s3://MY_ENDPOINT:MY_BUCKET')  # Leave AWS to derive credential information
>>> ac = Arctic('s3://MY_ENDPOINT:MY_BUCKET?region=YOUR_REGION&access=ABCD&secret=DCBA') # Manually specify creds
>>> ac = Arctic('azure://CA_cert_path=/etc/ssl/certs/ca-certificates.crt;BlobEndpoint=https://arctic.blob.core.windows.net;Container=acblob;SharedAccessSignature=sp=sig')
>>> ac.create_library('travel_data')
>>> ac.list_libraries()
['travel_data']
>>> travel_library = ac['travel_data']
>>> ac.delete_library('travel_data')

Methods

__init__(uri[, encoding_version])

Initializes a top-level Arctic library management instance.

create_library(name[, library_options])

Creates the library named name.

delete_library(name)

Removes the library called name.

get_library(library)

Returns the library named library.

get_uri()

Returns the URI that was used to create the Arctic instance.

list_libraries()

Lists all libraries available.