purl 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -2
- data/CODE_OF_CONDUCT.md +1 -1
- data/LICENSE +21 -0
- data/README.md +273 -13
- data/Rakefile +385 -0
- data/lib/purl/errors.rb +64 -0
- data/lib/purl/package_url.rb +512 -0
- data/lib/purl/registry_url.rb +309 -0
- data/lib/purl/version.rb +1 -1
- data/lib/purl.rb +111 -1
- data/purl-types.json +358 -0
- data/test-suite-data.json +710 -0
- metadata +7 -1
data/purl-types.json
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"description": "PURL types and registry URL patterns for package ecosystems",
|
|
4
|
+
"source": "https://github.com/package-url/purl-spec/blob/main/PURL-TYPES.rst",
|
|
5
|
+
"last_updated": "2025-07-24",
|
|
6
|
+
"types": {
|
|
7
|
+
"alpm": {
|
|
8
|
+
"description": "Arch Linux and other users of the libalpm/pacman package manager"
|
|
9
|
+
},
|
|
10
|
+
"apk": {
|
|
11
|
+
"description": "APK-based packages"
|
|
12
|
+
},
|
|
13
|
+
"bitbucket": {
|
|
14
|
+
"description": "Bitbucket-based packages"
|
|
15
|
+
},
|
|
16
|
+
"bitnami": {
|
|
17
|
+
"description": "Bitnami-based packages"
|
|
18
|
+
},
|
|
19
|
+
"cargo": {
|
|
20
|
+
"description": "Rust packages",
|
|
21
|
+
"registry_config": {
|
|
22
|
+
"base_url": "https://crates.io/crates",
|
|
23
|
+
"route_patterns": [
|
|
24
|
+
"https://crates.io/crates/:name"
|
|
25
|
+
],
|
|
26
|
+
"reverse_regex": "^https://crates\\.io/crates/([^/?#]+)",
|
|
27
|
+
"components": {
|
|
28
|
+
"namespace": false,
|
|
29
|
+
"version_in_url": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"cocoapods": {
|
|
34
|
+
"description": "CocoaPods",
|
|
35
|
+
"registry_config": {
|
|
36
|
+
"base_url": "https://cocoapods.org/pods",
|
|
37
|
+
"route_patterns": [
|
|
38
|
+
"https://cocoapods.org/pods/:name"
|
|
39
|
+
],
|
|
40
|
+
"components": {
|
|
41
|
+
"namespace": false,
|
|
42
|
+
"version_in_url": false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"composer": {
|
|
47
|
+
"description": "Composer PHP packages",
|
|
48
|
+
"registry_config": {
|
|
49
|
+
"base_url": "https://packagist.org/packages",
|
|
50
|
+
"route_patterns": [
|
|
51
|
+
"https://packagist.org/packages/:namespace/:name"
|
|
52
|
+
],
|
|
53
|
+
"components": {
|
|
54
|
+
"namespace": true,
|
|
55
|
+
"namespace_required": true,
|
|
56
|
+
"version_in_url": false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"conan": {
|
|
61
|
+
"description": "Conan C/C++ packages"
|
|
62
|
+
},
|
|
63
|
+
"conda": {
|
|
64
|
+
"description": "Conda packages",
|
|
65
|
+
"registry_config": {
|
|
66
|
+
"base_url": "https://anaconda.org/conda-forge",
|
|
67
|
+
"route_patterns": [
|
|
68
|
+
"https://anaconda.org/conda-forge/:name"
|
|
69
|
+
],
|
|
70
|
+
"components": {
|
|
71
|
+
"namespace": false,
|
|
72
|
+
"version_in_url": false
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"cpan": {
|
|
77
|
+
"description": "CPAN Perl packages",
|
|
78
|
+
"registry_config": {
|
|
79
|
+
"base_url": "https://metacpan.org/dist",
|
|
80
|
+
"route_patterns": [
|
|
81
|
+
"https://metacpan.org/dist/:name"
|
|
82
|
+
],
|
|
83
|
+
"components": {
|
|
84
|
+
"namespace": false,
|
|
85
|
+
"version_in_url": false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"cran": {
|
|
90
|
+
"description": "CRAN R packages"
|
|
91
|
+
},
|
|
92
|
+
"deb": {
|
|
93
|
+
"description": "Debian, Debian derivatives, and Ubuntu packages"
|
|
94
|
+
},
|
|
95
|
+
"docker": {
|
|
96
|
+
"description": "Docker images"
|
|
97
|
+
},
|
|
98
|
+
"gem": {
|
|
99
|
+
"description": "RubyGems",
|
|
100
|
+
"registry_config": {
|
|
101
|
+
"base_url": "https://rubygems.org/gems",
|
|
102
|
+
"route_patterns": [
|
|
103
|
+
"https://rubygems.org/gems/:name",
|
|
104
|
+
"https://rubygems.org/gems/:name/versions/:version"
|
|
105
|
+
],
|
|
106
|
+
"reverse_regex": "^https://rubygems\\.org/gems/([^/?#]+)(?:/versions/([^/?#]+))?",
|
|
107
|
+
"components": {
|
|
108
|
+
"namespace": false,
|
|
109
|
+
"version_in_url": true,
|
|
110
|
+
"version_path": "/versions/"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"generic": {
|
|
115
|
+
"description": "Plain packages that do not fit anywhere else"
|
|
116
|
+
},
|
|
117
|
+
"github": {
|
|
118
|
+
"description": "GitHub-based packages"
|
|
119
|
+
},
|
|
120
|
+
"golang": {
|
|
121
|
+
"description": "Go packages",
|
|
122
|
+
"registry_config": {
|
|
123
|
+
"base_url": "https://pkg.go.dev",
|
|
124
|
+
"route_patterns": [
|
|
125
|
+
"https://pkg.go.dev/:namespace/:name",
|
|
126
|
+
"https://pkg.go.dev/:name"
|
|
127
|
+
],
|
|
128
|
+
"reverse_regex": "^https://pkg\\.go\\.dev/(?:([^/?#]+)/)?([^/?#]+)",
|
|
129
|
+
"components": {
|
|
130
|
+
"namespace": true,
|
|
131
|
+
"namespace_required": false,
|
|
132
|
+
"version_in_url": false
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"hackage": {
|
|
137
|
+
"description": "Haskell packages",
|
|
138
|
+
"registry_config": {
|
|
139
|
+
"base_url": "https://hackage.haskell.org/package",
|
|
140
|
+
"route_patterns": [
|
|
141
|
+
"https://hackage.haskell.org/package/:name",
|
|
142
|
+
"https://hackage.haskell.org/package/:name-:version"
|
|
143
|
+
],
|
|
144
|
+
"reverse_regex": "^https://hackage\\.haskell\\.org/package/([^/?#-]+)(?:-([^/?#]+))?",
|
|
145
|
+
"components": {
|
|
146
|
+
"namespace": false,
|
|
147
|
+
"version_in_url": true,
|
|
148
|
+
"version_separator": "-"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"hex": {
|
|
153
|
+
"description": "Hex packages",
|
|
154
|
+
"registry_config": {
|
|
155
|
+
"base_url": "https://hex.pm/packages",
|
|
156
|
+
"route_patterns": [
|
|
157
|
+
"https://hex.pm/packages/:name"
|
|
158
|
+
],
|
|
159
|
+
"components": {
|
|
160
|
+
"namespace": false,
|
|
161
|
+
"version_in_url": false
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"huggingface": {
|
|
166
|
+
"description": "Hugging Face ML models"
|
|
167
|
+
},
|
|
168
|
+
"luarocks": {
|
|
169
|
+
"description": "Lua packages installed with LuaRocks"
|
|
170
|
+
},
|
|
171
|
+
"maven": {
|
|
172
|
+
"description": "Maven JARs and related artifacts",
|
|
173
|
+
"registry_config": {
|
|
174
|
+
"base_url": "https://mvnrepository.com/artifact",
|
|
175
|
+
"route_patterns": [
|
|
176
|
+
"https://mvnrepository.com/artifact/:namespace/:name",
|
|
177
|
+
"https://mvnrepository.com/artifact/:namespace/:name/:version"
|
|
178
|
+
],
|
|
179
|
+
"reverse_regex": "^https://mvnrepository\\.com/artifact/([^/?#]+)/([^/?#]+)(?:/([^/?#]+))?",
|
|
180
|
+
"components": {
|
|
181
|
+
"namespace": true,
|
|
182
|
+
"namespace_required": true,
|
|
183
|
+
"version_in_url": true,
|
|
184
|
+
"version_path": "/"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"mlflow": {
|
|
189
|
+
"description": "MLflow ML models"
|
|
190
|
+
},
|
|
191
|
+
"npm": {
|
|
192
|
+
"description": "Node NPM packages",
|
|
193
|
+
"registry_config": {
|
|
194
|
+
"base_url": "https://www.npmjs.com/package",
|
|
195
|
+
"route_patterns": [
|
|
196
|
+
"https://www.npmjs.com/package/:namespace/:name",
|
|
197
|
+
"https://www.npmjs.com/package/:name",
|
|
198
|
+
"https://www.npmjs.com/package/:namespace/:name/v/:version",
|
|
199
|
+
"https://www.npmjs.com/package/:name/v/:version"
|
|
200
|
+
],
|
|
201
|
+
"reverse_regex": "^https://(?:www\\.)?npmjs\\.com/package/(?:(@[^/]+)/)?([^/?#]+)(?:/v/([^/?#]+))?",
|
|
202
|
+
"components": {
|
|
203
|
+
"namespace": true,
|
|
204
|
+
"namespace_required": false,
|
|
205
|
+
"namespace_prefix": "@",
|
|
206
|
+
"version_in_url": true,
|
|
207
|
+
"version_path": "/v/"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"nuget": {
|
|
212
|
+
"description": "NuGet .NET packages",
|
|
213
|
+
"registry_config": {
|
|
214
|
+
"base_url": "https://www.nuget.org/packages",
|
|
215
|
+
"route_patterns": [
|
|
216
|
+
"https://www.nuget.org/packages/:name",
|
|
217
|
+
"https://www.nuget.org/packages/:name/:version"
|
|
218
|
+
],
|
|
219
|
+
"components": {
|
|
220
|
+
"namespace": false,
|
|
221
|
+
"version_in_url": true,
|
|
222
|
+
"version_path": "/"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"oci": {
|
|
227
|
+
"description": "Artifacts stored in registries that conform to OCI Distribution Specification"
|
|
228
|
+
},
|
|
229
|
+
"pub": {
|
|
230
|
+
"description": "Dart and Flutter packages",
|
|
231
|
+
"registry_config": {
|
|
232
|
+
"base_url": "https://pub.dev/packages",
|
|
233
|
+
"route_patterns": [
|
|
234
|
+
"https://pub.dev/packages/:name"
|
|
235
|
+
],
|
|
236
|
+
"components": {
|
|
237
|
+
"namespace": false,
|
|
238
|
+
"version_in_url": false
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"pypi": {
|
|
243
|
+
"description": "Python packages",
|
|
244
|
+
"registry_config": {
|
|
245
|
+
"base_url": "https://pypi.org/project",
|
|
246
|
+
"route_patterns": [
|
|
247
|
+
"https://pypi.org/project/:name/",
|
|
248
|
+
"https://pypi.org/project/:name/:version/"
|
|
249
|
+
],
|
|
250
|
+
"reverse_regex": "^https://pypi\\.org/project/([^/?#]+)/?(?:([^/?#]+)/?)?",
|
|
251
|
+
"components": {
|
|
252
|
+
"namespace": false,
|
|
253
|
+
"version_in_url": true,
|
|
254
|
+
"version_path": "/",
|
|
255
|
+
"trailing_slash": true
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"qpkg": {
|
|
260
|
+
"description": "QNX packages"
|
|
261
|
+
},
|
|
262
|
+
"rpm": {
|
|
263
|
+
"description": "RPMs"
|
|
264
|
+
},
|
|
265
|
+
"swid": {
|
|
266
|
+
"description": "Software Identification (SWID) tags"
|
|
267
|
+
},
|
|
268
|
+
"swift": {
|
|
269
|
+
"description": "Swift packages",
|
|
270
|
+
"registry_config": {
|
|
271
|
+
"base_url": "https://swiftpackageindex.com",
|
|
272
|
+
"route_patterns": [
|
|
273
|
+
"https://swiftpackageindex.com/:namespace/:name"
|
|
274
|
+
],
|
|
275
|
+
"components": {
|
|
276
|
+
"namespace": true,
|
|
277
|
+
"namespace_required": true,
|
|
278
|
+
"version_in_url": false
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"deno": {
|
|
283
|
+
"description": "Deno packages",
|
|
284
|
+
"registry_config": {
|
|
285
|
+
"base_url": "https://deno.land/x",
|
|
286
|
+
"route_patterns": [
|
|
287
|
+
"https://deno.land/x/:name",
|
|
288
|
+
"https://deno.land/x/:name@:version"
|
|
289
|
+
],
|
|
290
|
+
"reverse_regex": "^https://deno\\.land/x/([^/?#@]+)(?:@([^/?#]+))?",
|
|
291
|
+
"components": {
|
|
292
|
+
"namespace": false,
|
|
293
|
+
"version_in_url": true,
|
|
294
|
+
"version_prefix": "@"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"homebrew": {
|
|
299
|
+
"description": "Homebrew packages",
|
|
300
|
+
"registry_config": {
|
|
301
|
+
"base_url": "https://formulae.brew.sh/formula",
|
|
302
|
+
"route_patterns": [
|
|
303
|
+
"https://formulae.brew.sh/formula/:name"
|
|
304
|
+
],
|
|
305
|
+
"reverse_regex": "^https://formulae\\.brew\\.sh/formula/([^/?#]+)",
|
|
306
|
+
"components": {
|
|
307
|
+
"namespace": false,
|
|
308
|
+
"version_in_url": false
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"bioconductor": {
|
|
313
|
+
"description": "Bioconductor packages",
|
|
314
|
+
"registry_config": {
|
|
315
|
+
"base_url": "https://bioconductor.org/packages",
|
|
316
|
+
"route_patterns": [
|
|
317
|
+
"https://bioconductor.org/packages/:name"
|
|
318
|
+
],
|
|
319
|
+
"components": {
|
|
320
|
+
"namespace": false,
|
|
321
|
+
"version_in_url": false
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"clojars": {
|
|
326
|
+
"description": "Clojars packages",
|
|
327
|
+
"registry_config": {
|
|
328
|
+
"base_url": "https://clojars.org",
|
|
329
|
+
"route_patterns": [
|
|
330
|
+
"https://clojars.org/:namespace/:name",
|
|
331
|
+
"https://clojars.org/:name"
|
|
332
|
+
],
|
|
333
|
+
"components": {
|
|
334
|
+
"namespace": true,
|
|
335
|
+
"namespace_required": false,
|
|
336
|
+
"version_in_url": false
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"elm": {
|
|
341
|
+
"description": "Elm packages",
|
|
342
|
+
"registry_config": {
|
|
343
|
+
"base_url": "https://package.elm-lang.org/packages",
|
|
344
|
+
"route_patterns": [
|
|
345
|
+
"https://package.elm-lang.org/packages/:namespace/:name/latest",
|
|
346
|
+
"https://package.elm-lang.org/packages/:namespace/:name/:version"
|
|
347
|
+
],
|
|
348
|
+
"reverse_regex": "^https://package\\.elm-lang\\.org/packages/([^/?#]+)/([^/?#]+)(?:/([^/?#]+))?",
|
|
349
|
+
"components": {
|
|
350
|
+
"namespace": true,
|
|
351
|
+
"namespace_required": true,
|
|
352
|
+
"version_in_url": true,
|
|
353
|
+
"default_version": "latest"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|