Skip to content

Python API

Signatures and descriptions below are generated from Python source at build time. This reference covers the public workflow and the objects it returns; internal transports and provider implementation helpers are intentionally omitted. Every public function that takes a filesystem path accepts a str or any os.PathLike[str] and coerces it once on entry, so a path usdata inspect printed can be pasted straight back in. See fetch and analyze for complete workflows.

Discovery and queries

usdata.datasets

datasets(*, provider: str | None = None, domain: str | None = None, format: str | None = None, reader: str | None = None, capability: str | None = None, status: str = 'available') -> list[Dataset]

List curated registry datasets. Keyword arguments match Registry.list.

usdata.search

search(text: str | None = None, *, include_planned: bool = False, domain: str | None = None, format: str | None = None, reader: str | None = None, capability: str | None = None, status: str | None = None, **kwargs: Any) -> list[SearchResult]

Search the curated registry. Remaining keyword arguments match build_query.

usdata.get

get(dataset_id: str) -> Dataset

Look up a dataset by provider:name id.

usdata.build_query

build_query(text: str | None = None, *, provider: str | None = None, location: str | None = None, bbox: BBox | tuple[float, float, float, float] | None = None, lat: float | None = None, lon: float | None = None, radius_km: float = 50.0, start: str | date | datetime | None = None, end: str | date | datetime | None = None, variables: list[str] | None = None, **params: Any) -> Query

Normalize user-facing arguments into a Query.

Exactly one of location, bbox, or lat/lon may set the spatial filter. A location sets both the query's bbox and its place, the state or county it named; a bbox or a lat/lon names no place.

usdata.Registry

An in-memory collection of datasets addressable by id and searchable by keyword.

bundled classmethod

bundled() -> Registry

The registry shipped inside the package.

from_yaml classmethod

from_yaml(path: str | PathLike[str]) -> Registry

Load from YAML with providers, domains, systems, and datasets.

list

list(*, provider: str | None = None, domain: str | None = None, format: str | None = None, reader: str | None = None, capability: str | None = None, status: str = 'available') -> list[Dataset]

Datasets matching every filter given, in registry order.

provider and domain match an id exactly. format matches case-insensitively anywhere in a declared format, so csv also finds gzip CSV. reader names the extra that opens the files, or 'none' for datasets delivering bytes only. capability names one of CAPABILITY_NAMES and keeps datasets declaring it true. status is 'available', 'planned', or 'all'.

search

search(query: Query, *, include_planned: bool = False, provider: str | None = None, domain: str | None = None, format: str | None = None, reader: str | None = None, capability: str | None = None, status: str | None = None) -> list[SearchResult]

Rank datasets by keyword match, filtered by provider, space, and time.

The keyword arguments are the list filters, applied before scoring. Planned datasets are left out unless include_planned is set; status supersedes it when given. Blank or absent text is no keyword filter, as in list.

Raises:

Type Description
ValueError

The text has no letters or digits to match, such as ?; it would otherwise match every dataset.

get

get(dataset_id: str) -> Dataset

Return the dataset with this id or raise DatasetNotFound.

providers

providers() -> set[str]

The set of provider ids present in the registry.

domains

domains() -> list[DomainInfo]

All declared domains in declaration order.

Fetching and opening

usdata.fetch

fetch(dataset: Dataset, query: Query, *, root: str | PathLike[str] | None = None, force: bool = False) -> list[FetchedAsset]

Resolve and fetch a query, sharing one adapter and closing its owned resources.

usdata.fetch_asset

fetch_asset(dataset: Dataset, asset: Asset, *, root: str | PathLike[str] | None = None, force: bool = False) -> FetchedAsset

Fetch one asset, reusing the cache only when its provenance still describes it.

usdata.FetchedAsset

Bases: BaseModel

One asset on disk with its provenance and whether the cache satisfied it.

asset instance-attribute

asset: Asset

path instance-attribute

path: Path

provenance instance-attribute

provenance: Provenance

from_cache instance-attribute

from_cache: bool

open

open() -> Any

Open local data with the reader its format implies, with that reader's defaults.

CSV and ERDDAP CSV, HURDAT2, AQS daily JSON, and ACS tables return a pandas DataFrame; NetCDF4 and GRIB2 a loaded xarray Dataset; NEXRAD Level II an xarray DataTree. Provenance is kept in the result's attrs["usdata"]. A file that needs options, or whose metadata leaves its format ambiguous, is opened with the method for its format instead: open_csv, open_nexrad, open_grib2, or open_netcdf. Cached files and provenance sidecars are never changed. See usdata.readers.open_asset.

open_csv

open_csv(*, dtype: dict[str, str] | None = None, parse_dates: list[str] | None = None, usecols: list[str] | None = None, nrows: int | None = None, units_row: bool | None = None) -> pd.DataFrame

Open a CSV as a pandas DataFrame; see usdata.readers.open_csv.

units_row says whether a units row follows the header, as in ERDDAP CSV, and is inferred when None; the units go to frame.attrs["units"].

open_nexrad

open_nexrad(*, sweep: int | list[int] | None = None) -> xr.DataTree

Open a NEXRAD Level II volume as an xarray DataTree; see usdata.readers.open_nexrad.

Use sweep=0 or sweep=[0, 2] to load selected zero-based sweeps.

open_grib2

open_grib2(*, select: Mapping[str, Any] | None = None, strict: bool = False) -> xr.Dataset

Open GRIB2 messages as one xarray Dataset; see usdata.readers.open_grib2.

select={"shortName": "cape", "typeOfLevel": "surface"} chooses messages; strict=True raises instead of warning when a select value matches none of the selected messages.

open_netcdf

open_netcdf() -> xr.Dataset

Open a NetCDF4 file as an xarray Dataset; see usdata.readers.open_netcdf.

inspect

inspect() -> Summary

Summarize this file: provenance, format, and what that format holds.

CSV columns and a capped row count need no extra; NetCDF4 variables and GRIB2 messages need the same extras open does, and a missing one yields a summary with no detail and a note naming it. Like open, this reads the cached file and changes nothing. See usdata.inspect.inspect_asset.

Listing GRIB2 messages

usdata.list_messages

list_messages(dataset: Dataset, query: Query) -> list[MessageListing]

List each file a query resolves to with the fields its index describes.

Each entry's selector is a messages value that names exactly that field. A selector may stop after its level text, as CAPE:surface, to name that field at whatever step each file holds.

Parameters:

Name Type Description Default
dataset Dataset

A dataset declaring partial_fetch.

required
query Query

The query a fetch would take, without messages.

required

Returns:

Type Description
list[MessageListing]

One listing per file, in the order a fetch would list them.

Raises:

Type Description
QueryError

The dataset selects no messages, the query names messages, or a file publishes no readable index.

usdata.MessageListing

Bases: BaseModel

One file a query resolved to, and every field its index describes.

asset class-attribute instance-attribute

asset: Asset = Field(description='The whole-file asset, as a fetch without messages lists it')

messages class-attribute instance-attribute

messages: list[IndexEntry] = Field(description="Every field in the object's index, in order")

usdata.models.IndexEntry

Bases: BaseModel

One field of one GRIB2 object, as the object's wgrib2 .idx sidecar describes it.

number is the GRIB2 message the field belongs to and field its position inside a message that holds several (12.2), or None for a message holding one. Fields of one message share an offset and a length. selector is the messages text that names exactly this field.

number class-attribute instance-attribute

number: int = Field(ge=1, description='One-based GRIB2 message number in the object')

offset class-attribute instance-attribute

offset: int = Field(ge=0, description='Byte offset of the message in the object')

length class-attribute instance-attribute

length: int = Field(gt=0, description='Bytes the message occupies')

short_name class-attribute instance-attribute

short_name: str = Field(description='wgrib2 short name, such as CAPE')

level class-attribute instance-attribute

level: str = Field(description="Level text, such as '2 m above ground'")

step class-attribute instance-attribute

step: str = Field(description="Step text, such as 'anl' or '1 hour fcst'")

field class-attribute instance-attribute

field: int | None = Field(default=None, ge=1, description='Position inside a message holding several fields')

extra class-attribute instance-attribute

extra: str = Field(default='', description="Further text some products add, such as 'ens std dev'")

byte_range property

byte_range: ByteRange

The inclusive byte interval this field's message occupies in the object.

selector property

selector: str

The messages selector naming exactly this field, short name through the last text.

Inspecting a file

usdata.inspect_asset

inspect_asset(fetched: FetchedAsset) -> Summary

Summarize a fetched asset: its provenance and, for its format, what is inside.

The format comes from the asset's media type, falling back to its id, so a restored asset summarizes the same way a freshly fetched one does.

Parameters:

Name Type Description Default
fetched FetchedAsset

The asset to inspect, as fetch returned it.

required

Returns:

Type Description
Summary

A summary carrying the detail for the asset's format, or no detail and a

Summary

note naming the extra when that format's reader is not installed.

usdata.inspect_path

inspect_path(path: str | PathLike[str]) -> Summary

Summarize a cached file, reading the provenance sidecar written beside it.

Parameters:

Name Type Description Default
path str | PathLike[str]

A cached file whose <name>.provenance.json sidecar exists, written as a string or as any os.PathLike.

required

Returns:

Type Description
Summary

The summary inspect_asset builds, with the format taken from the file

Summary

name because a sidecar records no media type, and the protocol from the

Summary

registry entry of the dataset the sidecar names, for the same reason.

Raises:

Type Description
OSError

The file or its provenance sidecar is missing or unreadable.

ValueError

The sidecar is not a provenance record.

usdata.inspect.Summary

Bases: BaseModel

What one fetched file is, where it came from, and what its format holds.

Exactly one of csv, netcdf, grib2, and nexrad is set, or none of them when the format is bytes-only, its reader is unavailable, or the bytes no longer decode; note then says why. detail returns whichever is set.

dataset_id instance-attribute

dataset_id: str

asset_id instance-attribute

asset_id: str

path instance-attribute

path: Path

size class-attribute instance-attribute

size: int = Field(ge=0, description='Bytes on disk now, not the size provenance recorded')

format instance-attribute

format: AssetFormat

retrieved_at instance-attribute

retrieved_at: AwareUTC

checksum instance-attribute

checksum: str

source_url instance-attribute

source_url: str

csv class-attribute instance-attribute

csv: CsvSummary | None = None

netcdf class-attribute instance-attribute

netcdf: NetcdfSummary | None = None

grib2 class-attribute instance-attribute

grib2: Grib2Summary | None = None

nexrad class-attribute instance-attribute

nexrad: NexradSummary | None = None

note class-attribute instance-attribute

note: str | None = Field(default=None, description='Why a recognized format yielded no detail, when it did not')

detail property

detail: CsvSummary | NetcdfSummary | Grib2Summary | NexradSummary | None

The per-format detail, or None for a bytes-only file or an unavailable reader.

usdata.inspect.CsvSummary

Bases: BaseModel

A delimited text file's header and how many data rows the scan counted.

columns class-attribute instance-attribute

columns: list[str] = Field(description='Header fields, in file order')

units class-attribute instance-attribute

units: dict[str, str] = Field(default_factory=dict, description='Units per column, from the units row an ERDDAP or IBTrACS CSV lays under its header; empty for a CSV with no such row')

row_count class-attribute instance-attribute

row_count: int = Field(ge=0, description='Data rows counted, excluding the header and any units row')

row_limit class-attribute instance-attribute

row_limit: int = Field(gt=0, description='Rows the scan reads before it stops')

truncated class-attribute instance-attribute

truncated: bool = Field(description='The scan stopped early, so row_count is a lower bound')

usdata.inspect.NetcdfSummary

Bases: BaseModel

The data variables of a NetCDF4 file's root group.

variables instance-attribute

variables: list[NetcdfVariable]

usdata.inspect.NetcdfVariable

Bases: BaseModel

One NetCDF4 data variable's shape and the metadata the file states for it.

name instance-attribute

name: str

dims class-attribute instance-attribute

dims: list[str] = Field(description='Dimension names, in array order')

shape class-attribute instance-attribute

shape: list[int] = Field(description='Length of each dimension, in array order')

units class-attribute instance-attribute

units: str | None = None

long_name class-attribute instance-attribute

long_name: str | None = None

usdata.inspect.Grib2Summary

Bases: BaseModel

Every message a GRIB2 file holds, in file order.

messages instance-attribute

messages: list[GribMessage]

variable_for

variable_for(selector: str) -> str

The variable name open() will give the message one index selector fetched.

This closes the loop a partial fetch opens: messages="CAPE:surface" asks in the index sidecar's vocabulary, and the reader answers in ecCodes', so this says which name that selector produces given every message this file holds. Only a partial fetch records selectors.

Parameters:

Name Type Description Default
selector str

A selector exactly as the provenance recorded it, such as CAPE:surface.

required

Returns:

Type Description
str

The variable name the GRIB2 naming rule gives that message.

Raises:

Type Description
KeyError

No message here was fetched for that selector; the message lists the selectors that were.

ValueError

That selector fetched a message holding several fields, as RAP publishes wind components, and the record was written before each field's selector was recorded, so it cannot say which field it named; the message lists their variables.

usdata.inspect.GribMessage

Bases: BaseModel

One GRIB2 message as ecCodes reports it: the keys select matches on, plus the grid.

Two numberings name the same message. file_index counts messages in the local file from zero; object_index is the number the source object's index sidecar gave it, one-based, and is set only for a partial fetch, as is selector, the index selector the message was fetched for.

file_index class-attribute instance-attribute

file_index: int = Field(ge=0, description='Zero-based message position in the local file; fields of one message share it')

object_index class-attribute instance-attribute

object_index: int | None = Field(default=None, ge=1, description='One-based message number in the source object, for a partial fetch')

selector class-attribute instance-attribute

selector: str | None = Field(default=None, description='Index selector this message was fetched for, for a partial fetch')

short_name class-attribute instance-attribute

short_name: str | None = Field(default=None, description='ecCodes shortName')

base_name class-attribute instance-attribute

base_name: str | None = Field(default=None, description="Name the reader starts this message's variable from: shortName, or where ecCodes has none, the MRMS product or parameter_<discipline>_<category>_<number>")

name class-attribute instance-attribute

name: str | None = Field(default=None, description='ecCodes name')

type_of_level class-attribute instance-attribute

type_of_level: str | None = Field(default=None, description='ecCodes typeOfLevel')

level class-attribute instance-attribute

level: str | None = Field(default=None, description='ecCodes level')

step class-attribute instance-attribute

step: str | None = Field(default=None, description='ecCodes step')

units class-attribute instance-attribute

units: str | None = Field(default=None, description='ecCodes units')

shape class-attribute instance-attribute

shape: tuple[int, int] | None = Field(default=None, description='Grid rows and columns')

usdata.inspect.NexradSummary

Bases: BaseModel

The volume coverage pattern and every sweep of a NEXRAD Level II volume, in scan order.

vcp class-attribute instance-attribute

vcp: int | None = Field(description='Volume coverage pattern number; None for a legacy volume')

sweeps instance-attribute

sweeps: list[NexradSweep]

usdata.inspect.NexradSweep

Bases: BaseModel

One sweep of a NEXRAD Level II volume, read from its metadata without decoding moments.

index is what open_nexrad(sweep=...) takes. It is not an elevation: a split cut scans one angle twice, once for reflectivity and dual-pol moments and once for velocity, and SAILS or MRLE rescan the lowest angle several times a volume, so one angle can hold many indices. Choose sweeps here by fixed_angle, moments, and start, then open them by index.

index class-attribute instance-attribute

index: int = Field(ge=0, description='Zero-based position in the volume; what open_nexrad(sweep=...) takes')

elevation_number class-attribute instance-attribute

elevation_number: int = Field(ge=1, description='The one-based VCP cut the sweep scans')

fixed_angle class-attribute instance-attribute

fixed_angle: float = Field(description="Elevation in degrees: the VCP table's angle for the cut, or the first ray's where the volume carries no VCP table")

moments class-attribute instance-attribute

moments: list[str] = Field(description="Moments open_nexrad returns for the sweep, by its names; a legacy volume's spectrum width is in the file but not decoded")

start class-attribute instance-attribute

start: AwareUTC = Field(description="When the sweep's first ray was collected")

end class-attribute instance-attribute

end: AwareUTC = Field(description='When its last ray was collected')

rays class-attribute instance-attribute

rays: int = Field(ge=0, description='Rays received')

complete class-attribute instance-attribute

complete: bool = Field(description='The sweep reached its end; open_nexrad pads one that did not')

sails class-attribute instance-attribute

sails: bool | None = Field(default=None, description='A SAILS low-level rescan; None where there is no VCP table')

mrle class-attribute instance-attribute

mrle: bool | None = Field(default=None, description='An MRLE mid-volume rescan; None where there is no VCP table')

usdata.readers.nexrad_sweeps

nexrad_sweeps(path: str | PathLike[str]) -> list[NexradSweep]

List every sweep in a local NEXRAD Level II volume without decoding any moment.

A sweep index is a position in the volume, not an elevation: split cuts scan one angle twice and SAILS rescans the lowest angle within a volume, so the same index names different angles from one volume coverage pattern to the next. Choose sweeps from this list by angle, moment, and time, then pass their indices to open_nexrad(sweep=...). FetchedAsset.inspect() returns the same list, with the volume coverage pattern, as nexrad.

Parameters:

Name Type Description Default
path str | PathLike[str]

A local Level II volume, whole-file gzip or bzip2 compressed or not, written as a string or as any os.PathLike. Nothing is fetched or written.

required

Returns:

Type Description
list[NexradSweep]

One entry per sweep in scan order.

Raises:

Type Description
MissingReaderDependency

The radar extra is not installed.

ValueError

The file is not a readable NEXRAD Level II volume.

Reproducible inputs

usdata.pull.pull

pull(manifest_path: str | PathLike[str], *, root: str | PathLike[str] | None = None, force: bool = False, registry: Registry | None = None, update: Iterable[str] = ()) -> PullResult

Restore from the lockfile if one exists, otherwise resolve and create it.

update names assets or datasets whose pins should follow current upstream bytes; it needs an existing lockfile and is exclusive with force.

usdata.pull.plan

plan(manifest_path: str | PathLike[str], *, registry: Registry | None = None) -> Plan

List every source through its adapter and price the result; download nothing.

Validates the whole manifest first, exactly as resolve does, then makes only the requests a listing makes: an S3 listing, or the index and HEAD requests a partial-fetch source needs to work out its byte ranges.

Parameters:

Name Type Description Default
manifest_path str | PathLike[str]

Path of the manifest YAML file, as a string or any os.PathLike.

