We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently there is a method to_dict() but there is no equivalent from_dict(). It might be useful to have this as well (use case: templating).
to_dict()
from_dict()
The text was updated successfully, but these errors were encountered:
@armijnhemel you can already provide a dict to the PackageURL class using the ** unpacking operator:
PackageURL
**
>>> from packageurl import PackageURL >>> purl = PackageURL.from_string("pkg:type/namespace/[email protected]") >>> purl_as_dict = purl.to_dict() >>> purl_as_dict {'type': 'type', 'namespace': 'namespace', 'name': 'name', 'version': '1.0', 'qualifiers': None, 'subpath': None} >>> purl_from_dict = PackageURL(**purl_as_dict) >>> str(purl_from_dict) 'pkg:type/namespace/[email protected]'
Note that you can use this method with any Python class.
Sorry, something went wrong.
No branches or pull requests
Currently there is a method
to_dict()
but there is no equivalentfrom_dict()
. It might be useful to have this as well (use case: templating).The text was updated successfully, but these errors were encountered: