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)

name: str

Alias for field number 0

clstype: str

Alias for field number 1

message: str

Alias for field number 2

trace: str

Alias for field number 3

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.

name: str

The database name

version: str

The database current version

classname: str

The class that retrieved the version

vtype: VersionType

The version type

date: datetime.date | None

The date of the current release

homepage: str | None

The URL for the homepage of the specific version of the database

bioregistry_id: str | None

The database prefix

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

clear_cache() None[source]

Clear the cache.

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 false to 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 Bioversion instance.