Skip to content

Add PURL_TYPES and enforce validation of pURL types #188

New issue

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kdeldycke
Copy link

This PR adds a comprehensive list of all pURL types that are referenced in https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst

It also enforces the validation of a pURL type.

For context, I made this list for my Meta Package Manager project, which is mapping pURL types to package managers.

Closes: #181

@kdeldycke kdeldycke changed the title Add PURL_TYPES and enforce validation of PackageURL types Add PURL_TYPES and enforce validation of pURL types May 31, 2025
@kdeldycke
Copy link
Author

An improvement of this PR would be to use a enum.StrEnum class to reference all these types, so they can be used as constants.

enum.StrEnum being available starting with Python v3.11, we can add the optional StrEnum dependency for python_version < 3.11.

kdeldycke added a commit to kdeldycke/meta-package-manager that referenced this pull request May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the PURL library for Python to support all PURL-TYPES
1 participant