Module contents
Submodules
esorm.aggs module
ElasticSearch aggregation type definitions for ESORM
- class esorm.aggs.ESAgg(*args, **kwargs)[source]
Bases:
dictHolds all types of aggregations supported
-
avg:
ESAggFieldParams Average aggregation
-
histogram:
ESAggHistogramParams Histogram aggregation
-
max:
ESAggFieldParams Maximum aggregation
-
min:
ESAggFieldParams Minimum aggregation
-
sum:
ESAggFieldParams Sum aggregation
-
terms:
ESAggTermParams Terms aggregation
-
avg:
- class esorm.aggs.ESAggBucketResponse(*args, **kwargs)[source]
Bases:
dictRepresents a single bucket in a bucket aggregation.
-
doc_count:
int The number of documents in this bucket.
-
key:
str The key of the bucket.
-
doc_count:
- class esorm.aggs.ESAggExtendedBounds(*args, **kwargs)[source]
Bases:
dictRepresents the parameters for extended bounds in Elasticsearch.
-
max:
int The maximum value.
-
min:
int The minimum value.
-
max:
- class esorm.aggs.ESAggFieldParams(*args, **kwargs)[source]
Bases:
dictRepresents field parameter in Elasticsearch.
-
field:
str The field to aggregate on.
-
field:
- class esorm.aggs.ESAggHistogramBucketresponse(*args, **kwargs)[source]
Bases:
dictRepresents a bucket in a histogram aggregation.
-
doc_count:
int The number of documents in this bucket.
-
key:
float Numeric key corresponding to the bucket’s range.
-
doc_count:
- class esorm.aggs.ESAggHistogramParams(*args, **kwargs)[source]
Bases:
dictRepresents the parameters for a histogram aggregation in Elasticsearch.
-
extended_bounds:
ESAggExtendedBounds The extended bounds of the histogram.
-
field:
str The field to aggregate on.
-
interval:
int The interval of the histogram.
-
min_doc_count:
int The minimum number of documents in a bucket.
-
extended_bounds:
- class esorm.aggs.ESAggHistogramResponse(*args, **kwargs)[source]
Bases:
dictRepresents the response for a histogram aggregation.
-
buckets:
List[ESAggHistogramBucketresponse] A list of buckets in the histogram aggregation.
-
buckets:
- class esorm.aggs.ESAggTermParams(*args, **kwargs)[source]
Bases:
dictRepresents the parameters for a terms aggregation in Elasticsearch.
-
field:
str The field to aggregate on.
-
order:
Dict[str,str] The order of the buckets.
-
size:
int The number of buckets to return.
-
field:
- class esorm.aggs.ESAggTermsResponse(*args, **kwargs)[source]
Bases:
dictRepresents the response for a terms aggregation.
-
buckets:
List[ESAggBucketResponse] A list of buckets in the terms aggregation.
-
buckets:
- class esorm.aggs.ESAggValueResponse(*args, **kwargs)[source]
Bases:
dictRepresents the response for an average, min, or max aggregation.
-
value:
float The average, min, or max value.
-
value:
- esorm.aggs.ESAggsResponse
ElasticSearch aggregations response type definition
alias of
Dict[str,Union[ESAggValueResponse,ESAggTermsResponse,ESAggHistogramResponse]]
esorm.bulk module
esorm.error module
This module contains all the exceptions that can be raised by ESORM.
- exception esorm.error.BulkError(failed_operations)[source]
Bases:
ExceptionException for handling bulk operation errors.
-
failed_operations:
List[BulkOperationError]
-
failed_operations:
- class esorm.error.BulkOperationError(*args, **kwargs)[source]
Bases:
dictA dictionary type to represent an error in a bulk operation response from Elasticsearch.
- model: ESModel
-
reason:
str
-
status:
int
-
type:
str
- exception esorm.error.IndexDoesNotFoundError[source]
Bases:
ExceptionRaised when an index does not exist.
esorm.esorm module
esorm.fastapi module
esorm.fields module
esorm.logger module
esorm.model module
esorm.query module
esorm.response module
esorm.utils module
Utility functions
- esorm.utils.camel_case(snake_str, capitalize_first=False)[source]
Convert to camel case
- Parameters:
snake_str (
str) – The string to convert to camel casecapitalize_first (
bool) – Capitalize the first letter
- Returns:
Converted string