Identifier

BaseIdent

class fastobo.id.BaseIdent

A sequence of character used to refer to an OBO entity.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

PrefixedIdent

class fastobo.id.PrefixedIdent(BaseIdent)

An identifier with a prefix.

Example

>>> ident = fastobo.id.PrefixedIdent('GO', '0009637')
>>> ident.prefix
'GO'
>>> ident.local
'0009637'
>>> str(ident)
'GO:0009637'
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

local

the local part of the identifier.

Type

IdentLocal

prefix

the IDspace of the identifier.

Type

IdentPrefix

UnprefixedIdent

class fastobo.id.UnprefixedIdent(BaseIdent)

An identifier without a prefix.

Example

>>> import fastobo
>>> ident = fastobo.id.UnprefixedIdent("hello world")
>>> print(ident.escaped)
hello\ world
>>> print(ident.unescaped)
hello world
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

escaped

the escaped representation of the identifier.

Type

str

unescaped

the unescaped representation of the identifier.

Type

str

Url

class fastobo.id.Url(BaseIdent)

A URL used as an identifier.

Use str to retrieve a serialized string of the inner URL.

Example

>>> import fastobo
>>> id = fastobo.id.Url('http://purl.obolibrary.org/obo/GO_0070412')
>>> str(id)
'http://purl.obolibrary.org/obo/GO_0070412'
>>> fastobo.id.Url('created_by')
Traceback (most recent call last):
    ...
ValueError: invalid url: ...
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).