GeoEco.Datasets.Collections.DirectoryTree.GetNewestDataset
- DirectoryTree.GetNewestDataset(expression=None, **options)
Queries the collection and returns the newest
Datasetthat matches the search expression.Requires: Python pyparsing module.
- Parameters:
expression (
str, optional) –A SQL-like query expression that selects the datasets of interest based on the values of their queryable attributes. If not provided, all of the datasets in the collection will be selected.
The expression is similar to a SQL “where” clause and may contain the following elements:
The names of any queryable attributes, with no delimiters, that are defined for objects in the collection, including those they inherit from their parents.
The binary comparison operators
=,<,>,<=,>=, and<>.Literals for integers, floating point numbers (with
.as the decimal point), Booleans (writtentrueandfalse), strings (delimited with single or double quotation marks), or dates (written#YYYY-mm-dd HH:MM:SS#or#YYYY-mm-dd#withYYYYas the four-digit year,mmas the two-digit month,ddas the two-digit day,HHas the two-digit hour00to23,MMas the two-digit second, andSSas the two-digit second, with the hour, minute, and second assumed to be00:00:00if not provided).The binary comparison operator
inornot infollowed by a comma-delimited list of literals, enclosed in(and).The binary comparison operator
matchesfollowed by a string literal that specifies a regular expression in Python syntax.The binary arithmetic operators
+,-,*, and/, which may be applied to queryable attributes and numeric literals.The unary arithmetic operator
-, which may be used to negate a queryable attribute or numeric literal.The binary logical operators
orandandand unary logical operatornot.nothas highest precedence;orhas lowest. Logical expressions may be chained together but not nested (in parentheses or by any other means).
Operators and queryable attribute names are case-insensitive. Minimum length꞉ 1.
options (
dictmappingstrtoobject) – Additional options specific to the collection type.
- Returns:
The newest
Datasetthat matches the search expression, orNoneif nothing matches or the collection is empty.- Return type: