API reference
The module currently exports no names; these documented interfaces are accessed through Repology. All module docstrings are included below, with full docstring coverage checked by Documenter.
Repology.Identification — Type
Identification(project, version, provenance)The result of identify: a Repology project name and an upstream version, either of which may be nothing, along with a provenance string describing how the result was obtained (see PROVENANCES).
Repology.VersionScheme — Type
VersionScheme(kind, flags, curated, features)How a project's versions compare. kind is :libversion (compared with flags) or :semver (compared as VersionNumbers). A curated scheme comes from version_scheme and/or version_flags in additional_info.toml and is trusted for all versions. Otherwise the scheme is inferred from the versions Repology knows about, and features lists the ambiguous version features (see version_features) the project uses in its releases.
Repology.PROVENANCES — Constant
PROVENANCESThe possible values of Identification's provenance, in the order they are attempted. When a version is identified, the provenance describes how the version was found; otherwise it describes how the project was found.
"override": a hand-verified source (URL and optional commit) in a project'ssourcesinadditional_info.toml"url-pattern": a curated URL pattern inadditional_info.toml"repology-url": an exact (or normalized) match of a download URL in Repology's data"tag-scheme": a forge (e.g., GitHub) URL whose repository is known and whose tag parses as a version"git-tag": a repository URL and commit, where the commit is tagged with a tag that parses as a version"repository": a known repository, but no version could be determined"heuristic": a URL that matches the shape of a known download URL with a different version number
Repology.data_dir — Method
data_dir()The directory with the data exported from Repology's database dump (repositories.toml, downloads.toml and cpes.toml). It's the repology_data artifact, or the REPOLOGY_DATA environment variable if set (used when testing a refresh before it's published).
Repology.forge_repository — Method
(repo, tag) = forge_repository(url)Split a GitHub or GitLab URL into the repository URL and a tag (or nothing) if the URL is a release download or a tag archive.
Repology.get_tag_from_commit — Method
get_tag_from_commit(repo, commit; git_cache, include_parent=true)Clone repo (without blobs) and return the newline-separated tags that point at commit (or its first parent), or nothing if there are none.
Repology.identify — Method
identify(url; commit=nothing, use_overrides=true)Identify the upstream Repology project and version for a source URL. If the URL is a git repository, also pass the commit to look up its version via tags. Returns an Identification; see PROVENANCES for the order in which identification is attempted. Versions are only returned when they look like plausible version numbers for the identified project.
Note that identifying versions from commits requires network access to the repository.
Repology.identify_upstream — Method
(project, version) = identify_upstream(url, hash)Given a URL and a hash, attempt to identify the upstream project and version using data from Repology.
If no project is found, returns (nothing, nothing), and it may return (proj, nothing) if no version info is available. This is a thin wrapper around identify, which also reports the provenance of the identification.
Note that for repositories, it will attempt to download the git repository for versioning/tag information.
Repology.is_plausible_version — Method
is_plausible_version(project, version)Check that version looks like a version number and is consistent with the versions Repology knows about for project. Versions must start with a digit and must not contain underscores, slashes or whitespace (these are signs of a munged tag name). If Repology knows at least three versions of the project, then the leading number of the version must not exceed the largest known leading number by more than one. Repology only knows about currently-packaged versions, so older versions are not rejected.
Repology.normalize_url — Method
normalize_url(url)Given a URL, strip the scheme (e.g., https:// or git://) and known/common extension suffixes
Repology.tag_project — Method
The first of projs whose curated tag_patterns match tag, if any
Repology.tags_for_commit — Method
tags_for_commit(repo, commit)Return the tag names that point at commit in repo (or, failing that, at its first parent).
Repology.vercmp — Method
vercmp(a, b; flags=0, a_flags=flags, b_flags=flags)Compare two version strings with libversion, the comparator Repology uses, returning -1, 0, or 1. This ignores any project-specific version scheme; see vercmp(project, a, b).
Repology.vercmp — Method
vercmp(project, a, b)Compare two upstream versions of project according to its version_scheme, returning -1, 0, 1, or nothing if the scheme cannot order them. Versions without ambiguous parts (like 1.2.3 or 1.2.3-rc1) are always compared. Otherwise, unless the scheme is curated, every ambiguous part (see version_features) must also appear in the project's known releases; e.g., 7.1.2-1 is only compared if the project has released versions with a hyphenated number.
Repology.version_features — Method
version_features(version)The parts of version whose ordering depends on the project's version scheme:
:hyphen_number: a number after a hyphen, like7.1.2-1. libversion (and ImageMagick) order this after7.1.2, but SemVer orders it before (as a pre-release).:p_number:pfollowed by a number, like OpenSSH's9.2p1. libversion orders this before9.2unless givenP_IS_PATCH.:letter_suffix: a single letter after a number, like OpenSSL's1.0.2u. libversion orders this after1.0.2.:word: any other word, like1.2a1or1.2foo. libversion orders these before1.2unless givenANY_IS_PATCH.
Pre-release (alpha, beta, rc, pre, dev) and post-release (post, patch, pl, errata) words are not ambiguous.
Repology.version_from_tag — Method
version_from_tag(project, tag)Parse a version number out of a git tag name, using the project's tag_patterns from additional_info.toml if it has them, or a generic parser otherwise. The generic parser finds the first token (after a prefix like v, R_, REL_, openssl-, or Release-) that is entirely a version number, where the numeric components may be separated by any one of ., _ or - (normalized to .), followed by an optional qualifier like p1, rc2, or -stable (release qualifiers like -stable are dropped). Returns nothing if the result is not plausible.
Repology.version_scheme — Method
version_scheme(project)The VersionScheme for project, either curated in additional_info.toml or inferred from the versions Repology knows about.