Changeset View
Changeset View
Standalone View
Standalone View
swh/model/swhids.py
# Copyright (C) 2015-2021 The Software Heritage developers | # Copyright (C) 2015-2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
""" | |||||
Classes to represent :ref:`SWH persistend IDentifiers <persistent-identifiers>`. | |||||
:class:`CoreSWHID` represents a SWHID with no qualifier, and :class:`QualifiedSWHID` | |||||
represents a SWHID that may have qualifiers. | |||||
:class:`ExtendedSWHID` extends the definition of SWHID to other object types, | |||||
and is used internally in Software Heritage; it does not support qualifiers. | |||||
""" | |||||
from __future__ import annotations | from __future__ import annotations | ||||
import enum | import enum | ||||
import re | import re | ||||
from typing import Any, Dict, Generic, Optional, Tuple, Type, TypeVar, Union | from typing import Any, Dict, Generic, Optional, Tuple, Type, TypeVar, Union | ||||
import urllib.parse | import urllib.parse | ||||
import attr | import attr | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |