aiida_restapi.routers package#
Subpackages#
Submodules#
aiida_restapi.routers.auth module#
Handle API authentication and authorization.
- class aiida_restapi.routers.auth.Token(*, access_token, token_type)[source]#
Bases:
BaseModel- __abstractmethods__ = frozenset({})#
- __annotations__ = {'access_token': 'str', 'token_type': 'str'}#
- __class_vars__ = {}#
The names of the class variables defined on the model.
- __dict__#
- __module__ = 'aiida_restapi.routers.auth'#
- __private_attributes__ = {}#
Metadata about the private attributes of the model.
- __pydantic_complete__ = True#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_computed_fields__ = {}#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_core_schema__ = {'cls': <class 'aiida_restapi.routers.auth.Token'>, 'config': {'title': 'Token'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'aiida_restapi.routers.auth.Token'>>]}, 'ref': 'aiida_restapi.routers.auth.Token:102854668793200', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'access_token': {'metadata': {}, 'schema': {'type': 'str'}, 'type': 'model-field'}, 'token_type': {'metadata': {}, 'schema': {'type': 'str'}, 'type': 'model-field'}}, 'model_name': 'Token', 'type': 'model-fields'}, 'type': 'model'}#
The core schema of the model.
- __pydantic_custom_init__ = False#
Whether the model has a custom __init__ method.
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_extra__#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- __pydantic_extra_info__ = None#
A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.
This is a private attribute, not meant to be used outside Pydantic.
- __pydantic_fields__ = {'access_token': FieldInfo(annotation=str, required=True), 'token_type': FieldInfo(annotation=str, required=True)}#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.
- __pydantic_fields_set__#
The names of fields explicitly set during instantiation.
- __pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#
A dictionary containing metadata about generic Pydantic models.
The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
- __pydantic_parent_namespace__ = None#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__ = None#
The name of the post-init method for the model, if defined.
- __pydantic_private__#
Values of private attributes set on the model instance.
- __pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff3570, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff3570, ), serializer: Model( ModelSerializer { class: Py( 0x00005d8bb7ff3570, ), serializer: Fields( GeneralFieldsSerializer { fields: { "token_type": SerField { key: "token_type", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "access_token": SerField { key: "access_token", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 2, }, ), has_extra: false, root_model: false, name: "Token", }, ), enabled_from_config: false, }, ), enabled_from_config: false, }, ), definitions=[])#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_setattr_handlers__ = {}#
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- __pydantic_validator__ = SchemaValidator(title="Token", validator=Model( ModelValidator { revalidate: Never, validator: ModelFields( ModelFieldsValidator { fields: [ Field { name: "access_token", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "access_token", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, Field { name: "token_type", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "token_type", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, ], model_name: "Token", extra_behavior: Ignore, extras_validator: None, extras_keys_validator: None, strict: false, from_attributes: false, loc_by_alias: true, lookup: LookupTree { inner: { PathItemString( "access_token", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "token_type", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x00005d8bb7ff3570, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x0000781933fd64d0, ), name: "Token", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- __signature__ = <Signature (*, access_token: str, token_type: str) -> None>#
The synthesized __init__ [Signature][inspect.Signature] of the model.
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- access_token#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- token_type#
- class aiida_restapi.routers.auth.TokenData(*, email)[source]#
Bases:
BaseModel- __abstractmethods__ = frozenset({})#
- __annotations__ = {'email': 'str'}#
- __class_vars__ = {}#
The names of the class variables defined on the model.
- __dict__#
- __module__ = 'aiida_restapi.routers.auth'#
- __private_attributes__ = {}#
Metadata about the private attributes of the model.
- __pydantic_complete__ = True#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_computed_fields__ = {}#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_core_schema__ = {'cls': <class 'aiida_restapi.routers.auth.TokenData'>, 'config': {'title': 'TokenData'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'aiida_restapi.routers.auth.TokenData'>>]}, 'ref': 'aiida_restapi.routers.auth.TokenData:102854668795744', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'email': {'metadata': {}, 'schema': {'type': 'str'}, 'type': 'model-field'}}, 'model_name': 'TokenData', 'type': 'model-fields'}, 'type': 'model'}#
The core schema of the model.
- __pydantic_custom_init__ = False#
Whether the model has a custom __init__ method.
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_extra__#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- __pydantic_extra_info__ = None#
A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.
This is a private attribute, not meant to be used outside Pydantic.
- __pydantic_fields__ = {'email': FieldInfo(annotation=str, required=True)}#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.
- __pydantic_fields_set__#
The names of fields explicitly set during instantiation.
- __pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#
A dictionary containing metadata about generic Pydantic models.
The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
- __pydantic_parent_namespace__ = None#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__ = None#
The name of the post-init method for the model, if defined.
- __pydantic_private__#
Values of private attributes set on the model instance.
- __pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff3f60, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff3f60, ), serializer: Model( ModelSerializer { class: Py( 0x00005d8bb7ff3f60, ), serializer: Fields( GeneralFieldsSerializer { fields: { "email": SerField { key: "email", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 1, }, ), has_extra: false, root_model: false, name: "TokenData", }, ), enabled_from_config: false, }, ), enabled_from_config: false, }, ), definitions=[])#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_setattr_handlers__ = {}#
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- __pydantic_validator__ = SchemaValidator(title="TokenData", validator=Model( ModelValidator { revalidate: Never, validator: ModelFields( ModelFieldsValidator { fields: [ Field { name: "email", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "email", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, ], model_name: "TokenData", extra_behavior: Ignore, extras_validator: None, extras_keys_validator: None, strict: false, from_attributes: false, loc_by_alias: true, lookup: LookupTree { inner: { PathItemString( "email", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x00005d8bb7ff3f60, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x0000781933fd64d0, ), name: "TokenData", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- __signature__ = <Signature (*, email: str) -> None>#
The synthesized __init__ [Signature][inspect.Signature] of the model.
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- email#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiida_restapi.routers.auth.UserInDB(**data)[source]#
Bases:
ReadModel- __abstractmethods__ = frozenset({})#
- __annotations__ = {'disabled': 't.Optional[bool]', 'hashed_password': 'str'}#
- __class_vars__ = {}#
The names of the class variables defined on the model.
- __dict__#
- __module__ = 'aiida_restapi.routers.auth'#
- __private_attributes__ = {}#
Metadata about the private attributes of the model.
- __pydantic_complete__ = True#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_computed_fields__ = {}#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_core_schema__ = {'cls': <class 'aiida_restapi.routers.auth.UserInDB'>, 'config': {'extra_fields_behavior': 'forbid', 'serialize_by_alias': True, 'title': 'UserInDB', 'validate_by_alias': True, 'validate_by_name': True}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'aiida_restapi.routers.auth.UserInDB'>>]}, 'ref': 'aiida_restapi.routers.auth.UserInDB:102854668807328', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'disabled': {'metadata': {}, 'schema': {'default': None, 'schema': {'schema': {'type': 'bool'}, 'type': 'nullable'}, 'type': 'default'}, 'type': 'model-field'}, 'email': {'metadata': {'pydantic_js_extra': {}, 'pydantic_js_updates': {'description': 'The user email', 'examples': ['verdi@opera.net']}}, 'schema': {'type': 'str'}, 'type': 'model-field'}, 'first_name': {'metadata': {'pydantic_js_extra': {}, 'pydantic_js_updates': {'description': 'The user first name', 'examples': ['Giuseppe']}}, 'schema': {'default': '', 'schema': {'type': 'str'}, 'type': 'default'}, 'type': 'model-field'}, 'hashed_password': {'metadata': {}, 'schema': {'type': 'str'}, 'type': 'model-field'}, 'institution': {'metadata': {'pydantic_js_extra': {}, 'pydantic_js_updates': {'description': 'The user institution', 'examples': ['Opera National de Paris']}}, 'schema': {'default': '', 'schema': {'type': 'str'}, 'type': 'default'}, 'type': 'model-field'}, 'last_name': {'metadata': {'pydantic_js_extra': {}, 'pydantic_js_updates': {'description': 'The user last name', 'examples': ['Verdi']}}, 'schema': {'default': '', 'schema': {'type': 'str'}, 'type': 'default'}, 'type': 'model-field'}, 'pk': {'metadata': {'pydantic_js_extra': {'readOnly': True}, 'pydantic_js_updates': {'description': 'The primary key of the entity', 'examples': [42]}}, 'schema': {'type': 'int'}, 'type': 'model-field'}}, 'model_name': 'UserInDB', 'type': 'model-fields'}, 'type': 'model'}#
The core schema of the model.
- __pydantic_custom_init__ = False#
Whether the model has a custom __init__ method.
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_extra__#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- __pydantic_extra_info__ = None#
A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.
This is a private attribute, not meant to be used outside Pydantic.
- __pydantic_fields__ = {'disabled': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'email': FieldInfo(annotation=str, required=True, description='The user email', examples=['verdi@opera.net'], json_schema_extra={}, metadata=[{'priority': 0}, {'read_only': False}, {'write_only': False}, {'may_be_large': False}]), 'first_name': FieldInfo(annotation=str, required=False, default='', description='The user first name', examples=['Giuseppe'], json_schema_extra={}, metadata=[{'priority': 0}, {'read_only': False}, {'write_only': False}, {'may_be_large': False}]), 'hashed_password': FieldInfo(annotation=str, required=True), 'institution': FieldInfo(annotation=str, required=False, default='', description='The user institution', examples=['Opera National de Paris'], json_schema_extra={}, metadata=[{'priority': 0}, {'read_only': False}, {'write_only': False}, {'may_be_large': False}]), 'last_name': FieldInfo(annotation=str, required=False, default='', description='The user last name', examples=['Verdi'], json_schema_extra={}, metadata=[{'priority': 0}, {'read_only': False}, {'write_only': False}, {'may_be_large': False}]), 'pk': FieldInfo(annotation=int, required=True, description='The primary key of the entity', examples=[42], json_schema_extra={'readOnly': True}, metadata=[{'priority': 0}, {'read_only': True}, {'write_only': False}, {'may_be_large': False}])}#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.
- __pydantic_fields_set__#
The names of fields explicitly set during instantiation.
- __pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#
A dictionary containing metadata about generic Pydantic models.
The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
- __pydantic_parent_namespace__ = None#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__ = None#
The name of the post-init method for the model, if defined.
- __pydantic_private__#
Values of private attributes set on the model instance.
- __pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff6ca0, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb7ff6ca0, ), serializer: Model( ModelSerializer { class: Py( 0x00005d8bb7ff6ca0, ), serializer: Fields( GeneralFieldsSerializer { fields: { "last_name": SerField { key: "last_name", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x0000781936189f00, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "email": SerField { key: "email", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "institution": SerField { key: "institution", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x0000781936189f00, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "hashed_password": SerField { key: "hashed_password", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "disabled": SerField { key: "disabled", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x0000781936090c20, ), ), serializer: Nullable( NullableSerializer { serializer: Bool( BoolSerializer, ), }, ), }, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "first_name": SerField { key: "first_name", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x0000781936189f00, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, "pk": SerField { key: "pk", alias: None, serializer: Some( Int( IntSerializer, ), ), required: true, serialize_by_alias: Some( true, ), serialization_exclude_if: None, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 7, }, ), has_extra: false, root_model: false, name: "UserInDB", }, ), enabled_from_config: false, }, ), enabled_from_config: false, }, ), definitions=[])#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_setattr_handlers__ = {}#
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- __pydantic_validator__ = SchemaValidator(title="UserInDB", validator=Model( ModelValidator { revalidate: Never, validator: ModelFields( ModelFieldsValidator { fields: [ Field { name: "pk", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "pk", ), rest: [], }, by_alias: [], }, validator: Int( IntValidator { strict: false, }, ), frozen: false, }, Field { name: "email", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "email", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, Field { name: "first_name", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "first_name", ), rest: [], }, by_alias: [], }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x0000781936189f00, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x0000781933fd64d0, ), }, ), frozen: false, }, Field { name: "last_name", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "last_name", ), rest: [], }, by_alias: [], }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x0000781936189f00, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x0000781933fd64d0, ), }, ), frozen: false, }, Field { name: "institution", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "institution", ), rest: [], }, by_alias: [], }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x0000781936189f00, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x0000781933fd64d0, ), }, ), frozen: false, }, Field { name: "hashed_password", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "hashed_password", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, Field { name: "disabled", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "disabled", ), rest: [], }, by_alias: [], }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x0000781936090c20, ), ), on_error: Raise, validator: Nullable( NullableValidator { validator: Bool( BoolValidator { strict: false, }, ), name: "nullable[bool]", }, ), validate_default: false, copy_default: false, name: "default[nullable[bool]]", undefined: Py( 0x0000781933fd64d0, ), }, ), frozen: false, }, ], model_name: "UserInDB", extra_behavior: Forbid, extras_validator: None, extras_keys_validator: None, strict: false, from_attributes: false, loc_by_alias: true, lookup: LookupTree { inner: { PathItemString( "pk", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "email", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "last_name", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 3, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "institution", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 4, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "first_name", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 2, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "hashed_password", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 5, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "disabled", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 6, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: Some( true, ), validate_by_name: Some( true, ), }, ), class: Py( 0x00005d8bb7ff6ca0, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x0000781933fd64d0, ), name: "UserInDB", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- _abc_impl = <_abc._abc_data object>#
- disabled#
- hashed_password#
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'UserInDB', 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async aiida_restapi.routers.auth.login_for_access_token(form_data=Depends(NoneType))[source]#
Login to get access token.
aiida_restapi.routers.computers module#
Declaration of FastAPI router for computers.
- async aiida_restapi.routers.computers.create_computer(request, computer_model, current_user)[source]#
Create new AiiDA computer.
- async aiida_restapi.routers.computers.get_computer(request, pk, query_params)[source]#
Get AiiDA computer by pk.
- async aiida_restapi.routers.computers.get_computer_metadata(request, pk, query_params)[source]#
Get metadata of an AiiDA computer by pk.
- async aiida_restapi.routers.computers.get_computer_projections()[source]#
Get queryable projections for AiiDA computers.
aiida_restapi.routers.daemon module#
Declaration of FastAPI router for daemon endpoints.
- class aiida_restapi.routers.daemon.DaemonStatusModel(*, running, num_workers)[source]#
Bases:
BaseModelResponse model for daemon status.
- __abstractmethods__ = frozenset({})#
- __annotations__ = {'num_workers': 't.Optional[int]', 'running': 'bool'}#
- __class_vars__ = {}#
The names of the class variables defined on the model.
- __dict__#
- __module__ = 'aiida_restapi.routers.daemon'#
- __private_attributes__ = {}#
Metadata about the private attributes of the model.
- __pydantic_complete__ = True#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_computed_fields__ = {}#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_core_schema__ = {'cls': <class 'aiida_restapi.routers.daemon.DaemonStatusModel'>, 'config': {'title': 'DaemonStatusModel'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'aiida_restapi.routers.daemon.DaemonStatusModel'>>]}, 'ref': 'aiida_restapi.routers.daemon.DaemonStatusModel:102854671544512', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'num_workers': {'metadata': {'pydantic_js_updates': {'description': 'The number of workers if the daemon is running.'}}, 'schema': {'schema': {'type': 'int'}, 'type': 'nullable'}, 'type': 'model-field'}, 'running': {'metadata': {'pydantic_js_updates': {'description': 'Whether the daemon is running or not.'}}, 'schema': {'type': 'bool'}, 'type': 'model-field'}}, 'model_name': 'DaemonStatusModel', 'type': 'model-fields'}, 'type': 'model'}#
The core schema of the model.
- __pydantic_custom_init__ = False#
Whether the model has a custom __init__ method.
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_extra__#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- __pydantic_extra_info__ = None#
A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.
This is a private attribute, not meant to be used outside Pydantic.
- __pydantic_fields__ = {'num_workers': FieldInfo(annotation=Union[int, NoneType], required=True, description='The number of workers if the daemon is running.'), 'running': FieldInfo(annotation=bool, required=True, description='Whether the daemon is running or not.')}#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.
- __pydantic_fields_set__#
The names of fields explicitly set during instantiation.
- __pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#
A dictionary containing metadata about generic Pydantic models.
The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
- __pydantic_parent_namespace__ = None#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__ = None#
The name of the post-init method for the model, if defined.
- __pydantic_private__#
Values of private attributes set on the model instance.
- __pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb82930c0, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb82930c0, ), serializer: Model( ModelSerializer { class: Py( 0x00005d8bb82930c0, ), serializer: Fields( GeneralFieldsSerializer { fields: { "running": SerField { key: "running", alias: None, serializer: Some( Bool( BoolSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "num_workers": SerField { key: "num_workers", alias: None, serializer: Some( Nullable( NullableSerializer { serializer: Int( IntSerializer, ), }, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 2, }, ), has_extra: false, root_model: false, name: "DaemonStatusModel", }, ), enabled_from_config: false, }, ), enabled_from_config: false, }, ), definitions=[])#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_setattr_handlers__ = {}#
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- __pydantic_validator__ = SchemaValidator(title="DaemonStatusModel", validator=Model( ModelValidator { revalidate: Never, validator: ModelFields( ModelFieldsValidator { fields: [ Field { name: "running", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "running", ), rest: [], }, by_alias: [], }, validator: Bool( BoolValidator { strict: false, }, ), frozen: false, }, Field { name: "num_workers", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "num_workers", ), rest: [], }, by_alias: [], }, validator: Nullable( NullableValidator { validator: Int( IntValidator { strict: false, }, ), name: "nullable[int]", }, ), frozen: false, }, ], model_name: "DaemonStatusModel", extra_behavior: Ignore, extras_validator: None, extras_keys_validator: None, strict: false, from_attributes: false, loc_by_alias: true, lookup: LookupTree { inner: { PathItemString( "num_workers", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "running", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x00005d8bb82930c0, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x0000781933fd64d0, ), name: "DaemonStatusModel", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- __signature__ = <Signature (*, running: bool, num_workers: Optional[int]) -> None>#
The synthesized __init__ [Signature][inspect.Signature] of the model.
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- num_workers#
- running#
aiida_restapi.routers.groups module#
Declaration of FastAPI router for groups.
- async aiida_restapi.routers.groups.create_group(request, group_model, current_user)[source]#
Create new AiiDA group.
- async aiida_restapi.routers.groups.get_group(request, uuid, query_params)[source]#
Get AiiDA group by uuid.
- async aiida_restapi.routers.groups.get_group_extras(request, uuid, query_params)[source]#
Get the extras of a group.
- async aiida_restapi.routers.groups.get_group_nodes(request, uuid, query_params)[source]#
Get the nodes of a group.
- async aiida_restapi.routers.groups.get_group_projections()[source]#
Get queryable projections for AiiDA groups.
- async aiida_restapi.routers.groups.get_group_user(request, uuid)[source]#
Get the user associated with a group.
aiida_restapi.routers.nodes module#
Declaration of FastAPI router for nodes.
- async aiida_restapi.routers.nodes.create_node(request, model, current_user)[source]#
Create a new AiiDA node from an attributes-based payload.
- async aiida_restapi.routers.nodes.create_node_constructor(request, model, current_user)[source]#
Create a new AiiDA node from a constructor-based payload.
- async aiida_restapi.routers.nodes.create_node_with_files(request, params, files, current_user)[source]#
Create new AiiDA node with files.
- async aiida_restapi.routers.nodes.download_node(uuid, format=None, options=None)[source]#
Download AiiDA node by uuid in a given download format (e.g., JSON, archive).
The available download formats can be queried using the /nodes/download_formats/ endpoint. If downloading as an archive, additional options can be provided as a JSON object via the options query parameter.
- async aiida_restapi.routers.nodes.get_node(request, uuid, query_params)[source]#
Get AiiDA node by uuid.
- async aiida_restapi.routers.nodes.get_node_attributes(request, uuid, query_params)[source]#
Get the attributes of a node.
- async aiida_restapi.routers.nodes.get_node_computer(request, uuid)[source]#
Get the computer associated with a node.
- async aiida_restapi.routers.nodes.get_node_extras(request, uuid, query_params)[source]#
Get the extras of a node.
- async aiida_restapi.routers.nodes.get_node_groups(request, uuid, query_params)[source]#
Get the groups of a node.
- async aiida_restapi.routers.nodes.get_node_links(request, uuid, direction, query_params)[source]#
Get the incoming/outgoing links of a node.
- async aiida_restapi.routers.nodes.get_node_projections(node_type=None)[source]#
Get queryable projections for AiiDA nodes.
- async aiida_restapi.routers.nodes.get_node_repo_file_contents(uuid, filename=None)[source]#
Get the repository contents of a node.
- async aiida_restapi.routers.nodes.get_node_repo_file_metadata(request, uuid, query_params)[source]#
Get the repository file metadata of a node.
- async aiida_restapi.routers.nodes.get_node_types()[source]#
Get all node types in machine-actionable format.
- async aiida_restapi.routers.nodes.get_node_user(request, uuid)[source]#
Get the user associated with a node.
- async aiida_restapi.routers.nodes.get_nodes(request, query_params)[source]#
Get AiiDA nodes with optional filtering, sorting, and/or pagination.
- async aiida_restapi.routers.nodes.get_nodes_download_formats()[source]#
Get download formats for AiiDA nodes.
- async aiida_restapi.routers.nodes.get_nodes_schema(node_type=None, which='read')[source]#
Get JSON schema for the base AiiDA node ‘read’ model.
aiida_restapi.routers.querybuilder module#
Declaration of FastAPI router for AiiDA’s QueryBuilder.
aiida_restapi.routers.server module#
Declaration of FastAPI application.
- aiida_restapi.routers.server._get_route_parts(route)[source]#
Return the parts of a route: path, group, methods, description.
- async aiida_restapi.routers.server.get_server_endpoints(request)[source]#
Get a JSON-serializable dictionary of all registered API routes.
aiida_restapi.routers.submit module#
Declaration of FastAPI router for submission.
- class aiida_restapi.routers.submit.ProcessSubmitModel(*, label='', entry_point, inputs)[source]#
Bases:
BaseModel- __abstractmethods__ = frozenset({})#
- __annotations__ = {'entry_point': 'str', 'inputs': 'dict[str, t.Any]', 'label': 'str'}#
- __class_vars__ = {}#
The names of the class variables defined on the model.
- __dict__#
- __module__ = 'aiida_restapi.routers.submit'#
- __private_attributes__ = {}#
Metadata about the private attributes of the model.
- __pydantic_complete__ = True#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_computed_fields__ = {}#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_core_schema__ = {'cls': <class 'aiida_restapi.routers.submit.ProcessSubmitModel'>, 'config': {'title': 'ProcessSubmitModel'}, 'custom_init': False, 'metadata': {'pydantic_js_functions': [<bound method BaseModel.__get_pydantic_json_schema__ of <class 'aiida_restapi.routers.submit.ProcessSubmitModel'>>]}, 'ref': 'aiida_restapi.routers.submit.ProcessSubmitModel:102854675259632', 'root_model': False, 'schema': {'computed_fields': [], 'fields': {'entry_point': {'metadata': {'pydantic_js_updates': {'description': 'The entry point of the process', 'examples': ['core.arithmetic.add']}}, 'schema': {'type': 'str'}, 'type': 'model-field'}, 'inputs': {'metadata': {'pydantic_js_updates': {'description': 'The inputs of the process', 'examples': [{'x': 1, 'y': 2}]}}, 'schema': {'function': {'function': <bound method ProcessSubmitModel.process_inputs of <class 'aiida_restapi.routers.submit.ProcessSubmitModel'>>, 'type': 'no-info'}, 'schema': {'keys_schema': {'type': 'str'}, 'type': 'dict', 'values_schema': {'type': 'any'}}, 'type': 'function-after'}, 'type': 'model-field'}, 'label': {'metadata': {'pydantic_js_updates': {'description': 'The label of the process', 'examples': ['My process', 'Test calculation']}}, 'schema': {'default': '', 'schema': {'type': 'str'}, 'type': 'default'}, 'type': 'model-field'}}, 'model_name': 'ProcessSubmitModel', 'type': 'model-fields'}, 'type': 'model'}#
The core schema of the model.
- __pydantic_custom_init__ = False#
Whether the model has a custom __init__ method.
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={'process_inputs': Decorator(cls_ref='aiida_restapi.routers.submit.ProcessSubmitModel:102854675259632', cls_var_name='process_inputs', func=<bound method ProcessSubmitModel.process_inputs of <class 'aiida_restapi.routers.submit.ProcessSubmitModel'>>, shim=None, info=FieldValidatorDecoratorInfo(fields=('inputs',), mode='after', check_fields=None, json_schema_input_type=PydanticUndefined))}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_extra__#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- __pydantic_extra_info__ = None#
A wrapper around the __pydantic_extra__ annotation, if explicitly annotated on a model.
This is a private attribute, not meant to be used outside Pydantic.
- __pydantic_fields__ = {'entry_point': FieldInfo(annotation=str, required=True, description='The entry point of the process', examples=['core.arithmetic.add']), 'inputs': FieldInfo(annotation=dict[str, Any], required=True, description='The inputs of the process', examples=[{'x': 1, 'y': 2}]), 'label': FieldInfo(annotation=str, required=False, default='', description='The label of the process', examples=['My process', 'Test calculation'])}#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. This replaces Model.__fields__ from Pydantic V1.
- __pydantic_fields_set__#
The names of fields explicitly set during instantiation.
- __pydantic_generic_metadata__ = {'args': (), 'origin': None, 'parameters': ()}#
A dictionary containing metadata about generic Pydantic models.
The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
- __pydantic_parent_namespace__ = None#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__ = None#
The name of the post-init method for the model, if defined.
- __pydantic_private__#
Values of private attributes set on the model instance.
- __pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb861e0f0, ), serializer: PolymorphismTrampoline( PolymorphismTrampoline { class: Py( 0x00005d8bb861e0f0, ), serializer: Model( ModelSerializer { class: Py( 0x00005d8bb861e0f0, ), serializer: Fields( GeneralFieldsSerializer { fields: { "entry_point": SerField { key: "entry_point", alias: None, serializer: Some( Str( StrSerializer, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "label": SerField { key: "label", alias: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x0000781936189f00, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, "inputs": SerField { key: "inputs", alias: None, serializer: Some( Dict( DictSerializer { key_serializer: Str( StrSerializer, ), value_serializer: Any( AnySerializer, ), filter: SchemaFilter { include: None, exclude: None, }, name: "dict[str, any]", }, ), ), required: true, serialize_by_alias: None, serialization_exclude_if: None, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 3, }, ), has_extra: false, root_model: false, name: "ProcessSubmitModel", }, ), enabled_from_config: false, }, ), enabled_from_config: false, }, ), definitions=[])#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_setattr_handlers__ = {}#
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- __pydantic_validator__ = SchemaValidator(title="ProcessSubmitModel", validator=Model( ModelValidator { revalidate: Never, validator: ModelFields( ModelFieldsValidator { fields: [ Field { name: "label", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "label", ), rest: [], }, by_alias: [], }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x0000781936189f00, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x0000781933fd64d0, ), }, ), frozen: false, }, Field { name: "entry_point", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "entry_point", ), rest: [], }, by_alias: [], }, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), frozen: false, }, Field { name: "inputs", lookup_path_collection: LookupPathCollection { by_name: LookupPath { first_item: PathItemString( "inputs", ), rest: [], }, by_alias: [], }, validator: FunctionAfter( FunctionAfterValidator { validator: Dict( DictValidator { strict: false, key_validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), value_validator: Any( AnyValidator, ), min_length: None, max_length: None, fail_fast: false, name: "dict[str,any]", }, ), func: Py( 0x000078192037ff80, ), config: Py( 0x0000781920388640, ), name: "function-after[process_inputs(), dict[str,any]]", field_name: None, info_arg: false, }, ), frozen: false, }, ], model_name: "ProcessSubmitModel", extra_behavior: Ignore, extras_validator: None, extras_keys_validator: None, strict: false, from_attributes: false, loc_by_alias: true, lookup: LookupTree { inner: { PathItemString( "inputs", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 2, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "label", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 0, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, PathItemString( "entry_point", ): LookupTreeNode { fields: [ LookupFieldInfo { field_index: 1, lookup_priority: LookupFieldPriority { lookup_type: Both, alias_index: 0, }, }, ], map: {}, list: {}, }, }, }, validate_by_alias: None, validate_by_name: None, }, ), class: Py( 0x00005d8bb861e0f0, ), generic_origin: None, post_init: None, frozen: false, custom_init: false, root_model: false, undefined: Py( 0x0000781933fd64d0, ), name: "ProcessSubmitModel", }, ), definitions=[], cache_strings=True)#
The pydantic-core SchemaValidator used to validate instances of the model.
- __signature__ = <Signature (*, label: str = '', entry_point: str, inputs: dict[str, typing.Any]) -> None>#
The synthesized __init__ [Signature][inspect.Signature] of the model.
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- entry_point#
- inputs#
- label#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
aiida_restapi.routers.users module#
Declaration of FastAPI router for users.
- async aiida_restapi.routers.users.create_user(request, user_model, current_user)[source]#
Create new AiiDA user.
- async aiida_restapi.routers.users.get_user(request, pk, query_params)[source]#
Get AiiDA user by pk.
- async aiida_restapi.routers.users.get_user_projections()[source]#
Get queryable projections for AiiDA users.