
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
urnparse
Advanced tools
Python library for generating and parsing and RFC 8141 compliant uniform resource names (URN).
Python library for generating and parsing RFC 8141 compliant uniform resource names (URN).
To use this library in your project, install it with pip
pip install urnparse
To validate a given URN string against the RFC 8141 specification and construct
an URN object from it, use the URN8141.from_string() method:
from urnparse import URN8141
urn_string = 'urn:example:example.org:resources:'+\
'example%20resource?+res1=a'+\
'?=param1=test¶m2=test2#example.org'
urn = URN8141.from_string(urn_string)
You can then access the specific URN components:
print(urn.namespace_id)
# example
print(urn.specific_string.decoded)
# example.org:resources:example resource
print(urn.specific_string.parts)
# ['example.org', 'resources', 'example resource']
print(urn.rqf_component.resolution)
# {'res1': 'a'}
print(urn.rqf_component.query)
# {'param1': 'test', 'param2': 'test2'}
print(urn.rqf_component.fragment)
# example.org
To create an RFC 8141 formatted URN string for a certain resource, construct the URN object from the following components:
from urnparse import URN8141, NSIdentifier, NSSString, RQFComponent
nid = NSIdentifier('example')
nss = NSSString('example.org:resources:example%20resource', encoded=True)
rqf = RQFComponent(resolution_string='res1=a',
query_string='param1=test¶m2=test2',
fragment='example.org')
urn = URN8141(nid=nid, nss=nss, rqf=rqf)
print(urn)
# urn:example:example.org:resources:example%20resource?+res1=a?=param1=test¶m2=test2#example.org
FAQs
Python library for generating and parsing and RFC 8141 compliant uniform resource names (URN).
We found that urnparse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.