required
registry Registry | None

Registry to resolve dataset ids against; the default one if omitted.

None

Returns:

Type Description
Plan

A Plan holding each source's assets and the totals over them.

usdata.pull.verify

verify(manifest_path: str | PathLike[str], *, root: str | PathLike[str] | None = None) -> list[Drift]

Check manifest consistency, then compare cached files against the lockfile.

usdata.pull.compare_listing

compare_listing(manifest_path: str | PathLike[str], *, registry: Registry | None = None) -> ListingComparison

Compare a manifest's lockfile with what its sources list today; download nothing.

Every source is listed as plan lists it, select rules included, and its assets are matched to the lockfile's entries for that source by id. An asset only in the listing is added, one only in the lockfile removed, and one in both with a different href, or a different size where both give one, changed. A listing that reports no size cannot show a size change; restoring the pin checks the bytes themselves.

Parameters:

Name Type Description Default
manifest_path str | PathLike[str]

Path of the manifest YAML file, as a string or any os.PathLike.

required
registry Registry | None

Registry to resolve dataset ids against; the default one if omitted.

None

Returns:

Type Description
ListingComparison

A ListingComparison with one entry per manifest source.

Raises:

Type Description
FileNotFoundError

The manifest has no lockfile yet.

ManifestChanged

The manifest changed since its lockfile was written.

usdata.pull.PullResult

Bases: BaseModel

What a pull did.

fetched keeps manifest order, and within a source the assets are ordered by start time and then id; by_source holds the same objects grouped by source key, which is a source's name when it has one and its one-based position otherwise, in the same order. one is for a source that can only ever resolve to one asset.

lockfile instance-attribute

lockfile: Lockfile

lockfile_path instance-attribute

lockfile_path: Path

fetched class-attribute instance-attribute

fetched: list[FetchedAsset] = Field(description='Every asset, in manifest order, then by start time and id within a source')

from_lockfile instance-attribute

from_lockfile: bool

updated class-attribute instance-attribute

updated: list[str] = Field(default_factory=list, description='Ids of assets whose pins were rewritten by update')

mirrored class-attribute instance-attribute

mirrored: list[str] = Field(default_factory=list, description="Ids of assets the mirror restored instead of the source: because the pinned URL no longer served their bytes, or, for those also in unchecked, because the source's credentials are not set; pins are unchanged and each sidecar names the mirror object")

unchecked class-attribute instance-attribute

unchecked: list[str] = Field(default_factory=list, description='Ids of mirrored assets restored without asking their source, because its credentials are not set, so upstream was not checked for changes (ADR 0039)')

by_source class-attribute instance-attribute

by_source: dict[str, list[FetchedAsset]] = Field(default_factory=dict, description='The same assets grouped by source key, in manifest order')

one

one(source: str) -> FetchedAsset

The single asset a source resolved to.

Parameters:

Name Type Description Default
source str

The source key: its name, or its one-based position as a string.

required

Returns:

Type Description
FetchedAsset

That source's only asset.

Raises:

Type Description
KeyError

No source in the result has that key.

ValueError

The source resolved to no asset, or to more than one.

usdata.pull.Plan

Bases: BaseModel

What pulling a manifest would fetch, priced as far as the adapters can measure.

An asset whose adapter reports no size contributes nothing to known_bytes and counts in unknown_sizes instead, so the total is a floor rather than an estimate. A source that matched nothing is kept with no assets; pull would fail on it unless the source sets allow_empty.

manifest instance-attribute

manifest: str

sources class-attribute instance-attribute

sources: list[SourcePlan] = Field(description='One entry per manifest source, in order')

asset_count property

asset_count: int

How many assets the manifest resolves to.

known_bytes property

known_bytes: int

Total measured size across every source.

unknown_sizes property

unknown_sizes: int

How many assets no adapter gave a size for.

unsized_sources property

unsized_sources: list[str]

The sources whose adapters left some size unreported, in manifest order.

usdata.pull.SourcePlan

Bases: BaseModel

What one manifest source would fetch, as its adapter listed it.

source class-attribute instance-attribute

source: str = Field(description="The source's manifest key: its name, or its position")

dataset_id instance-attribute

dataset_id: str

assets instance-attribute

assets: list[Asset]

known_bytes property

known_bytes: int

Total size of the assets this source can measure.

unknown_sizes property

unknown_sizes: int

How many assets their adapter gave no size for.

usdata.pull.Drift

Bases: BaseModel

One lockfile entry whose local copy is missing or altered, or whose source moved on.

asset_id instance-attribute

asset_id: str

dataset_id instance-attribute

dataset_id: str

path instance-attribute

path: Path

problem class-attribute instance-attribute

problem: str = Field(description="'missing', 'checksum mismatch', 'upstream changed', 'gone upstream (<status>)', or 'range refused'; a restore that also tried a mirror appends why the mirror did not help")

usdata.pull.ListingComparison

Bases: BaseModel

A lockfile against today's listings: whether a re-resolve would pin the same assets.

Nothing is downloaded, so the bytes are not compared: restore checks those, and verify checks the cache. What this sees is the set of files, an asset added, removed, or re-described since the lockfile was written.

manifest instance-attribute

manifest: str

lockfile instance-attribute

lockfile: Path

sources class-attribute instance-attribute

sources: list[SourceComparison] = Field(description='One entry per manifest source, in order')

matches property

matches: bool

True when every source matches.

usdata.pull.SourceComparison

Bases: BaseModel

How one source's pinned assets compare with what its adapter lists today.

source class-attribute instance-attribute

source: str = Field(description="The source's manifest key: its name, or its position")

dataset_id instance-attribute

dataset_id: str

added class-attribute instance-attribute

added: list[Asset] = Field(description='Listed today and not pinned')

removed class-attribute instance-attribute

removed: list[Asset] = Field(description='Pinned and no longer listed')

changed class-attribute instance-attribute

changed: list[AssetChange] = Field(description='Pinned and listed, with a different href, or a different size where both the pin and the listing give one')

unchanged class-attribute instance-attribute

unchanged: int = Field(description='How many pinned assets are listed exactly as pinned')

matches property

matches: bool

True when nothing was added, removed, or changed.

usdata.pull.AssetChange

Bases: BaseModel

A pinned asset that today's listing still names, but describes differently.

asset_id instance-attribute

