Usage
What’s the current version for each biological database?
- class VersionFailure(name: str, clstype: str, message: str, trace: str)[source]
Holds information about failures.
Create new instance of VersionFailure(name, clstype, message, trace)
- class VersionResult(*, name: str, version: str, classname: str, vtype: VersionType, date: date | None, homepage: str | None, bioregistry_id: str | None)[source]
A dataclass for information about a database and version.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- vtype: VersionType
The version type
- date: datetime.date | None
The date of the current release
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- get_rows(*, use_tqdm: bool | None = False) list[VersionResult][source]
Get the rows, refreshing once per day.
- get_version(name: str | type[Getter], *, strict: Literal[True] = True) str[source]
- get_version(name: str | type[Getter], *, strict: Literal[False] = True) str | None
Resolve a database name to its version string.
- Parameters:
name – The name of the resource to get the version from. Often, this is a Bioregistry prefix, but sometimes can be an ad-hoc key for a database.
strict – Re-raises errors in version resolution by default. Set explicitly to
falseto return None on errors.
- Returns:
The version of the resource as a string
- iter_versions(*, use_tqdm: bool | None = False) Iterable[VersionResult | VersionFailure][source]
Iterate over versions, without caching.
- resolve(name: str | type[Getter], strict: Literal[False] = True) VersionResult | None[source]
- resolve(name: str | type[Getter], strict: Literal[True] = True) VersionResult
Resolve the database name to a
Bioversioninstance.