Expand description
§Upstream Ontologist
The upstream ontologist provides a common interface for finding metadata about upstream software projects.
It will gather information from any sources available, prioritize data that it has higher confidence in as well as report the confidence for each of the bits of metadata.
The ontologist originated in Debian and the currently reported metadata fields are loosely based on DEP-12, but it is meant to be distribution-agnostic.
§Provided Fields
Standard fields:
Name: human name of the upstream projectContact: contact address of some sort of the upstream (e-mail, mailing list URL)Repository: VCS URLRepository-Browse: Web URL for viewing the VCSBug-Database: Bug database URL (for web viewing, generally)Bug-Submit: URL to use to submit new bugs (either on the web or an e-mail address)Screenshots: List of URLs with screenshotsArchive: Archive used - e.g. SourceForgeSecurity-Contact: e-mail or URL with instructions for reporting security issuesDocumentation: Link to documentation on the webChangelog: URL to the changelogFAQ: URL to the FAQDonation: URL to a donation pageFunding: List of sources of funding for the project
Extensions for upstream-ontologist, not defined in DEP-12:
SourceForge-Project: sourceforge project nameWiki: Wiki URLSummary: one-line description of the projectDescription: longer description of the projectLicense: Single line license (e.g. “GPL 2.0”)Copyright: List of copyright holdersVersion: Current upstream versionSecurity-MD: URL to markdown file with security policyAuthor: List of people who contributed to the projectMaintainer: The maintainer of the projectHomepage: homepage URL (present indebian/controlin Debian packages)
§Supported Data Sources
At the moment, the ontologist can read metadata from the following upstream data sources:
- Python package metadata (PKG-INFO, setup.py, setup.cfg, pyproject.timl)
- package.json
- composer.json
- package.xml
- Perl package metadata (dist.ini, META.json, META.yml, Makefile.PL)
- Perl POD files
- GNU configure files
- R DESCRIPTION files
- Rust Cargo.toml
- Maven pom.xml
- metainfo.xml
- .git/config
- SECURITY.md
- DOAP
- Haskell cabal files
- go.mod
- ruby gemspec files
- nuspec files
- OPAM files
- Debian packaging metadata (debian/watch, debian/control, debian/rules, debian/get-orig-source.sh, debian/copyright, debian/patches)
- Dart’s pubspec.yaml
- meson.build
It will also scan README and INSTALL for possible upstream repository URLs (and will attempt to verify that those match the local repository).
In addition to local files, it can also consult external directories using their APIs:
§Example Usage
The easiest way to use the upstream ontologist is by invoking the
guess-upstream-metadata command in a software project:
$ guess-upstream-metadata ~/src/dulwich
Security-MD: https://github.com/dulwich/dulwich/tree/HEAD/SECURITY.md
Name: dulwich
Version: 0.20.15
Bug-Database: https://github.com/dulwich/dulwich/issues
Repository: https://www.dulwich.io/code/
Summary: Python Git Library
Bug-Submit: https://github.com/dulwich/dulwich/issues/newAlternatively, there is a Python API as part of the upstream_ontologist
Python package. There are also
autocodemeta and autodoap commands that
can generate output in the codemeta and
DOAP formats, respectively.
§Reporting bugs
When reporting bugs, please include the observed output of the guess-upstream-metadata
command, the version of the upstream-ontologist package you are using, what
output you were expecting, and ideally the location of the upstream source code
you are using (e.g. a URL to a Git repository).
If there are additional metadata fields you would like to see supported, please let us know - either with or without a patch.
Similarly, if you have a new data source you would like to see supported, please file a bug and we can discuss how to add it.
Modules§
- extrapolate
- Functionality for extrapolating upstream metadata from various sources
- forges
- Support for various code forges (GitHub, GitLab, etc.)
- github
- GitHub API and raw file access helpers Helpers for accessing the GitHub API and raw repository files.
- homepage
- Homepage URL detection and validation
- http
- HTTP utilities for fetching remote resources
- providers
- Various metadata providers for different programming languages and ecosystems
- readme
- README file parsing and metadata extraction
- repology
- Integration with Repology package repository aggregator
- vcs
- Version control system utilities and URL handling
- vcs_
command - Command-line interface for version control operations
Structs§
- Environment
Guesser - Guesser that extracts metadata from environment variables
- GitHub
- GitHub forge implementation
- GitLab
- GitLab forge implementation
- Guesser
Settings - Settings for upstream metadata guessers
- Launchpad
- Launchpad forge implementation
- Parse
Error - Path
Guesser - Guesser that extracts metadata from a specific file path
- Path
Segment Error - Error when manipulating URL path segments
- Person
- Represents a person (author, maintainer, etc.) with optional contact information
- Source
Forge - SourceForge forge implementation
- Upstream
Datum With Metadata - Upstream datum with additional metadata about its origin and certainty
- Upstream
Metadata - Collection of upstream metadata with convenience methods for accessing specific fields
- Upstream
Metadata Guesser - A guesser that can extract upstream metadata from a specific file
Enums§
- BugTracker
- A bug tracker for an upstream project.
- Canonicalize
Error - Errors that can occur when canonicalizing URLs
- Certainty
- Certainty levels for the data
- HTTPJSON
Error - Errors that can occur when loading JSON from HTTP
- Origin
- Origin of the data
- Provider
Error - Errors that can occur when fetching metadata from providers
- Upstream
Datum - Represents various types of upstream metadata for a software project
Traits§
- Forge
- Trait for different code forges (GitHub, GitLab, etc.)
- Third
Party Repository - Trait for third-party repositories that can provide upstream metadata
- Upstream
Data Provider - Trait for providing upstream metadata
Functions§
- bug_
database_ from_ issue_ url - Extracts the bug database URL from an issue URL
- bug_
database_ url_ from_ bug_ submit_ url - Derives a bug database URL from a bug submission URL
- bug_
submit_ url_ from_ bug_ database_ url - Derives a bug submission URL from a bug database URL
- check_
bug_ database_ canonical - Checks if a bug database URL is canonical
- check_
bug_ submit_ url_ canonical - Checks if a bug submission URL is canonical
- check_
upstream_ metadata - Check upstream metadata.
- check_
url_ canonical - Checks if a URL is canonical by following redirects
- extend_
upstream_ metadata - Extends upstream metadata with additional information from external sources
- extract_
hackage_ package - Extracts the Hackage package name from a URL
- extract_
pecl_ package_ name - Extracts the PECL package name from a URL
- find_
forge - Determines which forge a URL belongs to
- fix_
upstream_ metadata - Fix existing upstream metadata.
- get_
repology_ metadata - Fetches metadata from the Repology API for a given source package
- get_
upstream_ info - Gets upstream information for a project
- guess_
bug_ database_ url_ from_ repo_ url - Guesses the bug database URL from a repository URL
- guess_
from_ environment - Extracts upstream metadata from environment variables
- guess_
from_ path - Guesses upstream metadata from a file or directory path
- guess_
from_ travis_ yml - Extracts upstream metadata from a Travis CI configuration file
- guess_
upstream_ metadata - Guess the upstream metadata dictionary.
- guess_
upstream_ metadata_ items - Guess upstream metadata items, in no particular order.
- load_
json_ url - Loads JSON data from a URL with optional timeout
- metadata_
from_ url - Obtain metadata from a URL related to the project
- repo_
url_ from_ merge_ request_ url - Extracts the repository URL from a merge request URL
- summarize_
upstream_ metadata - Summarize the upstream metadata into a dictionary.
- update_
from_ guesses - Updates metadata collection with new guesses based on certainty levels
- upstream_
metadata_ stream - Creates a stream of upstream metadata by running all applicable guessers
- verify_
screenshots - Verifies that screenshot URLs are accessible
- with_
path_ segments - Creates a new URL with the specified path segments