julee.repositories.memory ========================= .. py:module:: julee.repositories.memory .. autoapi-nested-parse:: Memory repository implementations for julee domain. This module exports in-memory implementations of all repository protocols for the Capture, Extract, Assemble, Publish workflow. These implementations use Python dictionaries for storage and are ideal for testing scenarios where external dependencies should be avoided. All implementations maintain the same async interfaces as their production counterparts while providing lightweight, dependency-free alternatives. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/julee/repositories/memory/assembly/index /autoapi/julee/repositories/memory/assembly_specification/index /autoapi/julee/repositories/memory/base/index /autoapi/julee/repositories/memory/document/index /autoapi/julee/repositories/memory/document_policy_validation/index /autoapi/julee/repositories/memory/knowledge_service_config/index /autoapi/julee/repositories/memory/knowledge_service_query/index /autoapi/julee/repositories/memory/policy/index Classes ------- .. autoapisummary:: julee.repositories.memory.MemoryAssemblyRepository julee.repositories.memory.MemoryAssemblySpecificationRepository julee.repositories.memory.MemoryDocumentPolicyValidationRepository julee.repositories.memory.MemoryDocumentRepository julee.repositories.memory.MemoryKnowledgeServiceConfigRepository julee.repositories.memory.MemoryKnowledgeServiceQueryRepository julee.repositories.memory.MemoryPolicyRepository Package Contents ---------------- .. py:class:: MemoryAssemblyRepository Bases: :py:obj:`julee.domain.repositories.assembly.AssemblyRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.assembly.Assembly`\ ] Memory implementation of AssemblyRepository using Python dictionaries. This implementation stores assembly data in memory using a dictionary keyed by assembly_id. This provides a lightweight, dependency-free option for testing. .. py:method:: generate_id() :async: Generate a unique assembly identifier. :returns: Unique assembly ID string .. py:method:: get(assembly_id) :async: Retrieve an assembly by ID. :param assembly_id: Unique assembly identifier :returns: Assembly if found, None otherwise .. py:method:: get_many(assembly_ids) :async: Retrieve multiple assemblies by ID. :param assembly_ids: List of unique assembly identifiers :returns: Dict mapping assembly_id to Assembly (or None if not found) .. py:method:: save(assembly) :async: Save assembly metadata (status, updated_at, etc.). :param assembly: Assembly entity .. py:attribute:: entity_name :value: 'Assembly' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.assembly.Assembly] .. py:class:: MemoryAssemblySpecificationRepository Bases: :py:obj:`julee.domain.repositories.assembly_specification.AssemblySpecificationRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.assembly_specification.AssemblySpecification`\ ] Memory implementation of AssemblySpecificationRepository using Python dictionaries. This implementation stores assembly specifications in memory: - Specifications: Dictionary keyed by assembly_specification_id containing AssemblySpecification objects This provides a lightweight, dependency-free option for testing while maintaining the same interface as other implementations. .. py:method:: generate_id() :async: Generate a unique assembly specification identifier. :returns: Unique assembly specification ID string .. py:method:: get(assembly_specification_id) :async: Retrieve an assembly specification by ID. :param assembly_specification_id: Unique specification identifier :returns: AssemblySpecification if found, None otherwise .. py:method:: get_many(assembly_specification_ids) :async: Retrieve multiple assembly specifications by ID. :param assembly_specification_ids: List of unique specification :param identifiers: :returns: Dict mapping specification_id to AssemblySpecification (or None if not found) .. py:method:: list_all() :async: List all assembly specifications. :returns: List of all AssemblySpecification entities in the repository .. py:method:: save(assembly_specification) :async: Save an assembly specification. :param assembly_specification: Complete AssemblySpecification to save .. py:attribute:: entity_name :value: 'AssemblySpecification' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.assembly_specification.AssemblySpecification] .. py:class:: MemoryDocumentPolicyValidationRepository Bases: :py:obj:`julee.domain.repositories.document_policy_validation.DocumentPolicyValidationRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.policy.DocumentPolicyValidation`\ ] Memory implementation of DocumentPolicyValidationRepository using Python dictionaries. This implementation stores document policy validation data in memory using a dictionary keyed by validation_id. This provides a lightweight, dependency-free option for testing. .. py:method:: generate_id() :async: Generate a unique validation identifier. :returns: Unique validation ID string .. py:method:: get(validation_id) :async: Retrieve a document policy validation by ID. :param validation_id: Unique validation identifier :returns: DocumentPolicyValidation if found, None otherwise .. py:method:: get_many(validation_ids) :async: Retrieve multiple document policy validations by ID. :param validation_ids: List of unique validation identifiers :returns: Dict mapping validation_id to DocumentPolicyValidation (or None if not found) .. py:method:: save(validation) :async: Save a document policy validation. :param validation: Complete DocumentPolicyValidation to save .. py:attribute:: entity_name :value: 'DocumentPolicyValidation' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.policy.DocumentPolicyValidation] .. py:class:: MemoryDocumentRepository Bases: :py:obj:`julee.domain.repositories.document.DocumentRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.document.Document`\ ] Memory implementation of DocumentRepository using Python dictionaries. This implementation stores document metadata and content in memory: - Documents: Dictionary keyed by document_id containing Document objects This provides a lightweight, dependency-free option for testing while maintaining the same interface as other implementations. .. py:method:: generate_id() :async: Generate a unique document identifier. :returns: Unique document ID string .. py:method:: get(document_id) :async: Retrieve a document with metadata and content. :param document_id: Unique document identifier :returns: Document object if found, None otherwise .. py:method:: get_many(document_ids) :async: Retrieve multiple documents by ID. :param document_ids: List of unique document identifiers :returns: Dict mapping document_id to Document (or None if not found) .. py:method:: list_all() :async: List all documents. :returns: List of all Document entities in the repository .. py:method:: save(document) :async: Save a document with its content and metadata. If the document has content_string, it will be converted to a ContentStream and the content hash will be calculated automatically. :param document: Document object to save :raises ValueError: If document has no content or content_string .. py:attribute:: entity_name :value: 'Document' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.document.Document] .. py:class:: MemoryKnowledgeServiceConfigRepository Bases: :py:obj:`julee.domain.repositories.knowledge_service_config.KnowledgeServiceConfigRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.knowledge_service_config.KnowledgeServiceConfig`\ ] Memory implementation of KnowledgeServiceConfigRepository using Python dictionaries. This implementation stores knowledge service configurations in memory: - Knowledge Services: Dictionary keyed by knowledge_service_id containing KnowledgeServiceConfig objects This provides a lightweight, dependency-free option for testing while maintaining the same interface as other implementations. .. py:method:: generate_id() :async: Generate a unique knowledge service identifier. :returns: Unique knowledge service ID string .. py:method:: get(knowledge_service_id) :async: Retrieve a knowledge service configuration by ID. :param knowledge_service_id: Unique knowledge service identifier :returns: KnowledgeServiceConfig object if found, None otherwise .. py:method:: get_many(knowledge_service_ids) :async: Retrieve multiple knowledge service configs by ID. :param knowledge_service_ids: List of unique knowledge service :param identifiers: :returns: Dict mapping knowledge_service_id to KnowledgeServiceConfig (or None if not found) .. py:method:: list_all() :async: List all knowledge service configurations. :returns: List of all KnowledgeServiceConfig entities in the repository .. py:method:: save(knowledge_service) :async: Save a knowledge service configuration. :param knowledge_service: Complete KnowledgeServiceConfig to save .. py:attribute:: entity_name :value: 'KnowledgeServiceConfig' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.knowledge_service_config.KnowledgeServiceConfig] .. py:class:: MemoryKnowledgeServiceQueryRepository Bases: :py:obj:`julee.domain.repositories.knowledge_service_query.KnowledgeServiceQueryRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.assembly_specification.KnowledgeServiceQuery`\ ] Memory implementation of KnowledgeServiceQueryRepository using Python dictionaries. This implementation stores knowledge service queries in memory: - Queries: Dictionary keyed by query_id containing KnowledgeServiceQuery objects This provides a lightweight, dependency-free option for testing while maintaining the same interface as other implementations. .. py:method:: generate_id() :async: Generate a unique query identifier. :returns: Unique string identifier for a new query .. py:method:: get(query_id) :async: Retrieve a knowledge service query by ID. :param query_id: Unique query identifier :returns: KnowledgeServiceQuery object if found, None otherwise .. py:method:: get_many(query_ids) :async: Retrieve multiple knowledge service queries by ID. :param query_ids: List of unique query identifiers :returns: Dict mapping query_id to KnowledgeServiceQuery (or None if not found) .. py:method:: list_all() :async: List all knowledge service queries. :returns: List of all knowledge service queries, sorted by query_id .. py:method:: save(query) :async: Store or update a knowledge service query. :param query: KnowledgeServiceQuery object to store .. py:attribute:: entity_name :value: 'KnowledgeServiceQuery' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.assembly_specification.KnowledgeServiceQuery] .. py:class:: MemoryPolicyRepository Bases: :py:obj:`julee.domain.repositories.policy.PolicyRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.policy.Policy`\ ] Memory implementation of PolicyRepository using Python dictionaries. This implementation stores policy data in memory using a dictionary keyed by policy_id. This provides a lightweight, dependency-free option for testing. .. py:method:: generate_id() :async: Generate a unique policy identifier. :returns: Unique policy ID string .. py:method:: get(policy_id) :async: Retrieve a policy by ID. :param policy_id: Unique policy identifier :returns: Policy if found, None otherwise .. py:method:: get_many(policy_ids) :async: Retrieve multiple policies by ID. :param policy_ids: List of unique policy identifiers :returns: Dict mapping policy_id to Policy (or None if not found) .. py:method:: save(policy) :async: Save a policy. :param policy: Complete Policy to save .. py:attribute:: entity_name :value: 'Policy' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.policy.Policy]