Translate Package URLs (PURLs) into validated download URLs for source code artifacts
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
PURL2SRC - Package URL (PURL) to Source
Translate Package URLs (PURLs) into validated download URLs for source code artifacts.
Features
- Multi-ecosystem support: NPM, PyPI, Cargo, NuGet, GitHub, Maven, RubyGems, Go, Conda, and more
- Three-level resolution strategy:
- Direct URL construction based on known patterns
- Package registry API queries
- Local package manager fallback
- URL validation: Verify download URLs are accessible
- Batch processing: Process multiple PURLs from files
- Multiple output formats: JSON, CSV, or plain text
- Extensible architecture: Easy to add new package ecosystems
Installation
pip install semantic-copycat-purl2src
Usage
Command Line
# Single PURL (default text output)
purl2src "pkg:npm/express@4.17.1"
# Output: pkg:npm/express@4.17.1 -> https://registry.npmjs.org/express/-/express-4.17.1.tgz
# JSON output format
purl2src "pkg:npm/express@4.17.1" --format json
# With validation
purl2src "pkg:pypi/requests@2.28.0" --validate
# Batch processing from file
purl2src -f purls.txt --output results.json
# Batch processing with JSON to stdout
purl2src -f purls.txt --format json
Python API
from purl2src import get_download_url
# Get download URL for a PURL
result = get_download_url("pkg:npm/express@4.17.1")
print(result.download_url)
# https://registry.npmjs.org/express/-/express-4.17.1.tgz
# Without validation (faster)
result = get_download_url("pkg:pypi/requests@2.28.0", validate=False)
Supported Ecosystems
| Ecosystem | PURL Type | Example |
|---|---|---|
| NPM | npm |
pkg:npm/@angular/core@12.0.0 |
| PyPI | pypi |
pkg:pypi/django@4.0.0 |
| Cargo | cargo |
pkg:cargo/serde@1.0.0 |
| NuGet | nuget |
pkg:nuget/Newtonsoft.Json@13.0.1 |
| Maven | maven |
pkg:maven/org.apache.commons/commons-lang3@3.12.0 |
| RubyGems | gem |
pkg:gem/rails@7.0.0 |
| Go | golang |
pkg:golang/github.com/gin-gonic/gin@v1.8.0 |
| GitHub | github |
pkg:github/facebook/react@v18.0.0 |
| Conda | conda |
pkg:conda/numpy@1.23.0?channel=conda-forge&subdir=linux-64&build=py39h1234567_0 |
| Generic | generic |
pkg:generic/package@1.0.0?download_url=https://example.com/file.tar.gz |
Examples
NPM with Scoped Package
purl2src "pkg:npm/@angular/core@12.0.0"
# Output: https://registry.npmjs.org/@angular/core/-/core-12.0.0.tgz
Maven with Classifier
purl2src "pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?classifier=sources"
# Output: https://repo.maven.apache.org/maven2/org/apache/xmlgraphics/batik-anim/1.9.1/batik-anim-1.9.1-sources.jar
Generic with Checksum Validation
purl2src "pkg:generic/mypackage@1.0.0?download_url=https://example.com/pkg.tar.gz&checksum=sha256:abcd1234..."
License
Apache License 2.0 - see LICENSE file for details
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semantic_copycat_purl2src-1.2.2.tar.gz.
File metadata
- Download URL: semantic_copycat_purl2src-1.2.2.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a543710f40d92ac6f944042149a07b039c6287eb9f9a636ed481afe1c31a6a2c
|
|
| MD5 |
0ef8a30e851d474a511176051fd566db
|
|
| BLAKE2b-256 |
130a4ad941df4d90f8c99f9dfefe42b203c97490fb52448d33ac3a7edcf2f153
|
Provenance
The following attestation bundles were made for semantic_copycat_purl2src-1.2.2.tar.gz:
Publisher:
python-publish.yml on oscarvalenzuelab/semantic-copycat-purl2src
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semantic_copycat_purl2src-1.2.2.tar.gz -
Subject digest:
a543710f40d92ac6f944042149a07b039c6287eb9f9a636ed481afe1c31a6a2c - Sigstore transparency entry: 630903411
- Sigstore integration time:
-
Permalink:
oscarvalenzuelab/semantic-copycat-purl2src@0fe782281d56498a46966f3289bd0eee4f39758e -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/oscarvalenzuelab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0fe782281d56498a46966f3289bd0eee4f39758e -
Trigger Event:
release
-
Statement type:
File details
Details for the file semantic_copycat_purl2src-1.2.2-py3-none-any.whl.
File metadata
- Download URL: semantic_copycat_purl2src-1.2.2-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a152082960dc89224568bc0b41981b6cc1d8de79ef58ea155cbd27121895250
|
|
| MD5 |
5a3c02dae61e2ee1edb49a5b9cbf4efe
|
|
| BLAKE2b-256 |
00e34d9d30685ed28ddb3e17cd8b5dbaa636de73977dbd04cc6425ad94baa785
|
Provenance
The following attestation bundles were made for semantic_copycat_purl2src-1.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on oscarvalenzuelab/semantic-copycat-purl2src
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semantic_copycat_purl2src-1.2.2-py3-none-any.whl -
Subject digest:
6a152082960dc89224568bc0b41981b6cc1d8de79ef58ea155cbd27121895250 - Sigstore transparency entry: 630903445
- Sigstore integration time:
-
Permalink:
oscarvalenzuelab/semantic-copycat-purl2src@0fe782281d56498a46966f3289bd0eee4f39758e -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/oscarvalenzuelab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0fe782281d56498a46966f3289bd0eee4f39758e -
Trigger Event:
release
-
Statement type: