All Projects → package-url → packageurl-python

package-url / packageurl-python

Licence: other
Python implementation of the package url spec

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to packageurl-python

cyclonedx-python
Creates CycloneDX Software Bill of Materials (SBOM) from Python projects and environments.
Stars: ✭ 78 (+200%)
Mutual labels:  purl, package-url
cyclonedx-php-composer
Create CycloneDX Software Bill of Materials (SBOM) from PHP Composer projects
Stars: ✭ 20 (-23.08%)
Mutual labels:  purl, package-url
packageurl-swift
Swift implementation of the package url spec
Stars: ✭ 21 (-19.23%)
Mutual labels:  purl, package-url
scancode.io
ScanCode.io is a server to script and automate software composition analysis pipelines with ScanPipe pipelines. This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ Google Summer of Code, nexB and others generous sponsors!
Stars: ✭ 66 (+153.85%)
Mutual labels:  purl, package-url
cyclonedx-dotnet
Creates CycloneDX Software Bill of Materials (SBOM) from .NET Projects
Stars: ✭ 110 (+323.08%)
Mutual labels:  purl, package-url
cyclonedx-cli
CycloneDX CLI tool for SBOM analysis, merging, diffs and format conversions.
Stars: ✭ 154 (+492.31%)
Mutual labels:  purl, package-url
cyclonedx-maven-plugin
Creates CycloneDX Software Bill of Materials (SBOM) from Maven projects
Stars: ✭ 103 (+296.15%)
Mutual labels:  purl, package-url

# packageurl-python

Python library to parse and build "purl" aka. Package URLs. See https://github.com/package-url/purl-spec for details.

Join the discussion at https://gitter.im/package-url/Lobby or enter a ticket for support.

License: MIT

Build and tests status

Linux (Travis) on Python 2 and 3
Linux Master branch tests status

Usage

>>> from packageurl import PackageURL
>>> purl = PackageURL.from_string("pkg:maven/org.apache.commons/[email protected]")
>>> print(purl.to_dict())
{'type': 'maven', 'namespace': 'org.apache.commons', 'name': 'io', 'version': '1.3.4', 'qualifiers': None, 'subpath': None}
>>> print(purl.to_string())
pkg:maven/org.apache.commons/[email protected]
>>> print(str(purl))
pkg:maven/org.apache.commons/[email protected]
>>> print(repr(purl))
PackageURL(type='maven', namespace='org.apache.commons', name='io', version='1.3.4', qualifiers={}, subpath=None)

Other utilities:

  • packageurl.contrib.django_models.PackageURLMixin is a Django abstract model mixin to use Package URLs in Django.
  • packageurl.contrib.purl2url.get_url(purl) returns the download URL inferred from a Package URL.
  • packageurl.contrib.url2purl.get_purl(url) returns a Package URL inferred from URL.

Install

pip install packageurl-python

Run tests

install:

python3 thirdparty/virtualenv.pyz --never-download --no-periodic-update .
bin/pip install -e ."[test]"

run tests:

bin/py.test tests

Make a new release

  • start a new release branch

  • update the CHANGELOG.rst and AUTHORS.rst

  • update README.rst if needed

  • bump version in setup.cfg

  • run all tests

  • install restview and validate that all .rst docs are correct

  • commit and push this branch

  • tag and push that tag

  • make a PR to merge branch

  • once merged, run:

    bin/pip install --upgrade pip wheel twine setuptools
    
  • delete the "dist" and "build" directories:

    rm -rf dist/ build/
    
  • create a source distribution and wheel with:

    bin/python setup.py sdist bdist_wheel
    
  • finally, upload to PyPI:

    bin/twine upload dist/*
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].