pyorderly.outpack.search

Classes

Query

QueryEnv

QueryIndex

Functions

as_query(→ Query)

search(→ set[str])

Search an outpack repository for all packets that match the given query.

search_unique(query, *, root[, options, this])

Search an outpack repository for a packet that matches the given query.

eval_test_value(→ Optional[Union[bool, int, float, str]])

eval_latest(→ set[str])

eval_single(→ set[str])

eval_test_one(→ bool)

eval_test(→ set[str])

eval_boolean(→ set[str])

eval_negation(→ set[str])

eval_query(→ set[str])

Module Contents

class pyorderly.outpack.search.Query
text: str
node: Any
__str__()
classmethod parse(text)
is_single_valued()

Return true if the query is guaranteed to produce at most a single result.

This could be either an expression wrapped in a single(…) or latest(…) call, or it is an ID lookup of the form id == ….

class pyorderly.outpack.search.QueryEnv(root: pyorderly.outpack.root.OutpackRoot, options: pyorderly.outpack.search_options.SearchOptions, this: pyorderly.outpack.metadata.Parameters | None)
index
this
class pyorderly.outpack.search.QueryIndex(root, options)
root: pyorderly.outpack.root.OutpackRoot
index: dict[str, pyorderly.outpack.metadata.MetadataCore]
options: pyorderly.outpack.search_options.SearchOptions
pyorderly.outpack.search.as_query(query: Query | str) Query
pyorderly.outpack.search.search(query: Query | str, *, root: pyorderly.outpack.root.OutpackRoot | str | os.PathLike, options: pyorderly.outpack.search_options.SearchOptions | None = None, this: pyorderly.outpack.metadata.Parameters | None = None) set[str]

Search an outpack repository for all packets that match the given query.

This may return zero or more packet IDs.

pyorderly.outpack.search.search_unique(query: Query | str, *, root: pyorderly.outpack.root.OutpackRoot | str | os.PathLike, options: pyorderly.outpack.search_options.SearchOptions | None = None, this: pyorderly.outpack.metadata.Parameters | None = None)

Search an outpack repository for a packet that matches the given query.

Returns a single packet ID. Throws an exception if no packet is found or if the query is not syntactically guaranteed to find at most one.

pyorderly.outpack.search.eval_test_value(node, env: QueryEnv, metadata: pyorderly.outpack.metadata.MetadataCore) bool | int | float | str | None
pyorderly.outpack.search.eval_latest(node: outpack_query_parser.Latest, env: QueryEnv) set[str]
pyorderly.outpack.search.eval_single(node: outpack_query_parser.Single, env: QueryEnv) set[str]
pyorderly.outpack.search.eval_test_one(node: outpack_query_parser.Test, env: QueryEnv, metadata: pyorderly.outpack.metadata.MetadataCore) bool
pyorderly.outpack.search.eval_test(node: outpack_query_parser.Test, env: QueryEnv) set[str]
pyorderly.outpack.search.eval_boolean(node: outpack_query_parser.BooleanExpr, env: QueryEnv) set[str]
pyorderly.outpack.search.eval_negation(node: outpack_query_parser.Negation, env: QueryEnv) set[str]
pyorderly.outpack.search.eval_query(node, env: QueryEnv) set[str]