A purl aka. Package URL parser and builder
Project description
# 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 |
---|
Usage
>>> from packageurl import PackageURL >>> purl = PackageURL.from_string("pkg:maven/org.apache.commons/io@1.3.4") >>> 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/io@1.3.4 >>> print(str(purl)) pkg:maven/org.apache.commons/io@1.3.4 >>> 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/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for packageurl-python-0.9.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675e0ec8058fa0837a0405047178bdea6a7d0b46966983fa79e1c0a1afab1c9e |
|
MD5 | 6cf02075d11b21e4234f7e3be731d4da |
|
BLAKE2b-256 | 60fd09f5df3935db11417aee20b179908c21b383dc73e57cc0438c955b61121f |
Hashes for packageurl_python-0.9.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3545c89efb19ef26246c69201c748e60e4395a055b83347760064853b60eb9d7 |
|
MD5 | c2515be8d84ee008824033c2f4e13864 |
|
BLAKE2b-256 | 9f1eb791345c2d78889dcc693fed6acdf8f42915f427e3244a8f0c021bd6b151 |