arcticdb.version_store.library.Library

class arcticdb.version_store.library.Library(arctic_instance_description: str, nvs: NativeVersionStore)[source]

The main interface exposing read/write functionality within a given Arctic instance.

Arctic libraries contain named symbols which are the atomic unit of data storage within Arctic. Symbols contain data that in most cases resembles a DataFrame and are versioned such that all modifying operations can be tracked and reverted.

Instances of this class provide a number of primitives to write, modify and remove symbols, as well as also providing methods to manage library snapshots. For more information on snapshots please see the snapshot method.

Arctic libraries support concurrent writes and reads to multiple symbols as well as concurrent reads to a single symbol. However, concurrent writers to a single symbol are not supported other than for primitives that explicitly state support for single-symbol concurrent writes.

__init__(arctic_instance_description: str, nvs: NativeVersionStore)[source]
Parameters:
  • arctic_instance_description – Human readable description of the Arctic instance to which this library belongs. Used for informational purposes only.

  • nvs – The native version store that backs this library.

Methods

__init__(arctic_instance_description, nvs)

param arctic_instance_description:

Human readable description of the Arctic instance to which this library belongs. Used for informational

append(symbol, data[, metadata, ...])

Appends the given data to the existing, stored data.

defragment_symbol_data(symbol[, segment_size])

Compacts fragmented segments by merging row-sliced segments (https://docs.arcticdb.io/technical/on_disk_storage/#data-layer).

delete(symbol[, versions])

Delete all versions of the symbol from the library, unless version is specified, in which case only those versions are deleted.

delete_data_in_range(symbol, date_range)

Delete data within the given date range, creating a new version of symbol.

delete_snapshot(snapshot_name)

Delete a named snapshot.

finalize_staged_data(symbol[, mode])

Finalises staged data, making it available for reads.

get_description(symbol[, as_of])

Returns descriptive data for symbol.

get_description_batch(symbols)

Returns descriptive data for a list of symbols.

get_staged_symbols()

Returns all symbols with staged, unfinalized data.

has_symbol(symbol[, as_of])

Whether this library contains the given symbol.

head(symbol[, n, as_of, columns])

Read the first n rows of data for the named symbol.

is_symbol_fragmented(symbol[, segment_size])

Check whether the number of segments that would be reduced by compaction is more than or equal to the value specified by the configuration option "SymbolDataCompact.SegmentCount" (defaults to 100).

list_snapshots()

List the snapshots in the library.

list_symbols([snapshot_name])

Return the symbols in this library.

list_versions([symbol, snapshot, ...])

Get the versions in this library, filtered by the passed in parameters.

prune_previous_versions(symbol)

Removes all (non-snapshotted) versions from the database for the given symbol, except the latest.

read(symbol[, as_of, date_range, columns, ...])

Read data for the named symbol.

read_batch(symbols[, query_builder])

Reads multiple symbols.

read_metadata(symbol[, as_of])

Return the metadata saved for a symbol.

read_metadata_batch(symbols)

Reads the metadata of multiple symbols.

reload_symbol_list()

Forces the symbol list cache to be reloaded

snapshot(snapshot_name[, metadata, ...])

Creates a named snapshot of the data within a library.

sort_and_finalize_staged_data(symbol[, mode])

sort_merge will sort and finalize staged data.

tail(symbol[, n, as_of, columns])

Read the last n rows of data for the named symbol.

update(symbol, data[, metadata, upsert, ...])

Overwrites existing symbol data with the contents of data.

write(symbol, data[, metadata, ...])

Write data to the specified symbol.

write_batch(payloads[, ...])

Write a batch of multiple symbols.

write_batch_pickle(payloads[, ...])

Write a batch of multiple symbols, pickling their data if necessary.

write_metadata(symbol, metadata)

Write metadata under the specified symbol name to this library.

write_pickle(symbol, data[, metadata, ...])

See write.

Attributes

name

The name of this library.