tiled
0.1.0a89.post1+gfb2bc07

Tutorials

  • Installation
  • Navigate with the Python Client
  • Load Slices of Data
  • Keep a Local Copy
  • Deliberate Export
  • Log into an Authenticated Tiled Server
  • Serve a Directory of Files
  • Search
    • Search Using the Python Client
    • More Queries
  • Plot Data in Plotly Chart Studio

How To Guides

  • Use Performance and Debug Logging
  • Serve Data using Configuration Files
  • Serve Files with Custom Formats
  • Add Custom Export Formats
  • Use Profiles to streamline Python client setup
  • Create and Use API Keys
  • Custom Python Client Objects
  • Use Tiled in Python without an HTTP server
  • Tune Caches to Balance Speed and Memory Usage
  • Run Tiled using Docker
  • Set up a database for a scaled authenticated deloyment

Explanations

  • Standards Used by Tiled
  • Structures
  • Metadata, Specs, and References
  • Security
  • Compression
  • Case Study: Reading and Exporting a Specialized Format
  • Caching Design and Roadmap
  • Access Control
  • Scaling Tiled Down
  • FAQ
  • How Tiled Fits into the Ecosystem

Reference

  • Service-side Components
  • HTTP API
  • Python Client
  • Queries
  • Authentication Details
  • Scopes
  • Command-line tool
  • Service Configuration Reference
  • Client Profiles Reference
  • Release History
  • Minimum Version of Python and NumPy
tiled
  • Search
  • View page source

Search¶

In this tutorial we will find a dataset by performing a search over metadata.

To follow along, start the Tiled server with example data from a Terminal.

tiled serve pyobject --public tiled.examples.generated:tree

Search Using the Python Client¶

Now, in a Python interpreter, connect with the Python client.

from tiled.client import from_uri

client = from_uri("http://localhost:8000")

Tiled has an extensible collection of queries. The client just has to construct the query, and server sorts out how to execute it as efficiently as possible given however the metadata and data are stored.

This example collection of data has several entries with metadata.

>>> client['short_table'].metadata
DictView({'animal': 'dog', 'color': 'red'})

>>> client['long_table'].metadata
DictView({'animal': 'dog', 'color': 'green'})

>>> client['structured_data'].metadata
DictView({'animal': 'cat', 'color': 'green'})

# etc.

We’ll search among them for entries where the term "dog" appears anywhere in the metadata.

>>> from tiled.queries import FullText

>>> client.search(FullText("dog"))
<Node {'short_table', 'long_table'}>

The result has a subset of the contents of the original. Searches may be chained to progressively narrow results:

>>> client.search(FullText("dog")).search(FullText("red"))
<Node {'short_table'}>

If there no matches, the result is an empty Node:

>>> client.search(FullText("something that will not be found"))
<Node {}>

More Queries¶

Above, use the FullText query. Tiled supports many queries; see Queries.

Previous Next

© Copyright 2021, Bluesky Collaboration.

Built with Sphinx using a theme provided by Read the Docs.