asset_id: str

locked_size class-attribute instance-attribute

locked_size: int | None = Field(description='Size the listing gave when the pin was written')

listed_size class-attribute instance-attribute

listed_size: int | None = Field(description="Size today's listing gives")

locked_href instance-attribute

locked_href: str

listed_href instance-attribute

listed_href: str

usdata.manifest.Manifest

Bases: BaseModel

A declarative list of inputs a project needs: usdata pull fetches them.

name instance-attribute

name: str

version class-attribute instance-attribute

version: str = '1.0'

sources class-attribute instance-attribute

sources: list[SourceSpec] = Field(min_length=1)

source_keys

source_keys() -> list[str]

Each source's key: its name when set, otherwise its one-based position.

load classmethod

load(path: str | PathLike[str]) -> Manifest

Parse a manifest YAML file.

validate_against

validate_against(registry: Registry | None = None) -> list[str]

Return the dataset ids referenced by this manifest that the registry lacks.

usdata.manifest.SourceSpec

Bases: BaseModel

One entry under sources: in a manifest.

dataset instance-attribute

dataset: str

name class-attribute instance-attribute

name: str | None = Field(default=None, description='Optional label that keys this source in results and lockfiles')

allow_empty class-attribute instance-attribute

allow_empty: bool = False

location class-attribute instance-attribute

location: str | None = None

bbox class-attribute instance-attribute

bbox: BBox | None = None

start class-attribute instance-attribute

start: str | date | datetime | None = None

end class-attribute instance-attribute

end: str | date | datetime | None = None

variables class-attribute instance-attribute

variables: list[str] = Field(default_factory=list)

params class-attribute instance-attribute

params: dict[str, Any] = Field(default_factory=dict)

select class-attribute instance-attribute

select: TimeSelect | None = Field(default=None, description='Keep only the asset nearest an instant; replaces start and end (ADR 0044)')

to_query

to_query() -> Query

Build the Query this source resolves to; select supplies the window when set.

usdata.manifest.Lockfile

Bases: BaseModel

Exactly what a manifest resolved to, with checksums, so it can be reproduced.

manifest instance-attribute

manifest: str

manifest_checksum class-attribute instance-attribute

manifest_checksum: str = Field(description='sha256 of the manifest file when it was resolved')

generated_at instance-attribute

generated_at: AwareUTC

usdata_version instance-attribute

usdata_version: str

assets class-attribute instance-attribute

assets: list[LockedAsset] = Field(default_factory=list)

load classmethod

load(path: str | PathLike[str]) -> Lockfile

Read a lockfile written by save.

save

save(path: str | PathLike[str]) -> None

Write the lockfile as indented JSON.

usdata.manifest.LockedAsset

Bases: BaseModel

One resolved asset and the provenance of the copy that was fetched.

asset instance-attribute

asset: Asset

provenance instance-attribute

provenance: Provenance

source class-attribute instance-attribute

source: str | None = Field(default=None, description='Key of the manifest source that resolved this asset')

Citations

usdata.cite_dataset

cite_dataset(dataset: Dataset, *, registry: Registry | None = None) -> Citation

Build the citation for one registry entry.

Parameters:

Name Type Description Default
dataset Dataset

The entry to cite.

required
registry Registry | None

Registry supplying the agency name and homepage behind the entry's provider id. The bundled registry by default.

None

Returns:

Type Description
Citation

A citation carrying the entry's own citation text where it has one, and

Citation

