Skip to content

Commit ae95b81

Browse files
committed
added normalized text RID
1 parent 6772950 commit ae95b81

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "rid-lib"
7-
version = "3.2.8"
7+
version = "3.2.9"
88
description = "Implementation of Reference Identifiers (RIDs) protocol in Python"
99
authors = [
1010
{name = "Luke Miller", email = "[email protected]"}

src/rid_lib/types/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
from .slack_workspace import SlackWorkspace
55
from .slack_user import SlackUser
66
from .koi_net_node import KoiNetNode
7-
from .koi_net_edge import KoiNetEdge
7+
from .koi_net_edge import KoiNetEdge
8+
from .normalized_text import NormalizedText

src/rid_lib/types/koi_net_edge.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import json
2-
import hashlib
31
from rid_lib.core import ORN
4-
from .koi_net_node import KoiNetNode
52

63

74
class KoiNetEdge(ORN):
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from rid_lib.core import ORN, RID
2+
3+
4+
class NormalizedText(ORN):
5+
namespace = "normalized.text"
6+
7+
def __init__(self, wrapped_rid: RID):
8+
self.wrapped_rid = wrapped_rid
9+
10+
@property
11+
def reference(self):
12+
return str(self.wrapped_rid)
13+
14+
@classmethod
15+
def from_reference(cls, reference):
16+
return cls(RID.from_string(reference))

0 commit comments

Comments
 (0)