NSID (NameSpaced ID)#

NameSpaced IDs (NSIDs) are used throughout ATP to identify methods, records types, and other semantic information.

NSIDs use Reverse Domain-Name Notation with the additional constraint that the segments prior to the final segment must map to a valid domain name. For instance, the owner of example.com could use the ID of com.example.foo but could not use com.example.foo.bar unless they also control foo.example.com. These rules are to ensure that schemas are globally unique, have a clear authority mapping (to a registered domain), and can potentially be resolved by request.

More info: https://atproto.com/specs/nsid

class atproto.nsid.NSID(segments: ~typing.List[str] = <factory>)#

Bases: object

NameSpaced IDs (NSIDs).





property authority: str#

Get authority of NSID.

com.example.thing ^^^^^^^^^^^——–> example.com

delim joined self.segments[:-1][::-1]

classmethod from_str(nsid: str) NSID#

Create NSID instance from string.

property name: str#

Get name.

segments: List[str]#
atproto.nsid.get_nsid_segments(nsid: str) List[str]#
atproto.nsid.validate_nsid(nsid: str, *, soft_fail: bool = False) bool#

Validate NSID.

  • nsid – NSID to validate.

  • soft_fail – enable to return False on fall instead of exception


Validation result.

Return type:



atproto.exceptions.InvalidNsidError – Invalid NSID exception.