purl2vcs
==========
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "purl2vcs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "package-url, purl, git, version, hg, svn, tag, commit, open source, scan, package, dependency, sca",
"author": null,
"author_email": "\"nexB. Inc. and others\" <info@aboutcode.org>",
"download_url": "https://files.pythonhosted.org/packages/45/33/7710b29fa71aed5e5af78d88e4772aed0e52de6ebdea115ad2d6302f518a/purl2vcs-2.0.0.tar.gz",
"platform": null,
"description": "purl2vcs\n==========\n\npurl2vcs is an add-on library working with the PurlDB to find the version control system (VCS) URL\nof a package and detect the commit, and tags for a given version.\n\nIn the future, it will also find paths and branches, which is useful for monorepos.\n\nUsage\n-------\n\n- First, import the main module: ``from purl2vcs import find_source_repo``\n\n- To use the functions you first need to acquire some Package objects:\n Use the ``get_package_object_from_purl(package_url)`` passing a PURL string to get an object from\n the database\n\n- To find the source repository of a Package, call `get_source_repo(package)`\n to will get a PackageURL object back.\n\n- To generate all the source repository URLs of a Package, call `get_repo_urls(package)`.\n\n- To convert a single source repo URLs to PURLs, call ``convert_repo_url_to_purls``\n- To convert a list of source repo URLs to PURLs, call ``convert_repo_urls_to_purls``\n\n- To find the commit or tags from a source repo PURL use ``get_tags_and_commits``\n\n- The low level ``get_tags_and_commits`` is used in ``find_package_version_tag_and_commit`` to find\n the tag and commit of a given package ``version`` in a source repo PURL.\n\n\nInstallation\n------------\n\nRequirements\n############\n\n* install purldb dependencies\n* `pip install purl2vcs`\n\n\nFunding\n-------\n\nThis project was funded through the NGI Assure Fund https://nlnet.nl/assure, a\nfund established by NLnet https://nlnet.nl/ with financial support from the\nEuropean Commission's Next Generation Internet programme, under the aegis of DG\nCommunications Networks, Content and Technology under grant agreement No 957073.\n\nThis project is also funded through grants from the Google Summer of Code\nprogram, continuing support and sponsoring from nexB Inc. and generous\ndonations from multiple sponsors.\n\n\nLicense\n-------\n\nCopyright (c) nexB Inc. and others. All rights reserved.\n\npurldb is a trademark of nexB Inc.\n\nSPDX-License-Identifier: Apache-2.0\n\npur2vcs is licensed under the Apache License version 2.0.\n\nSee https://www.apache.org/licenses/LICENSE-2.0 for the license text.\n\nSee https://creativecommons.org/licenses/by-sa/4.0/legalcode for the license text.\n\nSee https://github.com/aboutcode-org/purldb for support or download.\n\nSee https://aboutcode.org for more information about nexB OSS projects.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "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.",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/aboutcode-org/purldb"
},
"split_keywords": [
"package-url",
" purl",
" git",
" version",
" hg",
" svn",
" tag",
" commit",
" open source",
" scan",
" package",
" dependency",
" sca"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4f361860aae45d44bbfcf7165fc95c5508c80f5045437e8edc68fb5eed9732c1",
"md5": "be348ae6878e9642308d66edd36aa40c",
"sha256": "91960acac0df3da593b13565e655790458ec93d296fca864ee1a72a27b9ecdbf"
},
"downloads": -1,
"filename": "purl2vcs-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "be348ae6878e9642308d66edd36aa40c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15053,
"upload_time": "2024-08-14T23:01:08",
"upload_time_iso_8601": "2024-08-14T23:01:08.245030Z",
"url": "https://files.pythonhosted.org/packages/4f/36/1860aae45d44bbfcf7165fc95c5508c80f5045437e8edc68fb5eed9732c1/purl2vcs-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "45337710b29fa71aed5e5af78d88e4772aed0e52de6ebdea115ad2d6302f518a",
"md5": "268f6aeee66c83b705632cc872188a8a",
"sha256": "8e4c2052e45af3c501c6ed36ae481cc00f22898474886cf6836d6e2f103cdc3e"
},
"downloads": -1,
"filename": "purl2vcs-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "268f6aeee66c83b705632cc872188a8a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 70805,
"upload_time": "2024-08-14T23:01:09",
"upload_time_iso_8601": "2024-08-14T23:01:09.911933Z",
"url": "https://files.pythonhosted.org/packages/45/33/7710b29fa71aed5e5af78d88e4772aed0e52de6ebdea115ad2d6302f518a/purl2vcs-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-14 23:01:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aboutcode-org",
"github_project": "purldb",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "aboutcode-toolkit",
"specs": [
[
"==",
"10.1.0"
]
]
},
{
"name": "arrow",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "asgiref",
"specs": [
[
"==",
"3.8.1"
]
]
},
{
"name": "attrs",
"specs": [
[
"==",
"24.2.0"
]
]
},
{
"name": "banal",
"specs": [
[
"==",
"1.0.6"
]
]
},
{
"name": "beartype",
"specs": [
[
"==",
"0.18.5"
]
]
},
{
"name": "beautifulsoup4",
"specs": [
[
"==",
"4.12.3"
]
]
},
{
"name": "binaryornot",
"specs": [
[
"==",
"0.4.4"
]
]
},
{
"name": "bitarray",
"specs": [
[
"==",
"2.9.2"
]
]
},
{
"name": "bleach",
"specs": [
[
"==",
"6.1.0"
]
]
},
{
"name": "boolean.py",
"specs": [
[
"==",
"4.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.7.4"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "chardet",
"specs": [
[
"==",
"5.2.0"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "clamd",
"specs": [
[
"==",
"1.0.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "colorama",
"specs": [
[
"==",
"0.4.6"
]
]
},
{
"name": "commoncode",
"specs": [
[
"==",
"31.2.1"
]
]
},
{
"name": "construct",
"specs": [
[
"==",
"2.10.70"
]
]
},
{
"name": "container-inspector",
"specs": [
[
"==",
"33.0.0"
]
]
},
{
"name": "crispy-bootstrap3",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "crontab",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "cryptography",
"specs": [
[
"==",
"43.0.0"
]
]
},
{
"name": "cyclonedx-python-lib",
"specs": [
[
"==",
"7.5.1"
]
]
},
{
"name": "debian_inspector",
"specs": [
[
"==",
"31.1.0"
]
]
},
{
"name": "defusedxml",
"specs": [
[
"==",
"0.7.1"
]
]
},
{
"name": "Deprecated",
"specs": [
[
"==",
"1.2.14"
]
]
},
{
"name": "Django",
"specs": [
[
"==",
"5.0.7"
]
]
},
{
"name": "django-crispy-forms",
"specs": [
[
"==",
"2.2"
]
]
},
{
"name": "django-environ",
"specs": [
[
"==",
"0.11.2"
]
]
},
{
"name": "django-filter",
"specs": [
[
"==",
"24.2"
]
]
},
{
"name": "django-probes",
"specs": [
[
"==",
"1.7.0"
]
]
},
{
"name": "django-rq",
"specs": [
[
"==",
"2.10.2"
]
]
},
{
"name": "django-taggit",
"specs": [
[
"==",
"5.0.1"
]
]
},
{
"name": "djangorestframework",
"specs": [
[
"==",
"3.15.2"
]
]
},
{
"name": "dockerfile-parse",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "dparse2",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "drf-spectacular",
"specs": [
[
"==",
"0.27.2"
]
]
},
{
"name": "elf-inspector",
"specs": [
[
"==",
"0.0.1"
]
]
},
{
"name": "et-xmlfile",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "extractcode",
"specs": [
[
"==",
"31.0.0"
]
]
},
{
"name": "extractcode-7z",
"specs": [
[
"==",
"16.5.210531"
]
]
},
{
"name": "extractcode-libarchive",
"specs": [
[
"==",
"3.5.1.210531"
]
]
},
{
"name": "fasteners",
"specs": [
[
"==",
"0.19"
]
]
},
{
"name": "fetchcode",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "fetchcode-container",
"specs": [
[
"==",
"1.2.3.210512"
]
]
},
{
"name": "fingerprints",
"specs": [
[
"==",
"1.2.3"
]
]
},
{
"name": "flot",
"specs": [
[
"==",
"0.7.2"
]
]
},
{
"name": "fontawesomefree",
"specs": [
[
"==",
"6.5.1"
]
]
},
{
"name": "freezegun",
"specs": [
[
"==",
"1.5.1"
]
]
},
{
"name": "ftfy",
"specs": [
[
"==",
"6.2.3"
]
]
},
{
"name": "ftputil",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "fusepy",
"specs": [
[
"==",
"3.0.1"
]
]
},
{
"name": "gemfileparser2",
"specs": [
[
"==",
"0.9.3"
]
]
},
{
"name": "gitdb",
"specs": [
[
"==",
"4.0.11"
]
]
},
{
"name": "GitPython",
"specs": [
[
"==",
"3.1.43"
]
]
},
{
"name": "go-inspector",
"specs": [
[
"==",
"0.2.2"
]
]
},
{
"name": "gunicorn",
"specs": [
[
"==",
"22.0.0"
]
]
},
{
"name": "html5lib",
"specs": [
[
"==",
"1.1"
]
]
},
{
"name": "htmllistparse",
"specs": [
[
"==",
"0.6.1"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "importlib_metadata",
"specs": [
[
"==",
"8.0.0"
]
]
},
{
"name": "inflection",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "intbitset",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "isodate",
"specs": [
[
"==",
"0.6.1"
]
]
},
{
"name": "jaraco.functools",
"specs": [
[
"==",
"4.0.2"
]
]
},
{
"name": "javaproperties",
"specs": [
[
"==",
"0.8.1"
]
]
},
{
"name": "jawa",
"specs": [
[
"==",
"2.2.0"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.4"
]
]
},
{
"name": "jsonschema",
"specs": [
[
"==",
"4.23.0"
]
]
},
{
"name": "jsonschema-specifications",
"specs": [
[
"==",
"2023.12.1"
]
]
},
{
"name": "jsonstreams",
"specs": [
[
"==",
"0.6.0"
]
]
},
{
"name": "license-expression",
"specs": [
[
"==",
"30.3.0"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"5.2.2"
]
]
},
{
"name": "Markdown",
"specs": [
[
"==",
"3.6"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"2.1.5"
]
]
},
{
"name": "matchcode-toolkit",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "mock",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"10.4.0"
]
]
},
{
"name": "natsort",
"specs": [
[
"==",
"8.4.0"
]
]
},
{
"name": "normality",
"specs": [
[
"==",
"2.5.0"
]
]
},
{
"name": "openpyxl",
"specs": [
[
"==",
"3.1.5"
]
]
},
{
"name": "packagedcode-msitools",
"specs": [
[
"==",
"0.101.210706"
]
]
},
{
"name": "packageurl-python",
"specs": [
[
"==",
"0.15.4"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.1"
]
]
},
{
"name": "packvers",
"specs": [
[
"==",
"21.5"
]
]
},
{
"name": "parameter-expansion-patched",
"specs": [
[
"==",
"0.3.1"
]
]
},
{
"name": "pdfminer.six",
"specs": [
[
"==",
"20240706"
]
]
},
{
"name": "pefile",
"specs": [
[
"==",
"2023.2.7"
]
]
},
{
"name": "pip",
"specs": [
[
"==",
"24.1"
]
]
},
{
"name": "pip-requirements-parser",
"specs": [
[
"==",
"32.0.1"
]
]
},
{
"name": "pkginfo2",
"specs": [
[
"==",
"30.0.0"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "plugincode",
"specs": [
[
"==",
"32.0.0"
]
]
},
{
"name": "ply",
"specs": [
[
"==",
"3.11"
]
]
},
{
"name": "psycopg",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "psycopg-binary",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "publicsuffix2",
"specs": [
[
"==",
"2.20191221"
]
]
},
{
"name": "py-serializable",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "pyahocorasick",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.22"
]
]
},
{
"name": "pyelftools",
"specs": [
[
"==",
"0.31"
]
]
},
{
"name": "PyGithub",
"specs": [
[
"==",
"2.3.0"
]
]
},
{
"name": "pygmars",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.18.0"
]
]
},
{
"name": "pyinstrument",
"specs": [
[
"==",
"4.6.2"
]
]
},
{
"name": "PyJWT",
"specs": [
[
"==",
"2.9.0"
]
]
},
{
"name": "pymaven-patch",
"specs": [
[
"==",
"0.3.2"
]
]
},
{
"name": "PyNaCl",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"3.1.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "python-inspector",
"specs": [
[
"==",
"0.12.0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.2"
]
]
},
{
"name": "rdflib",
"specs": [
[
"==",
"7.0.0"
]
]
},
{
"name": "redis",
"specs": [
[
"==",
"5.0.7"
]
]
},
{
"name": "referencing",
"specs": [
[
"==",
"0.35.1"
]
]
},
{
"name": "regipy",
"specs": [
[
"==",
"4.3.0"
]
]
},
{
"name": "reppy2",
"specs": [
[
"==",
"0.3.6"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "resolvelib",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "rpds-py",
"specs": [
[
"==",
"0.20.0"
]
]
},
{
"name": "rpm-inspector-rpm",
"specs": [
[
"==",
"4.16.1.3.210404"
]
]
},
{
"name": "rq",
"specs": [
[
"==",
"1.16.2"
]
]
},
{
"name": "rq-scheduler",
"specs": [
[
"==",
"0.13.1"
]
]
},
{
"name": "rubymarshal",
"specs": [
[
"==",
"1.0.3"
]
]
},
{
"name": "saneyaml",
"specs": [
[
"==",
"0.6.0"
]
]
},
{
"name": "scancode-toolkit",
"specs": []
},
{
"name": "scancodeio",
"specs": [
[
"==",
"34.7.1"
]
]
},
{
"name": "semantic-version",
"specs": [
[
"==",
"2.10.0"
]
]
},
{
"name": "semver",
"specs": [
[
"==",
"3.0.2"
]
]
},
{
"name": "setuptools",
"specs": [
[
"==",
"70.0.0"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "smmap",
"specs": [
[
"==",
"5.0.1"
]
]
},
{
"name": "sortedcontainers",
"specs": [
[
"==",
"2.4.0"
]
]
},
{
"name": "soupsieve",
"specs": [
[
"==",
"2.5"
]
]
},
{
"name": "source-inspector",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "spdx-tools",
"specs": [
[
"==",
"0.8.2"
]
]
},
{
"name": "sqlparse",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "text-unidecode",
"specs": [
[
"==",
"1.3"
]
]
},
{
"name": "toml",
"specs": [
[
"==",
"0.10.2"
]
]
},
{
"name": "tree-sitter",
"specs": [
[
"==",
"0.22.0"
]
]
},
{
"name": "tree-sitter-bash",
"specs": [
[
"==",
"0.21.0"
]
]
},
{
"name": "tree-sitter-c",
"specs": [
[
"==",
"0.21.1"
]
]
},
{
"name": "tree-sitter-cpp",
"specs": [
[
"==",
"0.22.0"
]
]
},
{
"name": "tree-sitter-go",
"specs": [
[
"==",
"0.21.0"
]
]
},
{
"name": "tree-sitter-java",
"specs": [
[
"==",
"0.21.0"
]
]
},
{
"name": "tree-sitter-javascript",
"specs": [
[
"==",
"0.21.2"
]
]
},
{
"name": "tree-sitter-python",
"specs": [
[
"==",
"0.21.0"
]
]
},
{
"name": "tree-sitter-rust",
"specs": [
[
"==",
"0.21.2"
]
]
},
{
"name": "typecode",
"specs": [
[
"==",
"30.0.2"
]
]
},
{
"name": "typecode-libmagic",
"specs": [
[
"==",
"5.39.210531"
]
]
},
{
"name": "types-python-dateutil",
"specs": [
[
"==",
"2.9.0.20240316"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "univers",
"specs": [
[
"==",
"30.11.0"
]
]
},
{
"name": "uritemplate",
"specs": [
[
"==",
"4.1.1"
]
]
},
{
"name": "uritools",
"specs": [
[
"==",
"4.0.3"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "urlpy",
"specs": [
[
"==",
"0.5"
]
]
},
{
"name": "wcwidth",
"specs": [
[
"==",
"0.2.13"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "wheel",
"specs": [
[
"==",
"0.43.0"
]
]
},
{
"name": "wrapt",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "XlsxWriter",
"specs": [
[
"==",
"3.2.0"
]
]
},
{
"name": "xmltodict",
"specs": [
[
"==",
"0.13.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.19.2"
]
]
}
],
"lcname": "purl2vcs"
}