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, 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.

Release files for purl2vcs 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for purl2vcs 2.0.0
File Size Uploaded
purl2vcs-2.0.0.tar.gz 70.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for purl2vcs 2.0.0
File Interpreter ABI Platform
purl2vcs-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.9 kB

Release files / purl2vcs-2.0.0.tar.gz

Download URL purl2vcs-2.0.0.tar.gz
Size 70.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8e4c2052e45af3c501c6ed36ae481cc00f22898474886cf6836d6e2f103cdc3e
BLAKE2b-256 checksum
How to use checksums
45337710b29fa71aed5e5af78d88e4772aed0e52de6ebdea115ad2d6302f518a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / purl2vcs-2.0.0-py3-none-any.whl

Download URL purl2vcs-2.0.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91960acac0df3da593b13565e655790458ec93d296fca864ee1a72a27b9ecdbf
BLAKE2b-256 checksum
How to use checksums
4f361860aae45d44bbfcf7165fc95c5508c80f5045437e8edc68fb5eed9732c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page