scholar_flux.exceptions package

Submodules

scholar_flux.exceptions.api_exceptions module

Implements exceptions involving the creation of requests and retrieval of responses from API Providers.

exception scholar_flux.exceptions.api_exceptions.APIException[source]

Bases: Exception

Base exception for API-related errors.

exception scholar_flux.exceptions.api_exceptions.APIParameterException[source]

Bases: APIException

Exception raised for API Parameter-related errors.

exception scholar_flux.exceptions.api_exceptions.InvalidResponseException(response: Response | ResponseProtocol | None = None, *args, **kwargs)[source]

Bases: RequestFailedException

Exception raised for invalid responses from the API.

__init__(response: Response | ResponseProtocol | None = None, *args, **kwargs)[source]

Initializes the InvalidResponseException class with a response or response-like parameter for logging.

static extract_error_details(response: Response | ResponseProtocol) str[source]

Extracts detailed error message from response body.

exception scholar_flux.exceptions.api_exceptions.InvalidResponseReconstructionException[source]

Bases: InvalidResponseStructureException

Exception raised on the attempted creation of a ReconstructedResponse if an exception is encountered.

exception scholar_flux.exceptions.api_exceptions.InvalidResponseStructureException[source]

Bases: APIException

Exception raised on when encountering an non response/response-like object when a valid response was expected.

exception scholar_flux.exceptions.api_exceptions.MissingAPIKeyException[source]

Bases: ValueError

Exception raised when a blank string is provided yet invalid.

exception scholar_flux.exceptions.api_exceptions.MissingAPISpecificParameterException[source]

Bases: ValueError

Exception raised when an API specific parameter is required but not provided in the config.

exception scholar_flux.exceptions.api_exceptions.MissingProviderException[source]

Bases: ValueError

Exception raised when an API specific parameter is required but not provided in the config.

exception scholar_flux.exceptions.api_exceptions.MissingResponseException[source]

Bases: ValueError

Exception raised when a response or response-like objects is required but not provided.

exception scholar_flux.exceptions.api_exceptions.NotFoundException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.api_exceptions.PermissionException[source]

Bases: APIException

Exception raised for permission errors.

exception scholar_flux.exceptions.api_exceptions.QueryValidationException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.api_exceptions.RateLimitExceededException[source]

Bases: APIException

Exception raised when the API’s rate limit is exceeded.

exception scholar_flux.exceptions.api_exceptions.RequestCacheException[source]

Bases: APIException

Exception raised for API request-cache related errors.

exception scholar_flux.exceptions.api_exceptions.RequestCreationException[source]

Bases: APIException

Exception raised when the preparation of an API request fails.

exception scholar_flux.exceptions.api_exceptions.RequestFailedException[source]

Bases: APIException

Exception raised for failed API requests.

exception scholar_flux.exceptions.api_exceptions.RetryLimitExceededException[source]

Bases: APIException

Exception raised when the retry limit is exceeded.

exception scholar_flux.exceptions.api_exceptions.SearchAPIException[source]

Bases: APIException

Exception raised when the search api fails in retrying data from APIs .

exception scholar_flux.exceptions.api_exceptions.SearchRequestException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.api_exceptions.TimeoutException[source]

Bases: APIException

Exception raised for request timeouts.

scholar_flux.exceptions.coordinator_exceptions module

Implements exceptions involving the creation of coordinators, the coordination of requests, response processing, and caching.

exception scholar_flux.exceptions.coordinator_exceptions.CoordinatorException[source]

Bases: Exception

Base exception for Coordinator-related errors.

exception scholar_flux.exceptions.coordinator_exceptions.InvalidCoordinatorParameterException[source]

Bases: CoordinatorException

Coordinator exception raised when attempting to set an unintended injectable class dependency as an attribute of a Coordinator or parameter to a method.

scholar_flux.exceptions.data_exceptions module

Implements exceptions for handling scenarios that could occur during the parsing, extraction, and processing of response data.

exception scholar_flux.exceptions.data_exceptions.DataExtractionException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data extraction.

exception scholar_flux.exceptions.data_exceptions.DataParsingException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data parsing.

exception scholar_flux.exceptions.data_exceptions.DataProcessingException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data processing.

exception scholar_flux.exceptions.data_exceptions.DataValidationException[source]

Bases: DataProcessingException

Exception raised for data validation errors.

exception scholar_flux.exceptions.data_exceptions.FieldNotFoundException[source]

Bases: DataExtractionException

Exception raised when an expected field is not found in the data.

exception scholar_flux.exceptions.data_exceptions.InvalidDataFormatException[source]

Bases: DataParsingException

Exception raised for errors in the input data format.

exception scholar_flux.exceptions.data_exceptions.ResponseProcessingException[source]

Bases: Exception

Base Exception for handling errors in response parsing and processing.

scholar_flux.exceptions.import_exceptions module

The scholar_flux.exceptions.import_exceptions module implements exceptions for handling missing dependencies when using the scholar_flux package. Although several packages are optional, attempting to use functionality that directly depends on an uninstalled dependency should raise an error.

This package module produces the basic exceptions necessary to clearly identify when a dependency is missing.

exception scholar_flux.exceptions.import_exceptions.CryptographyImportError[source]

Bases: OptionalDependencyImportError

Exception for cryptography Dependency Issues.

__init__()[source]

Initializes the cryptography import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.ItsDangerousImportError[source]

Bases: OptionalDependencyImportError

Exception for itsdangerous Dependency Issues.

__init__()[source]

Initializes the itsdangerous import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.MongoDBImportError[source]

Bases: OptionalDependencyImportError

Exception for Mongo Dependency Issues.

__init__()[source]

Initializes the pymongo import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.OptionalDependencyImportError(message='Optional Dependency not found')[source]

Bases: Exception

Base exception for Optional Dependency Issues.

__init__(message='Optional Dependency not found')[source]

Initializes the foundational OptionalDependencyImportError that forms the basis of more specific error handling when dependencies are missing.

exception scholar_flux.exceptions.import_exceptions.RedisImportError[source]

Bases: OptionalDependencyImportError

Exception for missing redis backend.

__init__()[source]

Initializes the redis import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.SQLAlchemyImportError[source]

Bases: OptionalDependencyImportError

Exception for missing sql alchemy backend.

__init__()[source]

Initializes the sqlalchemy import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.XMLToDictImportError[source]

Bases: OptionalDependencyImportError

Exception for xmltodict Dependency Issues.

__init__()[source]

Initializes the xmltodict import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.import_exceptions.YAMLImportError[source]

Bases: OptionalDependencyImportError

Exception for yaml Dependency Issues.

__init__()[source]

Initializes the yaml import exception for improved logging before the exception is raised.

scholar_flux.exceptions.path_exceptions module

The scholar_flux.exceptions.path_exceptions module implements the fundamental exception types necessary to interact with various path processing utilities while accounting for any potential errors that are specific to path processing.

exception scholar_flux.exceptions.path_exceptions.InvalidComponentTypeError[source]

Bases: PathUtilsError

Exception class raised for invalid inputs to ProcessingPath component types.

exception scholar_flux.exceptions.path_exceptions.InvalidPathDelimiterError[source]

Bases: InvalidProcessingPathError

Exception raised for invalid delimiters used in ProcessingPath.

exception scholar_flux.exceptions.path_exceptions.InvalidPathNodeError[source]

Bases: PathUtilsError

Exception raised for invalid operations resulting from the handling of PathNodes.

exception scholar_flux.exceptions.path_exceptions.InvalidProcessingPathError[source]

Bases: PathUtilsError

Exception class raised for invalid operations on ProcessingPaths.

exception scholar_flux.exceptions.path_exceptions.PathCacheError[source]

Bases: PathUtilsError

Exception raised when attempting to perform an invalid operation on path cache.

exception scholar_flux.exceptions.path_exceptions.PathCombinationError[source]

Bases: PathUtilsError

Exception raised when performing an invalid operation during the combination of athNodes within a PathNodeIndex.

exception scholar_flux.exceptions.path_exceptions.PathDiscoveryError[source]

Bases: PathUtilsError

Exception raised for invalid operations resulting from the handling of PathNodes.

exception scholar_flux.exceptions.path_exceptions.PathIndexingError[source]

Bases: InvalidProcessingPathError

Exception raised when attempting to retrieve the first element of attempting ProcessingPath as a record/page index.

exception scholar_flux.exceptions.path_exceptions.PathNodeIndexError[source]

Bases: PathUtilsError

Exception raised when performing an invalid operation on a PathNodeIndex.

exception scholar_flux.exceptions.path_exceptions.PathNodeMapError[source]

Bases: PathUtilsError

Exception raised when attempting to perform an invalid operation a PathNodeMap.

exception scholar_flux.exceptions.path_exceptions.PathSimplificationError[source]

Bases: PathUtilsError

Exception raised for when encountering invalid values during simplification.

exception scholar_flux.exceptions.path_exceptions.PathUtilsError[source]

Bases: Exception

Exception class raised for invalid operations in Path Utilities.

exception scholar_flux.exceptions.path_exceptions.RecordPathChainMapError[source]

Bases: PathUtilsError

Exception raised for invalid operations on a RecordPathChainMap.

exception scholar_flux.exceptions.path_exceptions.RecordPathNodeMapError[source]

Bases: PathNodeMapError

Exception raised when attempting to perform an invalid operation a RecordPathNodeMap.

scholar_flux.exceptions.storage_exceptions module

Implements exceptions involving both potential edge-cases and common issues involving data and cache storage.

exception scholar_flux.exceptions.storage_exceptions.CacheDeletionException[source]

Bases: StorageCacheException

Exception raised when record deletion from a storage device fails.

exception scholar_flux.exceptions.storage_exceptions.CacheRetrievalException[source]

Bases: StorageCacheException

Exception raised when retrieval from a storage device fails.

exception scholar_flux.exceptions.storage_exceptions.CacheUpdateException[source]

Bases: StorageCacheException

Exception raised when updating a cache storage device fails.

exception scholar_flux.exceptions.storage_exceptions.CacheVerificationException[source]

Bases: StorageCacheException

Exception raised when the cache validation from a storage device fails.

exception scholar_flux.exceptions.storage_exceptions.ConnectionFailed[source]

Bases: StorageCacheException

Exception arising from storage connection errors.

exception scholar_flux.exceptions.storage_exceptions.KeyNotFound[source]

Bases: KeyError

Exception resulting from a missing or empty key being provided.

exception scholar_flux.exceptions.storage_exceptions.StorageCacheException[source]

Bases: Exception

Base exception for Storage Issues.

scholar_flux.exceptions.util_exceptions module

Implements exceptions for handling edge-cases when processing JSON files using custom path processing utilities.

exception scholar_flux.exceptions.util_exceptions.LogDirectoryError[source]

Bases: Exception

Exception class raised for errors related to the creation of the package logging directory.

exception scholar_flux.exceptions.util_exceptions.PackageInitializationError[source]

Bases: Exception

Exception raised when the ScholarFlux package cannot be initialized due to an unexpected error.

exception scholar_flux.exceptions.util_exceptions.SecretKeyError[source]

Bases: ValueError

Raised when the provided Fernet secret key is invalid.

exception scholar_flux.exceptions.util_exceptions.SessionCacheDirectoryError[source]

Bases: SessionCreationError

Exception class raised for errors related to the creation of the package cache directory used by SessionCache.

exception scholar_flux.exceptions.util_exceptions.SessionConfigurationError[source]

Bases: SessionCreationError

Exception class raised for invalid operations in configuration of session objects.

exception scholar_flux.exceptions.util_exceptions.SessionCreationError[source]

Bases: Exception

Exception class raised for invalid operations in the creation of session objects.

exception scholar_flux.exceptions.util_exceptions.SessionInitializationError[source]

Bases: SessionCreationError

Exception class raised for invalid operations in the initialization of session objects.

Module contents

The scholar_flux.exceptions module implements different types of exceptions used within the scholar_flux package with customized exceptions with applications to client setup, API retrieval, API processing, and caching.

Modules:

api_exceptions: Exceptions crafted for unforeseen issues in API client creation and errors in response retrieval data_exceptions: Exceptions that could occur during the parsing, extraction, and processing of response data util_exceptions: Exceptions used in the creation of utilities used throughout the module coordinator_exceptions: Exceptions revolving around the coordination of requests, response processing and caching storage_exceptions: Exceptions involving potential and common issues involving storage path_exceptions: Exceptions for edge-cases when processing JSON files using custom path processing utilities import_exceptions: Exceptions for handling missing dependencies

exception scholar_flux.exceptions.APIException[source]

Bases: Exception

Base exception for API-related errors.

exception scholar_flux.exceptions.APIParameterException[source]

Bases: APIException

Exception raised for API Parameter-related errors.

exception scholar_flux.exceptions.CacheDeletionException[source]

Bases: StorageCacheException

Exception raised when record deletion from a storage device fails.

exception scholar_flux.exceptions.CacheRetrievalException[source]

Bases: StorageCacheException

Exception raised when retrieval from a storage device fails.

exception scholar_flux.exceptions.CacheUpdateException[source]

Bases: StorageCacheException

Exception raised when updating a cache storage device fails.

exception scholar_flux.exceptions.CacheVerificationException[source]

Bases: StorageCacheException

Exception raised when the cache validation from a storage device fails.

exception scholar_flux.exceptions.CoordinatorException[source]

Bases: Exception

Base exception for Coordinator-related errors.

exception scholar_flux.exceptions.CryptographyImportError[source]

Bases: OptionalDependencyImportError

Exception for cryptography Dependency Issues.

__init__()[source]

Initializes the cryptography import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.DataExtractionException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data extraction.

exception scholar_flux.exceptions.DataParsingException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data parsing.

exception scholar_flux.exceptions.DataProcessingException[source]

Bases: ResponseProcessingException

Base exception for errors that occur during data processing.

exception scholar_flux.exceptions.DataValidationException[source]

Bases: DataProcessingException

Exception raised for data validation errors.

exception scholar_flux.exceptions.FieldNotFoundException[source]

Bases: DataExtractionException

Exception raised when an expected field is not found in the data.

exception scholar_flux.exceptions.InvalidComponentTypeError[source]

Bases: PathUtilsError

Exception class raised for invalid inputs to ProcessingPath component types.

exception scholar_flux.exceptions.InvalidCoordinatorParameterException[source]

Bases: CoordinatorException

Coordinator exception raised when attempting to set an unintended injectable class dependency as an attribute of a Coordinator or parameter to a method.

exception scholar_flux.exceptions.InvalidDataFormatException[source]

Bases: DataParsingException

Exception raised for errors in the input data format.

exception scholar_flux.exceptions.InvalidPathDelimiterError[source]

Bases: InvalidProcessingPathError

Exception raised for invalid delimiters used in ProcessingPath.

exception scholar_flux.exceptions.InvalidPathNodeError[source]

Bases: PathUtilsError

Exception raised for invalid operations resulting from the handling of PathNodes.

exception scholar_flux.exceptions.InvalidProcessingPathError[source]

Bases: PathUtilsError

Exception class raised for invalid operations on ProcessingPaths.

exception scholar_flux.exceptions.InvalidResponseException(response: Response | ResponseProtocol | None = None, *args, **kwargs)[source]

Bases: RequestFailedException

Exception raised for invalid responses from the API.

__init__(response: Response | ResponseProtocol | None = None, *args, **kwargs)[source]

Initializes the InvalidResponseException class with a response or response-like parameter for logging.

static extract_error_details(response: Response | ResponseProtocol) str[source]

Extracts detailed error message from response body.

exception scholar_flux.exceptions.InvalidResponseReconstructionException[source]

Bases: InvalidResponseStructureException

Exception raised on the attempted creation of a ReconstructedResponse if an exception is encountered.

exception scholar_flux.exceptions.InvalidResponseStructureException[source]

Bases: APIException

Exception raised on when encountering an non response/response-like object when a valid response was expected.

exception scholar_flux.exceptions.ItsDangerousImportError[source]

Bases: OptionalDependencyImportError

Exception for itsdangerous Dependency Issues.

__init__()[source]

Initializes the itsdangerous import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.KeyNotFound[source]

Bases: KeyError

Exception resulting from a missing or empty key being provided.

exception scholar_flux.exceptions.LogDirectoryError[source]

Bases: Exception

Exception class raised for errors related to the creation of the package logging directory.

exception scholar_flux.exceptions.MissingAPIKeyException[source]

Bases: ValueError

Exception raised when a blank string is provided yet invalid.

exception scholar_flux.exceptions.MissingAPISpecificParameterException[source]

Bases: ValueError

Exception raised when an API specific parameter is required but not provided in the config.

exception scholar_flux.exceptions.MissingProviderException[source]

Bases: ValueError

Exception raised when an API specific parameter is required but not provided in the config.

exception scholar_flux.exceptions.MissingResponseException[source]

Bases: ValueError

Exception raised when a response or response-like objects is required but not provided.

exception scholar_flux.exceptions.MongoDBImportError[source]

Bases: OptionalDependencyImportError

Exception for Mongo Dependency Issues.

__init__()[source]

Initializes the pymongo import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.NotFoundException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.OptionalDependencyImportError(message='Optional Dependency not found')[source]

Bases: Exception

Base exception for Optional Dependency Issues.

__init__(message='Optional Dependency not found')[source]

Initializes the foundational OptionalDependencyImportError that forms the basis of more specific error handling when dependencies are missing.

exception scholar_flux.exceptions.PackageInitializationError[source]

Bases: Exception

Exception raised when the ScholarFlux package cannot be initialized due to an unexpected error.

exception scholar_flux.exceptions.PathCacheError[source]

Bases: PathUtilsError

Exception raised when attempting to perform an invalid operation on path cache.

exception scholar_flux.exceptions.PathCombinationError[source]

Bases: PathUtilsError

Exception raised when performing an invalid operation during the combination of athNodes within a PathNodeIndex.

exception scholar_flux.exceptions.PathDiscoveryError[source]

Bases: PathUtilsError

Exception raised for invalid operations resulting from the handling of PathNodes.

exception scholar_flux.exceptions.PathIndexingError[source]

Bases: InvalidProcessingPathError

Exception raised when attempting to retrieve the first element of attempting ProcessingPath as a record/page index.

exception scholar_flux.exceptions.PathNodeIndexError[source]

Bases: PathUtilsError

Exception raised when performing an invalid operation on a PathNodeIndex.

exception scholar_flux.exceptions.PathNodeMapError[source]

Bases: PathUtilsError

Exception raised when attempting to perform an invalid operation a PathNodeMap.

exception scholar_flux.exceptions.PathSimplificationError[source]

Bases: PathUtilsError

Exception raised for when encountering invalid values during simplification.

exception scholar_flux.exceptions.PathUtilsError[source]

Bases: Exception

Exception class raised for invalid operations in Path Utilities.

exception scholar_flux.exceptions.PermissionException[source]

Bases: APIException

Exception raised for permission errors.

exception scholar_flux.exceptions.QueryValidationException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.RateLimitExceededException[source]

Bases: APIException

Exception raised when the API’s rate limit is exceeded.

exception scholar_flux.exceptions.RecordPathChainMapError[source]

Bases: PathUtilsError

Exception raised for invalid operations on a RecordPathChainMap.

exception scholar_flux.exceptions.RecordPathNodeMapError[source]

Bases: PathNodeMapError

Exception raised when attempting to perform an invalid operation a RecordPathNodeMap.

exception scholar_flux.exceptions.RedisImportError[source]

Bases: OptionalDependencyImportError

Exception for missing redis backend.

__init__()[source]

Initializes the redis import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.RequestCacheException[source]

Bases: APIException

Exception raised for API request-cache related errors.

exception scholar_flux.exceptions.RequestCreationException[source]

Bases: APIException

Exception raised when the preparation of an API request fails.

exception scholar_flux.exceptions.RequestFailedException[source]

Bases: APIException

Exception raised for failed API requests.

exception scholar_flux.exceptions.ResponseProcessingException[source]

Bases: Exception

Base Exception for handling errors in response parsing and processing.

exception scholar_flux.exceptions.RetryLimitExceededException[source]

Bases: APIException

Exception raised when the retry limit is exceeded.

exception scholar_flux.exceptions.SQLAlchemyImportError[source]

Bases: OptionalDependencyImportError

Exception for missing sql alchemy backend.

__init__()[source]

Initializes the sqlalchemy import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.SearchAPIException[source]

Bases: APIException

Exception raised when the search api fails in retrying data from APIs .

exception scholar_flux.exceptions.SearchRequestException[source]

Bases: APIException

Exception raised when a requested resource is not found.

exception scholar_flux.exceptions.SecretKeyError[source]

Bases: ValueError

Raised when the provided Fernet secret key is invalid.

exception scholar_flux.exceptions.SessionCacheDirectoryError[source]

Bases: SessionCreationError

Exception class raised for errors related to the creation of the package cache directory used by SessionCache.

exception scholar_flux.exceptions.SessionConfigurationError[source]

Bases: SessionCreationError

Exception class raised for invalid operations in configuration of session objects.

exception scholar_flux.exceptions.SessionCreationError[source]

Bases: Exception

Exception class raised for invalid operations in the creation of session objects.

exception scholar_flux.exceptions.SessionInitializationError[source]

Bases: SessionCreationError

Exception class raised for invalid operations in the initialization of session objects.

exception scholar_flux.exceptions.StorageCacheException[source]

Bases: Exception

Base exception for Storage Issues.

exception scholar_flux.exceptions.TimeoutException[source]

Bases: APIException

Exception raised for request timeouts.

exception scholar_flux.exceptions.XMLToDictImportError[source]

Bases: OptionalDependencyImportError

Exception for xmltodict Dependency Issues.

__init__()[source]

Initializes the xmltodict import exception for improved logging before the exception is raised.

exception scholar_flux.exceptions.YAMLImportError[source]

Bases: OptionalDependencyImportError

Exception for yaml Dependency Issues.

__init__()[source]

Initializes the yaml import exception for improved logging before the exception is raised.