helpers

This package contains utility functions that simplify the workflow for users:

  • create_database: Handles initial database setup and configuration

  • allowed_values_not_adapted.py: Contains predefined allowed values that are copied to the archive during installation

  • helper_functions: Provides internal utility functions for dynamic model creation

  • full_entry: Combines database and file operations for complete measurement and molecule entries

create_database

This module handles the initial setup of the database and archive directory structure. It includes functions for:

  • Creating the basic directory structure

  • Applying database migrations

  • Initializing the complete system

create_archive_directory()

Create the basic archive directory structure.

run_alembic_upgrade()

Apply all database migrations to bring schema to current version.

specatalog_init()

Initialize the Specatalog system.

allowed_values_not_adapted.py

This module contains predefined enumerations of allowed values for various measurement parameters. These values are used for data validation and are copied to the archive during installation.

full_entry

This module provides atomic operations for creating and deleting complete measurement and molecule entries. It ensures that both database and file operations are performed in a transaction-safe manner.

create_full_measurement(data, raw_data_path, fmt)

Create a complete measurement entry with atomic database and file operations.

delete_full_measurement(ms_id)

Delete a complete measurement entry with atomic database and file operations.

create_full_molecule(data, ...[, progress])

Create a complete molecule entry with atomic database and file operations.

helper_functions

This module contains internal utility functions that dynamically create Pydantic models for:

  • Filtering database queries

  • Ordering query results

  • Updating database records

make_filter_model(model, creation_model)

Create dynamically a pydantic-class for filtering based on an SQLAlchemy- model.

make_ordering_model(model)

Create dynamically a pydantic-class for ordering based on an SQLAlchemy model.

make_update_model(model, creation_model)

Create dynamically a pydantic-class for updating based on an SQLAlchemy model.