Skip to main content

Abstract base class for domain-specific database services

Project description

AbstractDatabaseService

Abstract base class for domain-specific database services. This package provides the foundation for building database services tailored to specific domains (Legal, Finance, etc.).

Installation

# From git
pip install git+https://github.com/NlpFisTeam/AbstractDBService.git

# From local
pip install -e ./modules/AbstractDBService

Usage

from AbstractDBService import AbstractDBService, ProcessingResult

class LegalDocumentService(AbstractDBService):
    """Legal document database service."""
    
    def _init_connections(self, **kwargs):
        # Initialize legal-specific connections
        self.arango_connector = kwargs.get("arango_connector")
    
    def process_document(self, file_path, doc_id, metadata, **kwargs):
        # Legal-specific document processing
        pass
    
    # ... implement other abstract methods

Abstract Methods

All inheriting classes must implement:

  • _init_connections(**kwargs) - Initialize domain-specific connections
  • process_document(file_path, doc_id, metadata, **kwargs) - Process a document
  • extract_metadata(document, raw_metadata) - Extract domain-specific metadata
  • create_chunks(document, doc_id, metadata) - Create chunks with domain-specific logic
  • embed_text(texts) - Create embeddings
  • create(file_path, metadata, **kwargs) - Create/ingest a new document
  • update(doc_id, updates, **kwargs) - Update an existing document
  • delete(doc_id, **kwargs) - Delete a document
  • init_databases(tenant_id) - Initialize databases for a new tenant
  • cleanup_databases(tenant_id) - Cleanup databases for a tenant

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstractdatabaseservice-1.0.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstractdatabaseservice-1.0.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file abstractdatabaseservice-1.0.0.tar.gz.

File metadata

  • Download URL: abstractdatabaseservice-1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for abstractdatabaseservice-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4e9e668d1a831afe224a9ebd96ac6d6cfeed8813adb4d72c828dcacdb9b05456
MD5 709ef6bc9bf96e8fb0fc7f185b21e6c2
BLAKE2b-256 c401f9c10664826a6fa26b960972f57f81845b1a1752280f0090e6ce3f5c7c84

See more details on using hashes here.

File details

Details for the file abstractdatabaseservice-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstractdatabaseservice-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e78414db97c4d084fbeb5217b1d59186c0875b8e8932d6c1a28b885d7cea23
MD5 5e6195d9dd0ea7a87d2ef9ca172b127e
BLAKE2b-256 f13ebb5a95a067c234311563c0a8e26a98bad7e85d572c81b6cc342c6de0cbeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page