', , accessed via usdata' where it does not.</p> </div> </td> </tr> </tbody> </table> </div> </div> <div class="doc doc-object doc-function"> <h3 id="usdata.cite_lockfile" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">usdata.cite_lockfile</span> </h3> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">cite_lockfile</span><span class="p">(</span><span class="n">manifest_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">PathLike</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">registry</span><span class="p">:</span> <span class="n">Registry</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="n">Citation</span><span class="p">]</span> </code></pre></div> <div class="doc doc-contents first"> <p>Cite every dataset a manifest's lockfile pins, one citation per dataset.</p> <p><span class="doc-section-title">Parameters:</span></p> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr class="doc-section-item"> <td> <code>manifest_path</code> </td> <td> <code><span title="str">str</span> | <span title="os.PathLike">PathLike</span>[<span title="str">str</span>]</code> </td> <td> <div class="doc-md-description"> <p>The manifest whose lockfile records what was fetched, written as a string or as any <code>os.PathLike</code>.</p> </div> </td> <td> <em>required</em> </td> </tr> <tr class="doc-section-item"> <td> <code>registry</code> </td> <td> <code><a class="autorefs autorefs-internal" title="usdata.Registry (usdata.registry.Registry)" href="#usdata.Registry">Registry</a> | None</code> </td> <td> <div class="doc-md-description"> <p>Registry the pinned dataset ids are looked up in. The bundled registry by default.</p> </div> </td> <td> <code>None</code> </td> </tr> </tbody> </table> <p><span class="doc-section-title">Returns:</span></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr class="doc-section-item"> <td> <code><span title="list">list</span>[<a class="autorefs autorefs-internal" title="usdata.Citation (usdata.cite.Citation)" href="#usdata.Citation">Citation</a>]</code> </td> <td> <div class="doc-md-description"> <p>One citation per distinct dataset id, in lockfile order, each carrying</p> </div> </td> </tr> <tr class="doc-section-item"> <td> <code><span title="list">list</span>[<a class="autorefs autorefs-internal" title="usdata.Citation (usdata.cite.Citation)" href="#usdata.Citation">Citation</a>]</code> </td> <td> <div class="doc-md-description"> <p>the retrieval range, asset count, total bytes, pinning version, and</p> </div> </td> </tr> <tr class="doc-section-item"> <td> <code><span title="list">list</span>[<a class="autorefs autorefs-internal" title="usdata.Citation (usdata.cite.Citation)" href="#usdata.Citation">Citation</a>]</code> </td> <td> <div class="doc-md-description"> <p>manifest source keys of that dataset's pinned assets.</p> </div> </td> </tr> </tbody> </table> <p><span class="doc-section-title">Raises:</span></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr class="doc-section-item"> <td> <code><span title="ManifestChanged">ManifestChanged</span></code> </td> <td> <div class="doc-md-description"> <p>The manifest was edited after the lockfile was written.</p> </div> </td> </tr> <tr class="doc-section-item"> <td> <code><span title="usdata.registry.DatasetNotFound">DatasetNotFound</span></code> </td> <td> <div class="doc-md-description"> <p>The lockfile pins a dataset the registry does not know.</p> </div> </td> </tr> </tbody> </table> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.Citation" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Citation</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>How to cite one dataset, plus what a lockfile pins of it when there is one.</p> <p>The retrieval fields are empty for a citation built from a registry entry alone; they are filled only when the citation comes from a lockfile.</p> <div class="doc doc-children"> <div class="doc doc-object doc-function"> <h4 id="usdata.Citation.as_text" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">as_text</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">as_text</span><span class="p">()</span> <span class="o">-></span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> <p>Render this citation the way <code>usdata cite</code> prints it.</p> <p><span class="doc-section-title">Returns:</span></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr class="doc-section-item"> <td> <code><span title="str">str</span></code> </td> <td> <div class="doc-md-description"> <p>The dataset id, the citation text, and each field that is set, one</p> </div> </td> </tr> <tr class="doc-section-item"> <td> <code><span title="str">str</span></code> </td> <td> <div class="doc-md-description"> <p>labelled line apiece.</p> </div> </td> </tr> </tbody> </table> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.Citation.as_bibtex" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">as_bibtex</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">as_bibtex</span><span class="p">()</span> <span class="o">-></span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> <p>Render this citation the way <code>usdata cite --format bibtex</code> prints it.</p> <p><span class="doc-section-title">Returns:</span></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr class="doc-section-item"> <td> <code><span title="str">str</span></code> </td> <td> <div class="doc-md-description"> <p>One <code>@misc</code> entry keyed on the dataset id.</p> </div> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div><h2 id="temporal-selection">Temporal selection</h2> <div class="doc doc-object doc-function"> <h3 id="usdata.select_by_time" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">usdata.select_by_time</span> </h3> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">select_by_time</span><span class="p">(</span><span class="n">candidates</span><span class="p">:</span> <span class="n">Iterable</span><span class="p">[</span><span class="n">Asset</span><span class="p">],</span> <span class="o">*</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">tolerance</span><span class="p">:</span> <span class="n">timedelta</span><span class="p">,</span> <span class="n">direction</span><span class="p">:</span> <span class="n">Literal</span><span class="p">[</span><span class="s1">'nearest'</span><span class="p">,</span> <span class="s1">'at_or_before'</span><span class="p">])</span> <span class="o">-></span> <span class="n">TemporalSelection</span> </code></pre></div> <div class="doc doc-contents first"> <p>Select an asset by start time using an explicit tolerance and direction.</p> <p><code>nearest</code> admits starts on either side of target; <code>at_or_before</code> admits only starts no later than target. The tolerance boundary is inclusive. Equal distances break ties lexically by asset ID, then dataset ID. Duplicate (dataset_id, id) identities and missing/naive starts raise ValueError, even for candidates that would not win. All supplied candidates are validated.</p> <p>Target is normalized to UTC for comparison and in the result. The signed offset is asset start minus target, in seconds. If no candidate qualifies, the result has no asset/offset and eligible_count=0. Inputs are not modified. Matching by start does not establish acquisition completion or availability.</p> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.TemporalSelection" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.TemporalSelection</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>A start-time selection and its explicit policy; not source provenance.</p> <p>No match has <code>asset=None</code>, <code>offset_seconds=None</code>, and zero eligible candidates. Counts refer to the supplied candidates, not a remote catalog.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.target" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">target</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">target</span><span class="p">:</span> <span class="n">AwareUTC</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.tolerance" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">tolerance</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">tolerance</span><span class="p">:</span> <span class="n">timedelta</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.direction" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">direction</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">direction</span><span class="p">:</span> <span class="n">Literal</span><span class="p">[</span><span class="s1">'nearest'</span><span class="p">,</span> <span class="s1">'at_or_before'</span><span class="p">]</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.asset" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">asset</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">asset</span><span class="p">:</span> <span class="n">Asset</span> <span class="o">|</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.offset_seconds" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">offset_seconds</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">offset_seconds</span><span class="p">:</span> <span class="nb">float</span> <span class="o">|</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.candidate_count" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">candidate_count</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">candidate_count</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TemporalSelection.eligible_count" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">eligible_count</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">eligible_count</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> </div> </div> </div><h2 id="shared-types">Shared types</h2> <div class="doc doc-object doc-class"> <h3 id="usdata.Asset" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Asset</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>A single retrievable object (file, granule, or subset request) from a dataset.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.id" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">id</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nb">id</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.dataset_id" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">dataset_id</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">dataset_id</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.href" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">href</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">href</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.protocol" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">protocol</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">protocol</span><span class="p">:</span> <span class="n">Protocol</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.media_type" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">media_type</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">media_type</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.size" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">size</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ge</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.checksum" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">checksum</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">checksum</span><span class="p">:</span> <span class="n">Sha256</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"'sha256:<hex>' of the file's bytes"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.time" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">time</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">time</span><span class="p">:</span> <span class="n">TimeRange</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.bbox" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">bbox</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">bbox</span><span class="p">:</span> <span class="n">BBox</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Asset.properties" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">properties</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">properties</span><span class="p">:</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">dict</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"Facts of the request the bytes do not state, such as the unit system, datum, or station, keyed in lowercase snake case; readers copy them into attrs['usdata']['properties'] (ADR 0043)"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.BBox" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.BBox</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>Geographic bounding box in WGS84 degrees. Antimeridian crossing is not supported yet.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.BBox.west" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">west</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">west</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=-</span><span class="mi">180</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">180</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.BBox.south" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">south</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">south</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=-</span><span class="mi">90</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">90</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.BBox.east" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">east</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">east</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=-</span><span class="mi">180</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">180</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.BBox.north" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">north</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">north</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=-</span><span class="mi">90</span><span class="p">,</span> <span class="n">le</span><span class="o">=</span><span class="mi">90</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.BBox.from_point" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">from_point</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-classmethod"><code>classmethod</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">from_point</span><span class="p">(</span><span class="n">lat</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">lon</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">radius_km</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">)</span> <span class="o">-></span> <span class="n">BBox</span> </code></pre></div> <div class="doc doc-contents "> <p>Box around a point. Uses a flat-earth approximation, fine for small radii.</p> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.BBox.intersects" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">intersects</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">intersects</span><span class="p">(</span><span class="n">other</span><span class="p">:</span> <span class="n">BBox</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span> </code></pre></div> <div class="doc doc-contents "> <p>True if the boxes share any area, edges included.</p> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.BBox.contains_point" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">contains_point</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">contains_point</span><span class="p">(</span><span class="n">lat</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">lon</span><span class="p">:</span> <span class="nb">float</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span> </code></pre></div> <div class="doc doc-contents "> <p>True if the point lies inside or on the edge of the box.</p> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.BBox.as_tuple" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">as_tuple</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">as_tuple</span><span class="p">()</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> </code></pre></div> <div class="doc doc-contents "> <p>The box as (west, south, east, north).</p> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.Place" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Place</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>The state or county a <code>location</code> named, as the bundled Census table identifies it.</p> <p>A rectangle cannot be turned back into the place it was drawn around, so a query keeps this beside its <code>bbox</code> for the sources that are keyed by FIPS code rather than by coordinates. See ADR 0034.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.kind" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">kind</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">kind</span><span class="p">:</span> <span class="n">Literal</span><span class="p">[</span><span class="s1">'state'</span><span class="p">,</span> <span class="s1">'county'</span><span class="p">]</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.geoid" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">geoid</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">geoid</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="s1">'^</span><span class="se">\\</span><span class="s1">d</span><span class="si">{2}</span><span class="s1">(</span><span class="se">\\</span><span class="s1">d</span><span class="si">{3}</span><span class="s1">)?$'</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Census GEOID: the two-digit state FIPS code, or the five-digit county one'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.label" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">label</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">label</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s2">"The place as the table names it, such as 'Osage County, OK'"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.state" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">state</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">state</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="s1">'^[A-Z]</span><span class="si">{2}</span><span class="s1">$'</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Two-letter postal code of the state, or of the state a county lies in, such as OK; some sources key places by it rather than by the state FIPS code'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.state_fips" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">state_fips</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">state_fips</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> <p>The two-digit FIPS code of the state, or of the state a county lies in.</p> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Place.county_fips" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">county_fips</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">county_fips</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> <p>The three-digit county FIPS code within its state, or None for a state.</p> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.TimeRange" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.TimeRange</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>Half-open-agnostic time interval. Either bound may be None to mean unbounded.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TimeRange.start" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">start</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">start</span><span class="p">:</span> <span class="n">AwareUTC</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.TimeRange.end" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">end</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">end</span><span class="p">:</span> <span class="n">AwareUTC</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.TimeRange.overlaps" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">overlaps</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">overlaps</span><span class="p">(</span><span class="n">other</span><span class="p">:</span> <span class="n">TimeRange</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span> </code></pre></div> <div class="doc doc-contents "> <p>True if the ranges share any instant; open bounds match everything on that side.</p> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.Dataset" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Dataset</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>A registry entry. One per curated dataset, identified as <code>provider:name</code>.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.id" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">id</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nb">id</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.provider" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">provider</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">provider</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.title" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">title</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">title</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.description" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">description</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">description</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">''</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.keywords" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">keywords</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">keywords</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.protocol" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">protocol</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">protocol</span><span class="p">:</span> <span class="n">Protocol</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.homepage" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">homepage</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">homepage</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.license" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">license</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">license</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.spatial_extent" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">spatial_extent</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">spatial_extent</span><span class="p">:</span> <span class="n">BBox</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.temporal_extent" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">temporal_extent</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">temporal_extent</span><span class="p">:</span> <span class="n">TimeRange</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.capabilities" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">capabilities</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">capabilities</span><span class="p">:</span> <span class="n">Capabilities</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="n">Capabilities</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.summary" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">summary</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">summary</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=</span><span class="mi">80</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'One-line label shown by the docs, site, and CLI'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.formats" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">formats</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">formats</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'File formats this dataset delivers, as delivered'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.selection" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">selection</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">selection</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=</span><span class="mi">160</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'What one query selects, in a single sentence'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.inputs" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">inputs</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">inputs</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'What a caller must supply to fetch anything'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.reader" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">reader</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">reader</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="sa">f</span><span class="s1">'Extra that opens the files (</span><span class="si">{</span><span class="n">READER_EXTRAS_TEXT</span><span class="si">}</span><span class="s1">); None means bytes only'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.guide" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">guide</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">guide</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Repository-relative path to the handwritten usage guide'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.examples" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">examples</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">examples</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Repository-relative paths to worked examples using this dataset'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.resolution" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">resolution</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">resolution</span><span class="p">:</span> <span class="n">Resolution</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'How fine the data are in space and time'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.update_frequency" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">update_frequency</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">update_frequency</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'How often the source publishes new data'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.latency" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">latency</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">latency</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'How far behind real time the source runs, as the agency states it'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.citation" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">citation</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">citation</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'How the agency asks to be cited, in one line'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.terms" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">terms</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">terms</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"https URL of the source's stated conditions of use"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.variables" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">variables</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">variables</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">Variable</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Variables the dataset delivers; a sample where the set is open-ended'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.limits" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">limits</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">limits</span><span class="p">:</span> <span class="n">Limits</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Request limits the adapter enforces, such as the longest window'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.credentials" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">credentials</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">credentials</span><span class="p">:</span> <span class="n">CredentialSpec</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Environment variables the source needs before it can be contacted (ADR 0039)'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.system" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">system</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">system</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Id of a system declared in the registry, for datasets that belong to one'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.domain" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">domain</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">domain</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s1">'Id of a domain declared in the registry'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.status" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">status</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">status</span><span class="p">:</span> <span class="n">Status</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.since" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">since</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">since</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Version an available dataset shipped in'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.target" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">target</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">target</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"Version a planned dataset is aimed at, or 'later'"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.adapter" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">adapter</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">adapter</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"'package.module:ClassName' of the Provider; required unless planned"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.version_label" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">version_label</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">version_label</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> <p>'since 0.2' for shipped datasets, 'target 0.4' or 'target later' otherwise.</p> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Dataset.name" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">name</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">name</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> <p>The dataset name without the provider prefix.</p> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.Query" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Query</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>Normalized, provider-agnostic request. Providers translate this into their own terms.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.text" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">text</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">text</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.provider" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">provider</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">provider</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.bbox" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">bbox</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">bbox</span><span class="p">:</span> <span class="n">BBox</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.place" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">place</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">place</span><span class="p">:</span> <span class="n">Place</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"The state or county the spatial filter named, set only when it was given as a location; bbox still holds that place's rectangle"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.time" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">time</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">time</span><span class="p">:</span> <span class="n">TimeRange</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.variables" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">variables</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">variables</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Query.params" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">params</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">params</span><span class="p">:</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">dict</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Provider-specific passthrough parameters'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.Provenance" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.Provenance</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>Everything needed to say where a local file came from and re-fetch it.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.dataset_id" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">dataset_id</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">dataset_id</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.provider" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">provider</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">provider</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.source_url" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">source_url</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">source_url</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.retrieved_at" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">retrieved_at</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">retrieved_at</span><span class="p">:</span> <span class="n">AwareUTC</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.checksum" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">checksum</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">checksum</span><span class="p">:</span> <span class="n">Sha256</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.size" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">size</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">ge</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.license" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">license</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">license</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.usdata_version" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">usdata_version</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">usdata_version</span><span class="p">:</span> <span class="nb">str</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.transformations" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">transformations</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">transformations</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.index_url" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">index_url</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">index_url</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Index sidecar a partial fetch resolved its ranges through'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.index_checksum" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">index_checksum</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">index_checksum</span><span class="p">:</span> <span class="n">Sha256</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">"'sha256:<hex>' of that index text as it was fetched"</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.ranges" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">ranges</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">ranges</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">ByteRange</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Byte ranges a partial fetch concatenated, in order'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.selectors" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">selectors</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">selectors</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Index selector each of those ranges was fetched for, in the same order'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.field_selectors" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">field_selectors</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">field_selectors</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Index selector naming each field each of those ranges holds, in the same order; empty in a record written before fields were recorded'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.object_size" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">object_size</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">object_size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ge</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Size of the whole object those ranges came from'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.object_etag" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">object_etag</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">object_etag</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'ETag that object carried, re-sent as ``If-Match`` on a restore'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.mirror" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">mirror</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">mirror</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Mirror object that served these bytes in place of the source (ADR 0030, ADR 0039)'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.credentials" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">credentials</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">credentials</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s1">'Environment variables the source requires to fetch this file, never their values (ADR 0039); empty for an anonymous source'</span><span class="p">)</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.is_partial" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">is_partial</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">is_partial</span><span class="p">:</span> <span class="nb">bool</span> </code></pre></div> <div class="doc doc-contents "> <p>Whether this record describes selected byte ranges rather than a whole object.</p> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.Provenance.object_messages" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">object_messages</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-property"><code>property</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">object_messages</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> </code></pre></div> <div class="doc doc-contents "> <p>The source object's own message numbers, in the order the local file holds them.</p> <p>A partial fetch concatenated one message per recorded range, so the nth number here numbers the nth message on disk as the index sidecar numbers it, one-based. Empty for a whole file, and empty rather than wrong when the href fragment and the recorded ranges disagree.</p> </div> </div> <div class="doc doc-object doc-function"> <h4 id="usdata.Provenance.field_selector" class="doc doc-heading"> <span class="doc doc-object-name doc-function-name">field_selector</span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">field_selector</span><span class="p">(</span><span class="n">message</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">field</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> </code></pre></div> <div class="doc doc-contents "> <p>The selector one field on disk was fetched for, or <code>None</code> where none was recorded.</p> <p><code>message</code> counts the local file's messages from zero and <code>field</code> the fields inside that message from zero, as a reader meets them. A record that names no fields, as one written before they were recorded does, gives every field of a message that message's one selector.</p> </div> </div> </div> </div> </div> <div class="doc doc-object doc-class"> <h3 id="usdata.SearchResult" class="doc doc-heading"> <span class="doc doc-object-name doc-class-name">usdata.SearchResult</span> </h3> <div class="doc doc-contents first"> <p class="doc doc-class-bases"> Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p> <p>A dataset and its keyword-match score.</p> <div class="doc doc-children"> <div class="doc doc-object doc-attribute"> <h4 id="usdata.SearchResult.dataset" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">dataset</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">dataset</span><span class="p">:</span> <span class="n">Dataset</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> <div class="doc doc-object doc-attribute"> <h4 id="usdata.SearchResult.score" class="doc doc-heading"> <span class="doc doc-object-name doc-attribute-name">score</span> <span class="doc doc-labels"> <small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small> </span> </h4> <div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">score</span><span class="p">:</span> <span class="nb">float</span> </code></pre></div> <div class="doc doc-contents "> </div> </div> </div> </div> </div> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type="button" class="md-top md-icon" data-md-component="top" hidden> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class="md-footer"> <nav class="md-footer__inner md-grid" aria-label="Footer" > <a href="../../concepts/provenance-and-drift/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Provenance and drift"> <div class="md-footer__button md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </div> <div class="md-footer__title"> <span class="md-footer__direction"> Previous </span> <div class="md-ellipsis"> Provenance and drift </div> </div> </a> <a href="../../generated/cli/" class="md-footer__link md-footer__link--next" aria-label="Next: CLI"> <div class="md-footer__title"> <span class="md-footer__direction"> Next </span> <div class="md-ellipsis"> CLI </div> </div> <div class="md-footer__button md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg> </div> </a> </nav> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-copyright"> Made with <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> Material for MkDocs </a> </div> <div class="md-social"> <a href="https://github.com/jakeryderv/usdata" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> <a href="https://pypi.org/project/usdata/" target="_blank" rel="noopener" title="pypi.org" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6M286.2 444.7a20.4 20.4 0 1 1 0-40.7 20.4 20.4 0 1 1 0 40.7M167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4m-6.6-183.4a20.4 20.4 0 1 1 0 40.8 20.4 20.4 0 1 1 0-40.8"/></svg> </a> </div> </div> </div> </footer> </div> <div class="md-dialog" data-md-component="dialog"> <div class="md-dialog__inner md-typeset"></div> </div> <div class="md-progress" data-md-component="progress" role="progressbar"></div> <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.sections", "navigation.indexes", "navigation.path", "navigation.instant", "navigation.instant.prefetch", "navigation.instant.progress", "navigation.tracking", "navigation.top", "navigation.footer", "toc.follow", "content.code.copy"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script> <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script> </body> </html>