Service-side Components

Adapters

Python Object Adapters

These Adapters don’t do any I/O, but instead wrap a structure in memory or its dask counterpart.

tiled.adapters.mapping.MapAdapter(mapping[, ...])

Adapt any mapping (dictionary-like object) to Tiled.

tiled.adapters.array.ArrayAdapter(data, *[, ...])

Wrap an array-like object in an interface that Tiled can serve.

tiled.adapters.dataframe.DataFrameAdapter(ddf)

Wrap a dataframe-like object in an interface that Tiled can serve.

tiled.adapters.xarray.VariableAdapter(variable)

Wrap an xarray.Variable

tiled.adapters.xarray.DataArrayAdapter(...)

Wrap an xarray.DataArray

tiled.adapters.xarray.DatasetAdapter(dataset)

Wrap an xarray.Dataset

File and Directory Adapters

tiled.adapters.files.DirectoryAdapter(...[, ...])

An Adapter constructed by walking a directory and watching it for changes.

tiled.adapters.dataframe.DataFrameAdapter.read_csv(*args)

Read a CSV.

tiled.adapters.tiff.TiffAdapter(path)

Read a TIFF file.

tiled.adapters.excel.ExcelAdapter(mapping[, ...])

Read the sheets in an Excel file.

tiled.adapters.hdf5.HDF5Adapter(node[, ...])

Read an HDF5 file or a group within one.

Search Queries

Built-in Search Query Types

These are simple, JSON-serializable dataclasses that define the data in a query. They do not defined how to execute a query on a given Tree.

Note

The list of built-in queries is short. Most of the power of queries comes from registering custom queries that fit your use case and can make specific assumption about your metadata / data and its meaning.

tiled.queries.FullText(text[, case_sensitive])

Search the full text of all metadata values for word matches.

tiled.queries.KeyLookup(key)

Match a specific Entry by key.

Custom Search Query Registration

tiled.query_registration.QueryRegistry()

Keep track of all known queries types, with names.

tiled.query_registration.register([name, ...])

Register a new type of query.

Media Type (Format) Registry

This is a registry of formats that the service can write upon a client’s request.

When registering new types, make reference to the IANA Media Types (formerly known as MIME types).

tiled.media_type_registration.serialization_registry

Global serialization registry.

tiled.media_type_registration.SerializationRegistry()

Registry of media types for each structure family

tiled.media_type_registration.SerializationRegistry.register(...)

Register a new media_type for a structure family.

tiled.media_type_registration.SerializationRegistry.media_types(...)

List the supported media types for a given structure family.

tiled.media_type_registration.SerializationRegistry.aliases(...)

List the aliases (file extensions) for each media type for a given structure family.

Structures

For each data structure supported by tiled, there are dataclasses that encode its structure. These are very lightweight objects; they are used to inexpensively construct and a communicate a representation of the data’s shape and chunk/partition structure to the client so that it can formulate requests for slices of data and decode the responses.

See Structures for more context.

Array

tiled.structures.array.ArrayStructure(macro, ...)

tiled.structures.array.ArrayMacroStructure(...)

tiled.structures.array.BuiltinDtype(...)

tiled.structures.array.Kind(value)

See https://numpy.org/devdocs/reference/arrays.interface.html#object.__array_interface__

tiled.structures.array.Endianness(value)

An enum of endian values: big, little, not_applicable.

DataFrame

tiled.structures.dataframe.DataFrameStructure(...)

tiled.structures.dataframe.DataFrameMacroStructure(...)

tiled.structures.dataframe.DataFrameMicroStructure(...)

Xarray Structures

Xarrays are “meta” structures that contain chunks of arrays. For this reason, they have no microstructure. Their macrostructure encompasses nested array structures.

DataArray

tiled.structures.xarray.DataArrayStructure(...)

tiled.structures.xarray.DataArrayMacroStructure(...)

Dataset

tiled.structures.xarray.DatasetStructure(...)

tiled.structures.xarray.DatasetMacroStructure(...)

Configuration Parsing

tiled.config.parse_configs(config_path)

Parse configuration file or directory of configuration files.

tiled.config.direct_access(config[, ...])

Return the server-side Adapter object defined by a configuration.

tiled.config.direct_access_from_profile(name)

Return the server-side Adapter object from a profile.

tiled.config.construct_build_app_kwargs(...)

Given parsed configuration, construct arguments for build_app(...).

HTTP Server Application

tiled.server.app.build_app(tree[, ...])

Serve a Tree

Object Cache

The “object” cache is available to all Adapters to cache any objects, including serializable objects like array chunks and unserializable objects like file handles. It is a process-global singleton.

Implementation detail: It is backed by Cachey.

Adapters that use the cache must use a tuple of strings and/or numbers as a cache key and should use a cache key of the form (class.__module__, class.__qualname__, ...) to avoid collisions with other Adapters. See tiled.adapters.tiff for a generic example and see tiled.adapters.dataframe for an example that uses integration with dask.

tiled.server.object_cache.get_object_cache()

Set the process-global icache.

tiled.server.object_cache.set_object_cache(cache)

Set the process-global icache.

tiled.server.object_cache.ObjectCache(...)

tiled.server.object_cache.ObjectCache.available_bytes

Maximum size in bytes

tiled.server.object_cache.ObjectCache.get(key)

Get cache item.

tiled.server.object_cache.ObjectCache.put(...)

Put cache item.

tiled.server.object_cache.ObjectCache.discard(*keys)

Discard one or more items from the cache if present.

tiled.server.object_cache.ObjectCache.clear()

Empty the cache.

tiled.server.object_cache.ObjectCache.dask_context

Within this context, get and store dask tasks with the object cache.

tiled.server.object_cache.ObjectCache.discard_dask(*keys)

Discard one or more dask tasks from the cache, if present.