NormalizedReference
- class NormalizedReference(*, prefix: Prefix, identifier: str)[source]
Bases:
ReferenceExtends
curies.Referenceto normalize the prefix against the Bioregistry.>>> NormalizedReference(prefix="go", identifier="0032571") NormalizedReference(prefix='go', identifier='0032571')
With a name:
>>> NormalizedReference(prefix="go", identifier="0032571") NormalizedReference(prefix='go', identifier='0032571')
Standardizes capitalization to lowercase:
>>> NormalizedReference(prefix="GO", identifier="0032571") NormalizedReference(prefix='go', identifier='0032571')
Standardizes prefix synonyms to lowercase:
>>> NormalizedReference(prefix="GOBP", identifier="0032571") NormalizedReference(prefix='go', identifier='0032571')
If you’re deriving a model, then pass a string, this can still work
>>> from pydantic import BaseModel >>> class Derived(BaseModel): ... reference: NormalizedReference >>> Derived(reference="go:0032571") Derived(reference=NormalizedReference(prefix='go', identifier='0032571'))
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
validate_identifier(values)Validate the identifier.
Attributes Documentation
- model_config = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation