Python Client
Constructors
These are functions for constructing a client object.
|
Connect to a Node on a local or remote server. |
|
Build a Node based a 'profile' (a named configuration). |
Client Container
The Container interface extends the collections.abc.Mapping
(i.e. read-only
dict) interface, so it supports these standard “magic methods”:
__getitem__
(lookup by key with[]
)__iter__
(iteration, use in for-loops for example)__len__
(has a length, can be passed tolen
)
as well as:
The views returned by .keys()
, .items()
, and .values()
support efficient random access—e.g.
c.values()[3]
c.values()[-1]
c.values()[:3]
and several convenience methods:
Get the first value. |
|
Get the last value. |
|
Get the first N values. |
|
Get the last N values. |
Likewise for .keys()
and .items()
.
Beyond the Mapping interface, Container adds the following attributes
Metadata about this data source. |
|
The current sorting of this Node |
|
Direct link to this entry |
|
List of specifications describing the structure of the metadata and/or data. |
It adds these methods, which return a new Container instance.
Make a Node with a subset of this Node's entries, filtered by query. |
|
|
Make a Node with the same entries but sorted according to sorting. |
It adds this method, which returns the unique metadata keys, structure_families, and specs of its children along with their counts.
Get the unique values and optionally counts of metadata_keys, structure_families, and specs in this Node's entries |
And, finally, there are convenience methods for writing:
EXPERIMENTAL: Create a new, empty container. |
|
EXPERIMENTAL: Write an array. |
|
Write an AwkwardArray. |
|
EXPERIMENTAL: Write a DataFrame. |
|
EXPERIMENTAL: Write a sparse array. |
and a low-level method for creating a new node to write into:
|
Create a new item within this Node. |
Structure Clients
For each structure family (“array”, “table”, etc.) there is a client object that understand how to request and decode chunks/partitions of data for this structure.
In fact, there can be more than one client for a given structure family. Tiled currently includes two clients for each structure family:
A client that reads the data into dask-backed objects (dask array, dask DataFrame, xarray objects backed by dask arrays)
A client that reads the data into in-memory structures (numpy array, pandas DataFrame, xarray objects backed by numpy arrays)
Base
|
|
List formats that the server can export this data as. |
|
Metadata about this data source. |
|
Generate a mutable copy of metadata and specs for validating metadata (useful with update_metadata()) |
|
EXPERIMENTAL: Replace metadata entirely (see update_metadata). |
|
EXPERIMENTAL: Update metadata via a dict.update- like interface. |
|
EXPERIMENTAL: Patch metadata using a JSON Patch (RFC6902). |
|
Build valid JSON Patches (RFC6902) for metadata and metadata validation specs accepted by patch_metadata. |
|
Direct link to this entry |
|
Quick access to this entry |
|
JSON payload describing this item. |
|
Depending on the server's authentication method, this will prompt for username/password: |
|
Log out. |
|
This is intended primarily for internal use and use by subclasses. |
|
List of specifications describing the structure of the metadata and/or data. |
|
Return a dataclass describing the structure of the data. |
Array
|
Client-side wrapper around an array-like that returns dask arrays |
Access the data for one block of this chunked (dask) array. |
|
Access the entire array or a slice. |
|
Download data in some format and write to a file. |
|
|
Client-side wrapper around an array-like that returns in-memory arrays |
Access the data for one block of this chunked array. |
|
|
Acess the entire array or a slice. |
|
Download data in some format and write to a file. |
Awkward
|
|
Download data in some format and write to a file. |
|
Client-side wrapper around an array-like that returns in-memory arrays |
Access the data for one block of this chunked array. |
|
|
Acess the entire array or a slice. |
Download data in some format and write to a file. |
Sparse Array
|
|
Download data in some format and write to a file. |
|
DataFrame
Client-side wrapper around an dataframe-like that returns dask dataframes |
|
|
Access one partition in a partitioned (dask) dataframe. |
Access the entire DataFrame. |
|
Download data in some format and write to a file. |
|
|
Client-side wrapper around a dataframe-like that returns in-memory dataframes |
|
Access one partition of the DataFrame. |
|
Access the entire DataFrame. |
|
Download data in some format and write to a file. |
|
Xarray Dataset
|
|
|
|
Context
|
Wrap an httpx.Client with an optional cache and authentication functionality. |
Accept a URI to a specific node. |
|
Construct a Context around a FastAPI app. |
|
See login. |
|
Execute refresh flow. |
|
Depending on the server's authentication method, this will prompt for username/password: |
|
Log out of the current session (if any). |
|
A view of the current access and refresh tokens. |
Cache
|
|
Max capacity in bytes. |
|
Drop all entries from HTTP response cache. |
|
Close cache. |
|
Number of responses cached |
|
|
Delete an entry from cache. |
Filepath of SQLite database storing cache data |
|
|
Get cached response from Cache. |
Max size of a response body eligible for caching. |
|
If True, cache be read but not updated. |
|
|
Set new response entry in cache. |
Size of response bodies in bytes (does not count headers and other auxiliary info) |
|
Check that it is safe to write. |
Sync
|
Copy data from one Tiled instance to another. |