Package: tiled
TiledTiled is adata accessservice for data-aware portals and data science tools.
Tiled has a Python client and integrates naturally with Python data science
libraries, but nothing about the service is Python-specific; it also works from
a web browser or any Internet-connected program.Tiled’s service can sit atop databases, filesystems, and/or remote
services to enablesearchandstructured, chunkwise access to datain an
extensible variety of appropriate formats, providing data in a consistent
structure regardless of the format the data happens to be stored in at rest. The
natively-supported formats span slow but widespread interchange formats (e.g.
CSV, JSON) and fast, efficient ones (e.g. C buffers, Apache Arrow and Parquet).
Tiled enables slicing and sub-selection to read and transfer only the data of
interest, and it enables parallelized download of many chunks at once. Users can
access data with very light software dependencies and fast partial downloads.Tiled puts an emphasis onstructuresrather than formats, including:N-dimensional strided arrays (i.e. numpy-like arrays)Sparse arraysTabular data (e.g. pandas-like "dataframes")Nested, variable-sized data (as implemented byAwkwardArray)Hierarchical structures thereof (e.g. xarrays, HDF5-compatible structures like NeXus)Tiled implements extensibleaccess control enforcementbased on web security
standards, similar to JuptyerHub. Like Jupyter, Tiled can be used by a single
user or deployed as a shared public or private resource. Tiled can be configured
to use third party services for login, such as Google, ORCID. or any OIDC
or SAML authentication providers.Tiled facilitatesclient-side cachingin a standard web browser or in
Tiled's Python client, making efficient use of bandwidth. It usesservice-side cachingof "hot" datasets and resources to expedite both
repeat requests (e.g. when several users are requesting the same chunks of
data) and distinct requests for different parts of the same dataset (e.g. when
the user is requesting various slices or columns from a dataset).DistributionWhere to get itPyPIpip install tiledCondaconda install -c conda-forge tiled-client tiled-serverSource codegithub.com/bluesky/tiledDocumentationblueskyproject.io/tiledExampleIn this example, we'll serve of a collection of data that is generated in
memory.  Alternatively, it could be read on demand from a directory of files,
network resource, database, or some combination of these.tiled serve demo
# equivalent to:
# tiled serve pyobject --public tiled.examples.generated:treeAnd then access the data efficiently via the Python client, a web browser, or
any HTTP client.>>>fromtiled.clientimportfrom_uri>>>client=from_uri("http://localhost:8000")>>>client<Container{'short_table','long_table','structured_data',...}~10entries>>>>list(client)'big_image','small_image','tiny_image','tiny_cube','tiny_hypercube','low_entropy','high_entropy','short_table','long_table','labeled_data','structured_data']>>>client['medium_image']<ArrayClient>>>>client['medium_image'][:]array([[0.49675483,0.37832119,0.59431287,...,0.16990737,0.5396537,0.61913812],[0.97062498,0.93776709,0.81797714,...,0.96508877,0.25208564,0.72982507],[0.87173234,0.83127946,0.91758202,...,0.50487542,0.03052536,0.9625512],...,[0.01884645,0.33107071,0.60018523,...,0.02268164,0.46955907,0.37842628],[0.03405101,0.77886243,0.14856727,...,0.02484926,0.03850398,0.39086524],[0.16567224,0.1347261,0.48809697,...,0.55021249,0.42324589,0.31440635]])>>>client['long_table']<DataFrameClient['A','B','C']>>>>client['long_table'].read()ABCindex00.2469200.4938400.74075910.3260050.6520090.97801420.7154181.4308372.14625530.4251470.8502941.27544140.7810361.5620732.343109............999950.5152481.0304951.545743999960.6391881.2783761.917564999970.2698510.5397020.809553999980.5668481.1336951.700543999990.1014460.2028920.304338[100000rowsx3columns]>>>client['long_table'].read(['A','B'])ABindex00.2469200.49384010.3260050.65200920.7154181.43083730.4251470.85029440.7810361.562073.........999950.5152481.030495999960.6391881.278376999970.2698510.539702999980.5668481.133695999990.1014460.202892Using an Internet browser or a command-line HTTP client likecurlorhttpieyou can download the
data in whole or in efficiently-chunked parts in the format of your choice:# Download tabular data as CSV
http://localhost:8000/api/v1/table/full/long_table?format=csv

# or XLSX (Excel)
http://localhost:8000/api/v1/table/full/long_table?format=xslx

# and subselect columns.
http://localhost:8000/api/v1/table/full/long_table?format=xslx&field=A&field=B

# View or download (2D) array data as PNG
http://localhost:8000/api/v1/array/full/medium_image?format=png

# and slice regions of interest.
http://localhost:8000/api/v1/array/full/medium_image?format=png&slice=:50,100:200Web-based data access usually involves downloading complete files, in the
manner ofGlobus; or using modern chunk-based
storage formats, such asTileDBandZarrin local or cloud storage; or
using custom solutions tailored to a particular large dataset. Waiting for an
entire file to download when only the first frame of an image stack or a
certain column of a table are of interest is wasteful and can be prohibitive
for large longitudinal analyses. Yet, it is not always practical to transcode
the data into a chunk-friendly format or build a custom tile-based-access
solution. (Though if you can do either of those things, you should consider
them instead!)