bvbrc.fld#

bvbrc.fld(field_name: str) Field#

Create an RQL field object for use in query expressions.

This function creates a field reference that can be used to build RQL expressions with comparison operators and other query predicates.

Parameters#

field_namestr

The name of the database field to reference. This should correspond to a valid field name in the target BV-BRC data collection.

Returns#

RQL.Field

A field object that can be used with comparison operators (==, !=, >, <, etc.) and other RQL operations.

Examples#

Create field references for comparisons:

>>> import bvbrc as bv
>>> genome_length_field = bv.fld("genome_length")
>>> large_genomes = genome_length_field > 1000000 # Creates an RQLExpr

Use in query building:

>>> q = bv.query(
...     bv.fld("species") == "Escherichia coli",
...     bv.fld("genome_status") == "Complete"
... )

Each client object also contains the its corresponding fields as attributes:

>>> genome_client = bv.GenomeClient()
>>> q = bv.query(
...     genome_client.species == "Escherichia coli",
...     genome_client.genome_status == "Complete"
... )