Skip to main content

purl2vcs is an add-on library working with the PurlDB to find the version control system (VCS) URL of a package and detect the commit, tags and path for a given version.

Project description

purl2vcs is an add-on library working with the PurlDB to find the version control system (VCS) URL of a package and detect the commit, and tags for a given version.

In the future, it will also find paths and branches, which is useful for monorepos.

Usage

  • First, import the main module: from purl2vcs import find_source_repo

  • To use the functions you first need to acquire some Package objects: Use the get_package_object_from_purl(package_url) passing a PURL string to get an object from the database

  • To find the source repository of a Package, call get_source_repo(package) to will get a PackageURL object back.

  • To generate all the source repository URLs of a Package, call get_repo_urls(package).

  • To convert a single source repo URLs to PURLs, call convert_repo_url_to_purls

  • To convert a list of source repo URLs to PURLs, call convert_repo_urls_to_purls

  • To find the commit or tags from a source repo PURL use get_tags_and_commits

  • The low level get_tags_and_commits is used in find_package_version_tag_and_commit to find the tag and commit of a given package version in a source repo PURL.

Installation

Requirements

  • install purldb dependencies

  • pip install purl2vcs

Funding

This project was funded through the NGI Assure Fund https://nlnet.nl/assure, a fund established by NLnet https://nlnet.nl/ with financial support from the European Commission’s Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 957073.

This project is also funded through grants from the Google Summer of Code program, continuing support and sponsoring from nexB Inc. and generous donations from multiple sponsors.

License

Copyright (c) nexB Inc. and others. All rights reserved.

purldb is a trademark of nexB Inc.

SPDX-License-Identifier: Apache-2.0

pur2vcs is licensed under the Apache License version 2.0.

See https://www.apache.org/licenses/LICENSE-2.0 for the license text.

See https://creativecommons.org/licenses/by-sa/4.0/legalcode for the license text.

See https://github.com/aboutcode-org/purldb for support or download.

See https://aboutcode.org for more information about nexB OSS projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

purl2vcs-2.0.0.tar.gz (70.8 kB view details)

Uploaded Source

Built Distribution

purl2vcs-2.0.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file purl2vcs-2.0.0.tar.gz.

File metadata

  • Download URL: purl2vcs-2.0.0.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for purl2vcs-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8e4c2052e45af3c501c6ed36ae481cc00f22898474886cf6836d6e2f103cdc3e
MD5 268f6aeee66c83b705632cc872188a8a
BLAKE2b-256 45337710b29fa71aed5e5af78d88e4772aed0e52de6ebdea115ad2d6302f518a

See more details on using hashes here.

File details

Details for the file purl2vcs-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: purl2vcs-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for purl2vcs-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91960acac0df3da593b13565e655790458ec93d296fca864ee1a72a27b9ecdbf
MD5 be348ae6878e9642308d66edd36aa40c
BLAKE2b-256 4f361860aae45d44bbfcf7165fc95c5508c80f5045437e8edc68fb5eed9732c1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page