# The PyReindexer module provides a connector and its auxiliary tools for interaction with Reindexer
* [pyreindexer.rx\_connector](#pyreindexer.rx_connector)
* [RxConnector](#pyreindexer.rx_connector.RxConnector)
* [close](#pyreindexer.rx_connector.RxConnector.close)
* [namespace\_open](#pyreindexer.rx_connector.RxConnector.namespace_open)
* [namespace\_close](#pyreindexer.rx_connector.RxConnector.namespace_close)
* [namespace\_drop](#pyreindexer.rx_connector.RxConnector.namespace_drop)
* [namespaces\_enum](#pyreindexer.rx_connector.RxConnector.namespaces_enum)
* [index\_add](#pyreindexer.rx_connector.RxConnector.index_add)
* [index\_update](#pyreindexer.rx_connector.RxConnector.index_update)
* [index\_drop](#pyreindexer.rx_connector.RxConnector.index_drop)
* [item\_insert](#pyreindexer.rx_connector.RxConnector.item_insert)
* [item\_update](#pyreindexer.rx_connector.RxConnector.item_update)
* [item\_upsert](#pyreindexer.rx_connector.RxConnector.item_upsert)
* [item\_delete](#pyreindexer.rx_connector.RxConnector.item_delete)
* [meta\_put](#pyreindexer.rx_connector.RxConnector.meta_put)
* [meta\_get](#pyreindexer.rx_connector.RxConnector.meta_get)
* [meta\_delete](#pyreindexer.rx_connector.RxConnector.meta_delete)
* [meta\_enum](#pyreindexer.rx_connector.RxConnector.meta_enum)
* [select](#pyreindexer.rx_connector.RxConnector.select)
* [new\_transaction](#pyreindexer.rx_connector.RxConnector.new_transaction)
* [new\_query](#pyreindexer.rx_connector.RxConnector.new_query)
* [pyreindexer.query\_results](#pyreindexer.query_results)
* [QueryResults](#pyreindexer.query_results.QueryResults)
* [status](#pyreindexer.query_results.QueryResults.status)
* [count](#pyreindexer.query_results.QueryResults.count)
* [total\_count](#pyreindexer.query_results.QueryResults.total_count)
* [get\_agg\_results](#pyreindexer.query_results.QueryResults.get_agg_results)
* [get\_explain\_results](#pyreindexer.query_results.QueryResults.get_explain_results)
* [pyreindexer.transaction](#pyreindexer.transaction)
* [Transaction](#pyreindexer.transaction.Transaction)
* [insert](#pyreindexer.transaction.Transaction.insert)
* [update](#pyreindexer.transaction.Transaction.update)
* [upsert](#pyreindexer.transaction.Transaction.upsert)
* [delete](#pyreindexer.transaction.Transaction.delete)
* [commit](#pyreindexer.transaction.Transaction.commit)
* [commit\_with\_count](#pyreindexer.transaction.Transaction.commit_with_count)
* [rollback](#pyreindexer.transaction.Transaction.rollback)
* [pyreindexer.point](#pyreindexer.point)
* [Point](#pyreindexer.point.Point)
* [pyreindexer.query](#pyreindexer.query)
* [Query](#pyreindexer.query.Query)
* [where](#pyreindexer.query.Query.where)
* [where\_query](#pyreindexer.query.Query.where_query)
* [where\_subquery](#pyreindexer.query.Query.where_subquery)
* [where\_composite](#pyreindexer.query.Query.where_composite)
* [where\_uuid](#pyreindexer.query.Query.where_uuid)
* [where\_between\_fields](#pyreindexer.query.Query.where_between_fields)
* [open\_bracket](#pyreindexer.query.Query.open_bracket)
* [close\_bracket](#pyreindexer.query.Query.close_bracket)
* [match](#pyreindexer.query.Query.match)
* [dwithin](#pyreindexer.query.Query.dwithin)
* [distinct](#pyreindexer.query.Query.distinct)
* [aggregate\_sum](#pyreindexer.query.Query.aggregate_sum)
* [aggregate\_avg](#pyreindexer.query.Query.aggregate_avg)
* [aggregate\_min](#pyreindexer.query.Query.aggregate_min)
* [aggregate\_max](#pyreindexer.query.Query.aggregate_max)
* [aggregate\_facet](#pyreindexer.query.Query.aggregate_facet)
* [sort](#pyreindexer.query.Query.sort)
* [sort\_stpoint\_distance](#pyreindexer.query.Query.sort_stpoint_distance)
* [sort\_stfield\_distance](#pyreindexer.query.Query.sort_stfield_distance)
* [op\_and](#pyreindexer.query.Query.op_and)
* [op\_or](#pyreindexer.query.Query.op_or)
* [op\_not](#pyreindexer.query.Query.op_not)
* [request\_total](#pyreindexer.query.Query.request_total)
* [cached\_total](#pyreindexer.query.Query.cached_total)
* [limit](#pyreindexer.query.Query.limit)
* [offset](#pyreindexer.query.Query.offset)
* [debug](#pyreindexer.query.Query.debug)
* [strict](#pyreindexer.query.Query.strict)
* [explain](#pyreindexer.query.Query.explain)
* [with\_rank](#pyreindexer.query.Query.with_rank)
* [execute](#pyreindexer.query.Query.execute)
* [delete](#pyreindexer.query.Query.delete)
* [set\_object](#pyreindexer.query.Query.set_object)
* [set](#pyreindexer.query.Query.set)
* [drop](#pyreindexer.query.Query.drop)
* [expression](#pyreindexer.query.Query.expression)
* [update](#pyreindexer.query.Query.update)
* [must\_execute](#pyreindexer.query.Query.must_execute)
* [get](#pyreindexer.query.Query.get)
* [inner\_join](#pyreindexer.query.Query.inner_join)
* [join](#pyreindexer.query.Query.join)
* [left\_join](#pyreindexer.query.Query.left_join)
* [merge](#pyreindexer.query.Query.merge)
* [on](#pyreindexer.query.Query.on)
* [select](#pyreindexer.query.Query.select)
* [functions](#pyreindexer.query.Query.functions)
* [equal\_position](#pyreindexer.query.Query.equal_position)
* [pyreindexer.index\_definition](#pyreindexer.index_definition)
* [IndexDefinition](#pyreindexer.index_definition.IndexDefinition)
<a id="pyreindexer.rx_connector"></a>
# pyreindexer.rx\_connector
<a id="pyreindexer.rx_connector.RxConnector"></a>
## RxConnector Objects
```python
class RxConnector(RaiserMixin)
```
RxConnector provides a binding to Reindexer upon two shared libraries (hereinafter - APIs): 'rawpyreindexerb.so'
and 'rawpyreindexerc.so'. The first one is aimed to a builtin way usage. That API embeds Reindexer, so it could
be used right in-place as is. The second one acts as a lightweight client which establishes a connection to
Reindexer server via RPC. The APIs interfaces are completely the same.
#### Attributes:
api (module): An API module loaded dynamically for Reindexer calls
rx (int): A memory pointer to Reindexer instance
err_code (int): The API error code
err_msg (string): The API error message
<a id="pyreindexer.rx_connector.RxConnector.close"></a>
### RxConnector.close
```python
def close() -> None
```
Closes an API instance with Reindexer resources freeing
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
<a id="pyreindexer.rx_connector.RxConnector.namespace_open"></a>
### RxConnector.namespace\_open
```python
def namespace_open(namespace) -> None
```
Opens a namespace specified or creates a namespace if it does not exist
#### Arguments:
namespace (string): A name of a namespace
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.namespace_close"></a>
### RxConnector.namespace\_close
```python
def namespace_close(namespace) -> None
```
Closes a namespace specified
#### Arguments:
namespace (string): A name of a namespace
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.namespace_drop"></a>
### RxConnector.namespace\_drop
```python
def namespace_drop(namespace) -> None
```
Drops a namespace specified
#### Arguments:
namespace (string): A name of a namespace
#### Raises:
Exception: Raises with an error message when Reindexer instance is not initialized yet
Exception: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.namespaces_enum"></a>
### RxConnector.namespaces\_enum
```python
def namespaces_enum(enum_not_opened=False) -> List[Dict[str, str]]
```
Gets a list of namespaces available
#### Arguments:
enum_not_opened (bool, optional): An enumeration mode flag. If it is
set then closed namespaces are in result list too. Defaults to False
#### Returns:
(:obj:`list` of :obj:`dict`): A list of dictionaries which describe each namespace
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.index_add"></a>
### RxConnector.index\_add
```python
def index_add(namespace, index_def) -> None
```
Adds an index to the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_def (dict): A dictionary of index definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.index_update"></a>
### RxConnector.index\_update
```python
def index_update(namespace, index_def) -> None
```
Updates an index in the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_def (dict): A dictionary of index definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.index_drop"></a>
### RxConnector.index\_drop
```python
def index_drop(namespace, index_name) -> None
```
Drops an index from the namespace specified
#### Arguments:
namespace (string): A name of a namespace
index_name (string): A name of an index
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.item_insert"></a>
### RxConnector.item\_insert
```python
def item_insert(namespace, item_def, precepts=None) -> None
```
Inserts an item with its precepts to the namespace specified
#### Arguments:
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.item_update"></a>
### RxConnector.item\_update
```python
def item_update(namespace, item_def, precepts=None) -> None
```
Updates an item with its precepts in the namespace specified
#### Arguments:
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.item_upsert"></a>
### RxConnector.item\_upsert
```python
def item_upsert(namespace, item_def, precepts=None) -> None
```
Updates an item with its precepts in the namespace specified. Creates the item if it not exists
#### Arguments:
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.item_delete"></a>
### RxConnector.item\_delete
```python
def item_delete(namespace, item_def) -> None
```
Deletes an item from the namespace specified
#### Arguments:
namespace (string): A name of a namespace
item_def (dict): A dictionary of item definition
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.meta_put"></a>
### RxConnector.meta\_put
```python
def meta_put(namespace, key, value) -> None
```
Puts metadata to a storage of Reindexer by key
#### Arguments:
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer for metadata keeping
value (string): A metadata for storage
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.meta_get"></a>
### RxConnector.meta\_get
```python
def meta_get(namespace, key) -> str
```
Gets metadata from a storage of Reindexer by key specified
#### Arguments:
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer where metadata is kept
#### Returns:
string: A metadata value
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.meta_delete"></a>
### RxConnector.meta\_delete
```python
def meta_delete(namespace, key) -> None
```
Deletes metadata from a storage of Reindexer by key specified
#### Arguments:
namespace (string): A name of a namespace
key (string): A key in a storage of Reindexer where metadata is kept
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.meta_enum"></a>
### RxConnector.meta\_enum
```python
def meta_enum(namespace) -> List[str]
```
Gets a list of metadata keys from a storage of Reindexer
#### Arguments:
namespace (string): A name of a namespace
#### Returns:
(:obj:`list` of :obj:`str`): A list of all metadata keys
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.select"></a>
### RxConnector.select
```python
def select(query: str) -> QueryResults
```
Executes an SQL query and returns query results
#### Arguments:
query (string): An SQL query
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.new_transaction"></a>
### RxConnector.new\_transaction
```python
def new_transaction(namespace) -> Transaction
```
Starts a new transaction and return the transaction object to processing
#### Arguments:
namespace (string): A name of a namespace
#### Returns:
(:obj:`Transaction`): A new transaction
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.rx_connector.RxConnector.new_query"></a>
### RxConnector.new\_query
```python
def new_query(namespace: str) -> Query
```
Creates a new query and return the query object to processing
#### Arguments:
namespace (string): A name of a namespace
#### Returns:
(:obj:`Query`): A new query
#### Raises:
ConnectionError: Raises with an error message when Reindexer instance is not initialized yet
<a id="pyreindexer.query_results"></a>
# pyreindexer.query\_results
<a id="pyreindexer.query_results.QueryResults"></a>
## QueryResults Objects
```python
class QueryResults()
```
QueryResults is a disposable iterator of Reindexer results for such queries as SELECT etc.
When the results are fetched the iterator closes and frees a memory of results buffer of Reindexer
#### Attributes:
api (module): An API module for Reindexer calls
err_code (int): The API error code
err_msg (string): The API error message
qres_wrapper_ptr (int): A memory pointer to Reindexer iterator object
qres_iter_count (int): A count of results for iterations
pos (int): The current result position in iterator
<a id="pyreindexer.query_results.QueryResults.status"></a>
### QueryResults.status
```python
def status() -> None
```
Check status
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query_results.QueryResults.count"></a>
### QueryResults.count
```python
def count() -> int
```
Returns a count of results for iterations
#### Returns
int: A count of results
<a id="pyreindexer.query_results.QueryResults.total_count"></a>
### QueryResults.total\_count
```python
def total_count() -> int
```
Returns a total or cached count of results
#### Returns
int: A total or cached count of results
<a id="pyreindexer.query_results.QueryResults.get_agg_results"></a>
### QueryResults.get\_agg\_results
```python
def get_agg_results() -> dict
```
Returns aggregation results for the current query
#### Returns
(:obj:`dict`): Dictionary with all results for the current query
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query_results.QueryResults.get_explain_results"></a>
### QueryResults.get\_explain\_results
```python
def get_explain_results() -> str
```
Returns explain results for the current query
#### Returns
(string): Formatted string with explain of results for the current query
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction"></a>
# pyreindexer.transaction
<a id="pyreindexer.transaction.Transaction"></a>
## Transaction Objects
```python
class Transaction()
```
An object representing the context of a Reindexer transaction
#### Attributes:
api (module): An API module for Reindexer calls
transaction_wrapper_ptr (int): A memory pointer to Reindexer transaction object
err_code (int): The API error code
err_msg (string): The API error message
<a id="pyreindexer.transaction.Transaction.insert"></a>
### Transaction.insert
```python
def insert(item_def, precepts=None)
```
Inserts an item with its precepts to the transaction
#### Arguments:
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.update"></a>
### Transaction.update
```python
def update(item_def, precepts=None)
```
Updates an item with its precepts to the transaction
#### Arguments:
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.upsert"></a>
### Transaction.upsert
```python
def upsert(item_def, precepts=None)
```
Updates an item with its precepts to the transaction. Creates the item if it not exists
#### Arguments:
item_def (dict): A dictionary of item definition
precepts (:obj:`list` of :obj:`str`): A dictionary of index definition
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.delete"></a>
### Transaction.delete
```python
def delete(item_def)
```
Deletes an item from the transaction
#### Arguments:
item_def (dict): A dictionary of item definition
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.commit"></a>
### Transaction.commit
```python
def commit()
```
Applies changes
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.commit_with_count"></a>
### Transaction.commit\_with\_count
```python
def commit_with_count() -> int
```
Applies changes and return the number of count of changed items
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.transaction.Transaction.rollback"></a>
### Transaction.rollback
```python
def rollback()
```
Rollbacks changes
#### Raises:
TransactionError: Raises with an error message of API return if Transaction is over
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.point"></a>
# pyreindexer.point
<a id="pyreindexer.point.Point"></a>
## Point Objects
```python
class Point()
```
An object representing the context of a Reindexer 2D point
#### Attributes:
x (float): x coordinate of the point
y (float): y coordinate of the point
<a id="pyreindexer.query"></a>
# pyreindexer.query
<a id="pyreindexer.query.Query"></a>
## Query Objects
```python
class Query()
```
An object representing the context of a Reindexer query
#### Attributes:
api (module): An API module for Reindexer calls
query_wrapper_ptr (int): A memory pointer to Reindexer query object
err_code (int): The API error code
err_msg (string): The API error message
root (:object: Optional[`Query`]): The root query of the Reindexer query
join_queries (list[:object:`Query`]): The list of join Reindexer query objects
merged_queries (list[:object:`Query`]): The list of merged Reindexer query objects
<a id="pyreindexer.query.Query.where"></a>
### Query.where
```python
def where(
index: str,
condition: CondType,
keys: Union[simple_types, tuple[list[simple_types],
...]] = None) -> Query
```
Adds where condition to DB query with args
#### Arguments:
index (string): Field name used in condition clause
condition (:enum:`CondType`): Type of condition
keys (union[simple_types, (list[simple_types], ...)]):
Value of index to be compared with. For composite indexes keys must be list,
with value of each sub-index
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.where_query"></a>
### Query.where\_query
```python
def where_query(
sub_query: Query,
condition: CondType,
keys: Union[simple_types, tuple[list[simple_types],
...]] = None) -> Query
```
Adds sub-query where condition to DB query with args
#### Arguments:
sub_query (:obj:`Query`): Field name used in condition clause
condition (:enum:`CondType`): Type of condition
keys (union[simple_types, (list[simple_types], ...)]):
Value of index to be compared with. For composite indexes keys must be list,
with value of each sub-index
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.where_subquery"></a>
### Query.where\_subquery
```python
def where_subquery(index: str, condition: CondType, sub_query: Query) -> Query
```
Adds sub-query where condition to DB query
#### Arguments:
index (string): Field name used in condition clause
condition (:enum:`CondType`): Type of condition
sub_query (:obj:`Query`): Field name used in condition clause
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.where_composite"></a>
### Query.where\_composite
```python
def where_composite(index: str, condition: CondType,
keys: tuple[list[simple_types], ...]) -> Query
```
Adds where condition to DB query with interface args for composite indexes
#### Arguments:
index (string): Field name used in condition clause
condition (:enum:`CondType`): Type of condition
keys (list[simple_types], ...): Values of composite index to be compared with (value of each sub-index).
Supported variants:
([1, "test1"], [2, "test2"])
[[1, "test1"], [2, "test2"]])
([1, "testval1"], )
[[1, "testval1"]]
(1, "testval1")
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.where_uuid"></a>
### Query.where\_uuid
```python
def where_uuid(index: str, condition: CondType, *uuids: UUID) -> Query
```
Adds where condition to DB query with UUID as string args.
This function applies binary encoding to the UUID value.
`index` MUST be declared as uuid index in this case
#### Arguments:
index (string): Field name used in condition clause
condition (:enum:`CondType`): Type of condition
uuids (*:obj:`UUID`): Value of index to be compared with. For composite indexes uuids must be list,
with value of each sub-index
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.where_between_fields"></a>
### Query.where\_between\_fields
```python
def where_between_fields(first_field: str, condition: CondType,
second_field: str) -> Query
```
Adds comparing two fields where condition to DB query
#### Arguments:
first_field (string): First field name used in condition clause
condition (:enum:`CondType`): Type of condition
second_field (string): Second field name used in condition clause
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.open_bracket"></a>
### Query.open\_bracket
```python
def open_bracket() -> Query
```
Opens bracket for where condition to DB query
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.close_bracket"></a>
### Query.close\_bracket
```python
def close_bracket() -> Query
```
Closes bracket for where condition to DB query
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.match"></a>
### Query.match
```python
def match(index: str, *keys: str) -> Query
```
Adds string EQ-condition to DB query with string args
#### Arguments:
index (string): Field name used in condition clause
keys (*string): Value of index to be compared with. For composite indexes keys must be list,
with value of each sub-index
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.dwithin"></a>
### Query.dwithin
```python
def dwithin(index: str, point: Point, distance: float) -> Query
```
Adds DWithin condition to DB query
#### Arguments:
index (string): Field name used in condition clause
point (:obj:`Point`): Point object used in condition clause
distance (float): Distance in meters between point
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.distinct"></a>
### Query.distinct
```python
def distinct(index: str) -> Query
```
Performs distinct for a certain index. Return only items with uniq value of field
#### Arguments:
index (string): Field name for distinct operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.aggregate_sum"></a>
### Query.aggregate\_sum
```python
def aggregate_sum(index: str) -> Query
```
Performs a summation of values for a specified index
#### Arguments:
index (string): Field name for sum operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.aggregate_avg"></a>
### Query.aggregate\_avg
```python
def aggregate_avg(index: str) -> Query
```
Finds for the average at the specified index
#### Arguments:
index (string): Field name for sum operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.aggregate_min"></a>
### Query.aggregate\_min
```python
def aggregate_min(index: str) -> Query
```
Finds for the minimum at the specified index
#### Arguments:
index (string): Field name for sum operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.aggregate_max"></a>
### Query.aggregate\_max
```python
def aggregate_max(index: str) -> Query
```
Finds for the maximum at the specified index
#### Arguments:
index (string): Field name for sum operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.aggregate_facet"></a>
### Query.aggregate\_facet
```python
def aggregate_facet(*fields: str) -> Query._AggregateFacet
```
Gets fields facet value. Applicable to multiple data fields and the result of that could be sorted
by any data column or `count` and cut off by offset and limit. In order to support this functionality
this method returns AggregationFacetRequest which has methods sort, limit and offset
#### Arguments:
fields (*string): Fields any data column name or `count`, fields should not be empty
#### Returns:
(:obj:`_AggregateFacet`): Request object for further customizations
<a id="pyreindexer.query.Query.sort"></a>
### Query.sort
```python
def sort(
index: str,
desc: bool = False,
forced_sort_values: Union[simple_types, tuple[list[simple_types],
...]] = None
) -> Query
```
Applies sort order to return from query items. If forced_sort_values argument specified, then items equal to
values, if found will be placed in the top positions. Forced sort is support for the first sorting field
only
#### Arguments:
index (string): The index name
desc (bool): Sort in descending order
forced_sort_values (union[simple_types, (list[simple_types], ...)]):
Value of index to match. For composite indexes keys must be list, with value of each sub-index
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.sort_stpoint_distance"></a>
### Query.sort\_stpoint\_distance
```python
def sort_stpoint_distance(index: str, point: Point, desc: bool) -> Query
```
Applies geometry sort order to return from query items. Wrapper for geometry sorting by shortest distance
between geometry field and point (ST_Distance)
#### Arguments:
index (string): The index name
point (:obj:`Point`): Point object used in sorting operation
desc (bool): Sort in descending order
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.sort_stfield_distance"></a>
### Query.sort\_stfield\_distance
```python
def sort_stfield_distance(first_field: str, second_field: str,
desc: bool) -> Query
```
Applies geometry sort order to return from query items. Wrapper for geometry sorting by shortest distance
between 2 geometry fields (ST_Distance)
#### Arguments:
first_field (string): First field name used in condition
second_field (string): Second field name used in condition
desc (bool): Sort in descending order
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.op_and"></a>
### Query.op\_and
```python
def op_and() -> Query
```
Next condition will be added with AND.
This is the default operation for WHERE statement. Do not have to be called explicitly in user's code.
Used in DSL conversion
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.op_or"></a>
### Query.op\_or
```python
def op_or() -> Query
```
Next condition will be added with OR.
Implements short-circuiting:
if the previous condition is successful the next will not be evaluated, but except Join conditions
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.op_not"></a>
### Query.op\_not
```python
def op_not() -> Query
```
Next condition will be added with NOT AND.
Implements short-circuiting: if the previous condition is failed the next will not be evaluated
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.request_total"></a>
### Query.request\_total
```python
def request_total() -> Query
```
Requests total items calculation
#### Arguments:
total_name (string, optional): Name to be requested
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.cached_total"></a>
### Query.cached\_total
```python
def cached_total() -> Query
```
Requests cached total items calculation
#### Arguments:
total_name (string, optional): Name to be requested
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.limit"></a>
### Query.limit
```python
def limit(limit_items: int) -> Query
```
Sets a limit (count) of returned items. Analog to sql LIMIT rowsNumber
#### Arguments:
limit_items (int): Number of rows to get from result set
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.offset"></a>
### Query.offset
```python
def offset(start_offset: int) -> Query
```
Sets the number of the first selected row from result query
#### Arguments:
limit_items (int): Index of the first row to get from result set
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.debug"></a>
### Query.debug
```python
def debug(level: LogLevel) -> Query
```
Changes debug log level on server
#### Arguments:
level (:enum:`LogLevel`): Debug log level on server
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.strict"></a>
### Query.strict
```python
def strict(mode: StrictMode) -> Query
```
Changes strict mode
#### Arguments:
mode (:enum:`StrictMode`): Strict mode
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.explain"></a>
### Query.explain
```python
def explain() -> Query
```
Enables explain query
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.with_rank"></a>
### Query.with\_rank
```python
def with_rank() -> Query
```
Outputs fulltext rank. Allowed only with fulltext query
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.execute"></a>
### Query.execute
```python
def execute() -> QueryResults
```
Executes a select query
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
#### Raises:
ApiError: Raises with an error message when query is in an invalid state
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.delete"></a>
### Query.delete
```python
def delete() -> int
```
Executes a query, and delete items, matches query
#### Returns:
(int): Number of deleted elements
#### Raises:
QueryError: Raises with an error message when query is in an invalid state
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.set_object"></a>
### Query.set\_object
```python
def set_object(field: str, values: list[simple_types]) -> Query
```
Adds an update query to an object field for an update query
#### Arguments:
field (string): Field name
values (list[simple_types]): List of values to add
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
QueryError: Raises with an error message if no values are specified
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.set"></a>
### Query.set
```python
def set(field: str, values: list[simple_types]) -> Query
```
Adds a field update request to the update request
#### Arguments:
field (string): Field name
values (list[simple_types]): List of values to add
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.drop"></a>
### Query.drop
```python
def drop(index: str) -> Query
```
Drops a value for a field
#### Arguments:
index (string): Field name for drop operation
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.expression"></a>
### Query.expression
```python
def expression(field: str, value: str) -> Query
```
Updates indexed field by arithmetical expression
#### Arguments:
field (string): Field name
value (string): New value expression for field
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.update"></a>
### Query.update
```python
def update() -> QueryResults
```
Executes update query, and update fields in items, which matches query
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
#### Raises:
QueryError: Raises with an error message when query is in an invalid state
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.must_execute"></a>
### Query.must\_execute
```python
def must_execute() -> QueryResults
```
Executes a query, and update fields in items, which matches query, with status check
#### Returns:
(:obj:`QueryResults`): A QueryResults iterator
#### Raises:
ApiError: Raises with an error message when query is in an invalid state
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.get"></a>
### Query.get
```python
def get() -> (str, bool)
```
Executes a query, and return 1 JSON item
#### Returns:
(:tuple:string,bool): 1st string item and found flag
#### Raises:
ApiError: Raises with an error message when query is in an invalid state
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.inner_join"></a>
### Query.inner\_join
```python
def inner_join(query: Query, field: str) -> Query
```
Joins 2 queries.
Items from the 1-st query are filtered by and expanded with the data from the 2-nd query
#### Arguments:
query (:obj:`Query`): Query object to left join
field (string): Joined field name. As unique identifier for the join between this query and `join_query`.
Parameter in order for InnerJoin to work: namespace of `query` contains `field` as one of its fields
marked as `joined`
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.join"></a>
### Query.join
```python
def join(query: Query, field: str) -> Query
```
Join is an alias for LeftJoin. Joins 2 queries.
Items from this query are expanded with the data from the `query`
#### Arguments:
query (:obj:`Query`): Query object to left join
field (string): Joined field name. As unique identifier for the join between this query and `join_query`
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.left_join"></a>
### Query.left\_join
```python
def left_join(join_query: Query, field: str) -> Query
```
Joins 2 queries.
Items from this query are expanded with the data from the join_query.
One of the conditions below must hold for `field` parameter in order for LeftJoin to work:
namespace of `join_query` contains `field` as one of its fields marked as `joined`
#### Arguments:
query (:obj:`Query`): Query object to left join
field (string): Joined field name. As unique identifier for the join between this query and `join_query`
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.merge"></a>
### Query.merge
```python
def merge(query: Query) -> Query
```
Merges queries of the same type
#### Arguments:
query (:obj:`Query`): Query object to merge
#### Returns:
(:obj:`Query`): Query object for further customizations
<a id="pyreindexer.query.Query.on"></a>
### Query.on
```python
def on(index: str, condition: CondType, join_index: str) -> Query
```
On specifies join condition
#### Arguments:
index (string): Field name from `Query` namespace should be used during join
condition (:enum:`CondType`): Type of condition, specifies how `Query` will be joined with the latest join query issued on `Query` (e.g. `EQ`/`GT`/`SET`/...)
join_index (string): Index-field name from namespace for the latest join query issued on `Query` should be used during join
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
QueryError: Raises with an error message when query is in an invalid state
<a id="pyreindexer.query.Query.select"></a>
### Query.select
```python
def select(*fields: str) -> Query
```
Sets list of columns in this namespace to be finally selected.
The columns should be specified in the same case as the jsonpaths corresponding to them.
Non-existent fields and fields in the wrong case are ignored.
If there are no fields in this list that meet these conditions, then the filter works as "*"
#### Arguments:
fields (*string): List of columns to be selected
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.functions"></a>
### Query.functions
```python
def functions(*functions: str) -> Query
```
Adds sql-functions to query
#### Arguments:
functions (*string): Functions declaration
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.query.Query.equal_position"></a>
### Query.equal\_position
```python
def equal_position(*equal_position: str) -> Query
```
Adds equal position fields to arrays queries
#### Arguments:
equal_poses (*string): Equal position fields to arrays queries
#### Returns:
(:obj:`Query`): Query object for further customizations
#### Raises:
ApiError: Raises with an error message of API return on non-zero error code
<a id="pyreindexer.index_definition"></a>
# pyreindexer.index\_definition
<a id="pyreindexer.index_definition.IndexDefinition"></a>
## IndexDefinition Objects
```python
class IndexDefinition(dict)
```
IndexDefinition is a dictionary subclass which allows to construct and manage indexes more efficiently.
NOT IMPLEMENTED YET. USE FIELDS DESCRIPTION ONLY.
#### Arguments:
name (str): An index name.
json_paths (:obj:`list` of :obj:`str`): A name for mapping a value to a json field.
field_type (str): A type of field. Possible values are: `int`, `int64`, `double`, `string`, `bool`, `composite`.
index_type (str): An index type. Possible values are: `hash`, `tree`, `text`, `-`.
is_pk (bool): True if a field is a primary key.
is_array (bool): True if an index is an array.
is_dense (bool): True if an index is dense. reduce index size. Saves 8 bytes per unique key value for 'hash'
and 'tree' index types.
For '-' index type saves 4-8 bytes per each element. Useful for indexes with high selectivity,
but for tree and hash indexes with low selectivity could
significantly decrease update performance.
is_sparse (bool): True if a value of an index may be not presented.
collate_mode (str): Sets an order of values by collate mode. Possible values are:
`none`, `ascii`, `utf8`, `numeric`, `custom`.
sort_order_letters (str): Order for a sort sequence for a custom collate mode.
config (dict): A config for a fulltext engine.
[More](https://github.com/Restream/reindexer/blob/master/fulltext.md).
Raw data
{
"_id": null,
"home_page": "https://github.com/Restream/reindexer-py",
"name": "pyreindexer",
"maintainer": "Reindexer Team",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "contactus@reindexer.io",
"keywords": "reindexer, in-memory-database, database, python, connector",
"author": "Igor Tulmentyev",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/31/cd/f95e81cab247514b98abb3b5998c43ef9f0495702458035bf7afd5e75da4/pyreindexer-0.3.2.tar.gz",
"platform": "ALT Linux",
"description": "# The PyReindexer module provides a connector and its auxiliary tools for interaction with Reindexer\n\n* [pyreindexer.rx\\_connector](#pyreindexer.rx_connector)\n * [RxConnector](#pyreindexer.rx_connector.RxConnector)\n * [close](#pyreindexer.rx_connector.RxConnector.close)\n * [namespace\\_open](#pyreindexer.rx_connector.RxConnector.namespace_open)\n * [namespace\\_close](#pyreindexer.rx_connector.RxConnector.namespace_close)\n * [namespace\\_drop](#pyreindexer.rx_connector.RxConnector.namespace_drop)\n * [namespaces\\_enum](#pyreindexer.rx_connector.RxConnector.namespaces_enum)\n * [index\\_add](#pyreindexer.rx_connector.RxConnector.index_add)\n * [index\\_update](#pyreindexer.rx_connector.RxConnector.index_update)\n * [index\\_drop](#pyreindexer.rx_connector.RxConnector.index_drop)\n * [item\\_insert](#pyreindexer.rx_connector.RxConnector.item_insert)\n * [item\\_update](#pyreindexer.rx_connector.RxConnector.item_update)\n * [item\\_upsert](#pyreindexer.rx_connector.RxConnector.item_upsert)\n * [item\\_delete](#pyreindexer.rx_connector.RxConnector.item_delete)\n * [meta\\_put](#pyreindexer.rx_connector.RxConnector.meta_put)\n * [meta\\_get](#pyreindexer.rx_connector.RxConnector.meta_get)\n * [meta\\_delete](#pyreindexer.rx_connector.RxConnector.meta_delete)\n * [meta\\_enum](#pyreindexer.rx_connector.RxConnector.meta_enum)\n * [select](#pyreindexer.rx_connector.RxConnector.select)\n * [new\\_transaction](#pyreindexer.rx_connector.RxConnector.new_transaction)\n * [new\\_query](#pyreindexer.rx_connector.RxConnector.new_query)\n* [pyreindexer.query\\_results](#pyreindexer.query_results)\n * [QueryResults](#pyreindexer.query_results.QueryResults)\n * [status](#pyreindexer.query_results.QueryResults.status)\n * [count](#pyreindexer.query_results.QueryResults.count)\n * [total\\_count](#pyreindexer.query_results.QueryResults.total_count)\n * [get\\_agg\\_results](#pyreindexer.query_results.QueryResults.get_agg_results)\n * [get\\_explain\\_results](#pyreindexer.query_results.QueryResults.get_explain_results)\n* [pyreindexer.transaction](#pyreindexer.transaction)\n * [Transaction](#pyreindexer.transaction.Transaction)\n * [insert](#pyreindexer.transaction.Transaction.insert)\n * [update](#pyreindexer.transaction.Transaction.update)\n * [upsert](#pyreindexer.transaction.Transaction.upsert)\n * [delete](#pyreindexer.transaction.Transaction.delete)\n * [commit](#pyreindexer.transaction.Transaction.commit)\n * [commit\\_with\\_count](#pyreindexer.transaction.Transaction.commit_with_count)\n * [rollback](#pyreindexer.transaction.Transaction.rollback)\n* [pyreindexer.point](#pyreindexer.point)\n * [Point](#pyreindexer.point.Point)\n* [pyreindexer.query](#pyreindexer.query)\n * [Query](#pyreindexer.query.Query)\n * [where](#pyreindexer.query.Query.where)\n * [where\\_query](#pyreindexer.query.Query.where_query)\n * [where\\_subquery](#pyreindexer.query.Query.where_subquery)\n * [where\\_composite](#pyreindexer.query.Query.where_composite)\n * [where\\_uuid](#pyreindexer.query.Query.where_uuid)\n * [where\\_between\\_fields](#pyreindexer.query.Query.where_between_fields)\n * [open\\_bracket](#pyreindexer.query.Query.open_bracket)\n * [close\\_bracket](#pyreindexer.query.Query.close_bracket)\n * [match](#pyreindexer.query.Query.match)\n * [dwithin](#pyreindexer.query.Query.dwithin)\n * [distinct](#pyreindexer.query.Query.distinct)\n * [aggregate\\_sum](#pyreindexer.query.Query.aggregate_sum)\n * [aggregate\\_avg](#pyreindexer.query.Query.aggregate_avg)\n * [aggregate\\_min](#pyreindexer.query.Query.aggregate_min)\n * [aggregate\\_max](#pyreindexer.query.Query.aggregate_max)\n * [aggregate\\_facet](#pyreindexer.query.Query.aggregate_facet)\n * [sort](#pyreindexer.query.Query.sort)\n * [sort\\_stpoint\\_distance](#pyreindexer.query.Query.sort_stpoint_distance)\n * [sort\\_stfield\\_distance](#pyreindexer.query.Query.sort_stfield_distance)\n * [op\\_and](#pyreindexer.query.Query.op_and)\n * [op\\_or](#pyreindexer.query.Query.op_or)\n * [op\\_not](#pyreindexer.query.Query.op_not)\n * [request\\_total](#pyreindexer.query.Query.request_total)\n * [cached\\_total](#pyreindexer.query.Query.cached_total)\n * [limit](#pyreindexer.query.Query.limit)\n * [offset](#pyreindexer.query.Query.offset)\n * [debug](#pyreindexer.query.Query.debug)\n * [strict](#pyreindexer.query.Query.strict)\n * [explain](#pyreindexer.query.Query.explain)\n * [with\\_rank](#pyreindexer.query.Query.with_rank)\n * [execute](#pyreindexer.query.Query.execute)\n * [delete](#pyreindexer.query.Query.delete)\n * [set\\_object](#pyreindexer.query.Query.set_object)\n * [set](#pyreindexer.query.Query.set)\n * [drop](#pyreindexer.query.Query.drop)\n * [expression](#pyreindexer.query.Query.expression)\n * [update](#pyreindexer.query.Query.update)\n * [must\\_execute](#pyreindexer.query.Query.must_execute)\n * [get](#pyreindexer.query.Query.get)\n * [inner\\_join](#pyreindexer.query.Query.inner_join)\n * [join](#pyreindexer.query.Query.join)\n * [left\\_join](#pyreindexer.query.Query.left_join)\n * [merge](#pyreindexer.query.Query.merge)\n * [on](#pyreindexer.query.Query.on)\n * [select](#pyreindexer.query.Query.select)\n * [functions](#pyreindexer.query.Query.functions)\n * [equal\\_position](#pyreindexer.query.Query.equal_position)\n* [pyreindexer.index\\_definition](#pyreindexer.index_definition)\n * [IndexDefinition](#pyreindexer.index_definition.IndexDefinition)\n\n<a id=\"pyreindexer.rx_connector\"></a>\n\n# pyreindexer.rx\\_connector\n\n<a id=\"pyreindexer.rx_connector.RxConnector\"></a>\n\n## RxConnector Objects\n\n```python\nclass RxConnector(RaiserMixin)\n```\n\nRxConnector provides a binding to Reindexer upon two shared libraries (hereinafter - APIs): 'rawpyreindexerb.so'\n and 'rawpyreindexerc.so'. The first one is aimed to a builtin way usage. That API embeds Reindexer, so it could\n be used right in-place as is. The second one acts as a lightweight client which establishes a connection to\n Reindexer server via RPC. The APIs interfaces are completely the same.\n\n#### Attributes:\n api (module): An API module loaded dynamically for Reindexer calls\n rx (int): A memory pointer to Reindexer instance\n err_code (int): The API error code\n err_msg (string): The API error message\n\n<a id=\"pyreindexer.rx_connector.RxConnector.close\"></a>\n\n### RxConnector.close\n\n```python\ndef close() -> None\n```\n\nCloses an API instance with Reindexer resources freeing\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n\n<a id=\"pyreindexer.rx_connector.RxConnector.namespace_open\"></a>\n\n### RxConnector.namespace\\_open\n\n```python\ndef namespace_open(namespace) -> None\n```\n\nOpens a namespace specified or creates a namespace if it does not exist\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.namespace_close\"></a>\n\n### RxConnector.namespace\\_close\n\n```python\ndef namespace_close(namespace) -> None\n```\n\nCloses a namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.namespace_drop\"></a>\n\n### RxConnector.namespace\\_drop\n\n```python\ndef namespace_drop(namespace) -> None\n```\n\nDrops a namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Raises:\n Exception: Raises with an error message when Reindexer instance is not initialized yet\n Exception: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.namespaces_enum\"></a>\n\n### RxConnector.namespaces\\_enum\n\n```python\ndef namespaces_enum(enum_not_opened=False) -> List[Dict[str, str]]\n```\n\nGets a list of namespaces available\n\n#### Arguments:\n enum_not_opened (bool, optional): An enumeration mode flag. If it is\n set then closed namespaces are in result list too. Defaults to False\n\n#### Returns:\n (:obj:`list` of :obj:`dict`): A list of dictionaries which describe each namespace\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.index_add\"></a>\n\n### RxConnector.index\\_add\n\n```python\ndef index_add(namespace, index_def) -> None\n```\n\nAdds an index to the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n index_def (dict): A dictionary of index definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.index_update\"></a>\n\n### RxConnector.index\\_update\n\n```python\ndef index_update(namespace, index_def) -> None\n```\n\nUpdates an index in the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n index_def (dict): A dictionary of index definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.index_drop\"></a>\n\n### RxConnector.index\\_drop\n\n```python\ndef index_drop(namespace, index_name) -> None\n```\n\nDrops an index from the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n index_name (string): A name of an index\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.item_insert\"></a>\n\n### RxConnector.item\\_insert\n\n```python\ndef item_insert(namespace, item_def, precepts=None) -> None\n```\n\nInserts an item with its precepts to the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.item_update\"></a>\n\n### RxConnector.item\\_update\n\n```python\ndef item_update(namespace, item_def, precepts=None) -> None\n```\n\nUpdates an item with its precepts in the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.item_upsert\"></a>\n\n### RxConnector.item\\_upsert\n\n```python\ndef item_upsert(namespace, item_def, precepts=None) -> None\n```\n\nUpdates an item with its precepts in the namespace specified. Creates the item if it not exists\n\n#### Arguments:\n namespace (string): A name of a namespace\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.item_delete\"></a>\n\n### RxConnector.item\\_delete\n\n```python\ndef item_delete(namespace, item_def) -> None\n```\n\nDeletes an item from the namespace specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n item_def (dict): A dictionary of item definition\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.meta_put\"></a>\n\n### RxConnector.meta\\_put\n\n```python\ndef meta_put(namespace, key, value) -> None\n```\n\nPuts metadata to a storage of Reindexer by key\n\n#### Arguments:\n namespace (string): A name of a namespace\n key (string): A key in a storage of Reindexer for metadata keeping\n value (string): A metadata for storage\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.meta_get\"></a>\n\n### RxConnector.meta\\_get\n\n```python\ndef meta_get(namespace, key) -> str\n```\n\nGets metadata from a storage of Reindexer by key specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n key (string): A key in a storage of Reindexer where metadata is kept\n\n#### Returns:\n string: A metadata value\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.meta_delete\"></a>\n\n### RxConnector.meta\\_delete\n\n```python\ndef meta_delete(namespace, key) -> None\n```\n\nDeletes metadata from a storage of Reindexer by key specified\n\n#### Arguments:\n namespace (string): A name of a namespace\n key (string): A key in a storage of Reindexer where metadata is kept\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.meta_enum\"></a>\n\n### RxConnector.meta\\_enum\n\n```python\ndef meta_enum(namespace) -> List[str]\n```\n\nGets a list of metadata keys from a storage of Reindexer\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Returns:\n (:obj:`list` of :obj:`str`): A list of all metadata keys\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.select\"></a>\n\n### RxConnector.select\n\n```python\ndef select(query: str) -> QueryResults\n```\n\nExecutes an SQL query and returns query results\n\n#### Arguments:\n query (string): An SQL query\n\n#### Returns:\n (:obj:`QueryResults`): A QueryResults iterator\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.new_transaction\"></a>\n\n### RxConnector.new\\_transaction\n\n```python\ndef new_transaction(namespace) -> Transaction\n```\n\nStarts a new transaction and return the transaction object to processing\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Returns:\n (:obj:`Transaction`): A new transaction\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.rx_connector.RxConnector.new_query\"></a>\n\n### RxConnector.new\\_query\n\n```python\ndef new_query(namespace: str) -> Query\n```\n\nCreates a new query and return the query object to processing\n\n#### Arguments:\n namespace (string): A name of a namespace\n\n#### Returns:\n (:obj:`Query`): A new query\n\n#### Raises:\n ConnectionError: Raises with an error message when Reindexer instance is not initialized yet\n\n<a id=\"pyreindexer.query_results\"></a>\n\n# pyreindexer.query\\_results\n\n<a id=\"pyreindexer.query_results.QueryResults\"></a>\n\n## QueryResults Objects\n\n```python\nclass QueryResults()\n```\n\nQueryResults is a disposable iterator of Reindexer results for such queries as SELECT etc.\n When the results are fetched the iterator closes and frees a memory of results buffer of Reindexer\n\n#### Attributes:\n api (module): An API module for Reindexer calls\n err_code (int): The API error code\n err_msg (string): The API error message\n qres_wrapper_ptr (int): A memory pointer to Reindexer iterator object\n qres_iter_count (int): A count of results for iterations\n pos (int): The current result position in iterator\n\n<a id=\"pyreindexer.query_results.QueryResults.status\"></a>\n\n### QueryResults.status\n\n```python\ndef status() -> None\n```\n\nCheck status\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query_results.QueryResults.count\"></a>\n\n### QueryResults.count\n\n```python\ndef count() -> int\n```\n\nReturns a count of results for iterations\n\n#### Returns\n int: A count of results\n\n<a id=\"pyreindexer.query_results.QueryResults.total_count\"></a>\n\n### QueryResults.total\\_count\n\n```python\ndef total_count() -> int\n```\n\nReturns a total or cached count of results\n\n#### Returns\n int: A total or cached count of results\n\n<a id=\"pyreindexer.query_results.QueryResults.get_agg_results\"></a>\n\n### QueryResults.get\\_agg\\_results\n\n```python\ndef get_agg_results() -> dict\n```\n\nReturns aggregation results for the current query\n\n#### Returns\n (:obj:`dict`): Dictionary with all results for the current query\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query_results.QueryResults.get_explain_results\"></a>\n\n### QueryResults.get\\_explain\\_results\n\n```python\ndef get_explain_results() -> str\n```\n\nReturns explain results for the current query\n\n#### Returns\n (string): Formatted string with explain of results for the current query\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction\"></a>\n\n# pyreindexer.transaction\n\n<a id=\"pyreindexer.transaction.Transaction\"></a>\n\n## Transaction Objects\n\n```python\nclass Transaction()\n```\n\nAn object representing the context of a Reindexer transaction\n\n#### Attributes:\n api (module): An API module for Reindexer calls\n transaction_wrapper_ptr (int): A memory pointer to Reindexer transaction object\n err_code (int): The API error code\n err_msg (string): The API error message\n\n<a id=\"pyreindexer.transaction.Transaction.insert\"></a>\n\n### Transaction.insert\n\n```python\ndef insert(item_def, precepts=None)\n```\n\nInserts an item with its precepts to the transaction\n\n#### Arguments:\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.update\"></a>\n\n### Transaction.update\n\n```python\ndef update(item_def, precepts=None)\n```\n\nUpdates an item with its precepts to the transaction\n\n#### Arguments:\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.upsert\"></a>\n\n### Transaction.upsert\n\n```python\ndef upsert(item_def, precepts=None)\n```\n\nUpdates an item with its precepts to the transaction. Creates the item if it not exists\n\n#### Arguments:\n item_def (dict): A dictionary of item definition\n precepts (:obj:`list` of :obj:`str`): A dictionary of index definition\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.delete\"></a>\n\n### Transaction.delete\n\n```python\ndef delete(item_def)\n```\n\nDeletes an item from the transaction\n\n#### Arguments:\n item_def (dict): A dictionary of item definition\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.commit\"></a>\n\n### Transaction.commit\n\n```python\ndef commit()\n```\n\nApplies changes\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.commit_with_count\"></a>\n\n### Transaction.commit\\_with\\_count\n\n```python\ndef commit_with_count() -> int\n```\n\nApplies changes and return the number of count of changed items\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.transaction.Transaction.rollback\"></a>\n\n### Transaction.rollback\n\n```python\ndef rollback()\n```\n\nRollbacks changes\n\n#### Raises:\n TransactionError: Raises with an error message of API return if Transaction is over\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.point\"></a>\n\n# pyreindexer.point\n\n<a id=\"pyreindexer.point.Point\"></a>\n\n## Point Objects\n\n```python\nclass Point()\n```\n\nAn object representing the context of a Reindexer 2D point\n\n#### Attributes:\n x (float): x coordinate of the point\n y (float): y coordinate of the point\n\n<a id=\"pyreindexer.query\"></a>\n\n# pyreindexer.query\n\n<a id=\"pyreindexer.query.Query\"></a>\n\n## Query Objects\n\n```python\nclass Query()\n```\n\nAn object representing the context of a Reindexer query\n\n#### Attributes:\n api (module): An API module for Reindexer calls\n query_wrapper_ptr (int): A memory pointer to Reindexer query object\n err_code (int): The API error code\n err_msg (string): The API error message\n root (:object: Optional[`Query`]): The root query of the Reindexer query\n join_queries (list[:object:`Query`]): The list of join Reindexer query objects\n merged_queries (list[:object:`Query`]): The list of merged Reindexer query objects\n\n<a id=\"pyreindexer.query.Query.where\"></a>\n\n### Query.where\n\n```python\ndef where(\n index: str,\n condition: CondType,\n keys: Union[simple_types, tuple[list[simple_types],\n ...]] = None) -> Query\n```\n\nAdds where condition to DB query with args\n\n#### Arguments:\n index (string): Field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n keys (union[simple_types, (list[simple_types], ...)]):\n Value of index to be compared with. For composite indexes keys must be list,\n with value of each sub-index\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.where_query\"></a>\n\n### Query.where\\_query\n\n```python\ndef where_query(\n sub_query: Query,\n condition: CondType,\n keys: Union[simple_types, tuple[list[simple_types],\n ...]] = None) -> Query\n```\n\nAdds sub-query where condition to DB query with args\n\n#### Arguments:\n sub_query (:obj:`Query`): Field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n keys (union[simple_types, (list[simple_types], ...)]):\n Value of index to be compared with. For composite indexes keys must be list,\n with value of each sub-index\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.where_subquery\"></a>\n\n### Query.where\\_subquery\n\n```python\ndef where_subquery(index: str, condition: CondType, sub_query: Query) -> Query\n```\n\nAdds sub-query where condition to DB query\n\n#### Arguments:\n index (string): Field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n sub_query (:obj:`Query`): Field name used in condition clause\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.where_composite\"></a>\n\n### Query.where\\_composite\n\n```python\ndef where_composite(index: str, condition: CondType,\n keys: tuple[list[simple_types], ...]) -> Query\n```\n\nAdds where condition to DB query with interface args for composite indexes\n\n#### Arguments:\n index (string): Field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n keys (list[simple_types], ...): Values of composite index to be compared with (value of each sub-index).\n Supported variants:\n ([1, \"test1\"], [2, \"test2\"])\n [[1, \"test1\"], [2, \"test2\"]])\n ([1, \"testval1\"], )\n [[1, \"testval1\"]]\n (1, \"testval1\")\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.where_uuid\"></a>\n\n### Query.where\\_uuid\n\n```python\ndef where_uuid(index: str, condition: CondType, *uuids: UUID) -> Query\n```\n\nAdds where condition to DB query with UUID as string args.\n This function applies binary encoding to the UUID value.\n `index` MUST be declared as uuid index in this case\n\n#### Arguments:\n index (string): Field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n uuids (*:obj:`UUID`): Value of index to be compared with. For composite indexes uuids must be list,\n with value of each sub-index\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.where_between_fields\"></a>\n\n### Query.where\\_between\\_fields\n\n```python\ndef where_between_fields(first_field: str, condition: CondType,\n second_field: str) -> Query\n```\n\nAdds comparing two fields where condition to DB query\n\n#### Arguments:\n first_field (string): First field name used in condition clause\n condition (:enum:`CondType`): Type of condition\n second_field (string): Second field name used in condition clause\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.open_bracket\"></a>\n\n### Query.open\\_bracket\n\n```python\ndef open_bracket() -> Query\n```\n\nOpens bracket for where condition to DB query\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.close_bracket\"></a>\n\n### Query.close\\_bracket\n\n```python\ndef close_bracket() -> Query\n```\n\nCloses bracket for where condition to DB query\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.match\"></a>\n\n### Query.match\n\n```python\ndef match(index: str, *keys: str) -> Query\n```\n\nAdds string EQ-condition to DB query with string args\n\n#### Arguments:\n index (string): Field name used in condition clause\n keys (*string): Value of index to be compared with. For composite indexes keys must be list,\n with value of each sub-index\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.dwithin\"></a>\n\n### Query.dwithin\n\n```python\ndef dwithin(index: str, point: Point, distance: float) -> Query\n```\n\nAdds DWithin condition to DB query\n\n#### Arguments:\n index (string): Field name used in condition clause\n point (:obj:`Point`): Point object used in condition clause\n distance (float): Distance in meters between point\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.distinct\"></a>\n\n### Query.distinct\n\n```python\ndef distinct(index: str) -> Query\n```\n\nPerforms distinct for a certain index. Return only items with uniq value of field\n\n#### Arguments:\n index (string): Field name for distinct operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.aggregate_sum\"></a>\n\n### Query.aggregate\\_sum\n\n```python\ndef aggregate_sum(index: str) -> Query\n```\n\nPerforms a summation of values for a specified index\n\n#### Arguments:\n index (string): Field name for sum operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.aggregate_avg\"></a>\n\n### Query.aggregate\\_avg\n\n```python\ndef aggregate_avg(index: str) -> Query\n```\n\nFinds for the average at the specified index\n\n#### Arguments:\n index (string): Field name for sum operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.aggregate_min\"></a>\n\n### Query.aggregate\\_min\n\n```python\ndef aggregate_min(index: str) -> Query\n```\n\nFinds for the minimum at the specified index\n\n#### Arguments:\n index (string): Field name for sum operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.aggregate_max\"></a>\n\n### Query.aggregate\\_max\n\n```python\ndef aggregate_max(index: str) -> Query\n```\n\nFinds for the maximum at the specified index\n\n#### Arguments:\n index (string): Field name for sum operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.aggregate_facet\"></a>\n\n### Query.aggregate\\_facet\n\n```python\ndef aggregate_facet(*fields: str) -> Query._AggregateFacet\n```\n\nGets fields facet value. Applicable to multiple data fields and the result of that could be sorted\n by any data column or `count` and cut off by offset and limit. In order to support this functionality\n this method returns AggregationFacetRequest which has methods sort, limit and offset\n\n#### Arguments:\n fields (*string): Fields any data column name or `count`, fields should not be empty\n\n#### Returns:\n (:obj:`_AggregateFacet`): Request object for further customizations\n\n<a id=\"pyreindexer.query.Query.sort\"></a>\n\n### Query.sort\n\n```python\ndef sort(\n index: str,\n desc: bool = False,\n forced_sort_values: Union[simple_types, tuple[list[simple_types],\n ...]] = None\n) -> Query\n```\n\nApplies sort order to return from query items. If forced_sort_values argument specified, then items equal to\n values, if found will be placed in the top positions. Forced sort is support for the first sorting field\n only\n\n#### Arguments:\n index (string): The index name\n desc (bool): Sort in descending order\n forced_sort_values (union[simple_types, (list[simple_types], ...)]):\n Value of index to match. For composite indexes keys must be list, with value of each sub-index\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.sort_stpoint_distance\"></a>\n\n### Query.sort\\_stpoint\\_distance\n\n```python\ndef sort_stpoint_distance(index: str, point: Point, desc: bool) -> Query\n```\n\nApplies geometry sort order to return from query items. Wrapper for geometry sorting by shortest distance\n between geometry field and point (ST_Distance)\n\n#### Arguments:\n index (string): The index name\n point (:obj:`Point`): Point object used in sorting operation\n desc (bool): Sort in descending order\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.sort_stfield_distance\"></a>\n\n### Query.sort\\_stfield\\_distance\n\n```python\ndef sort_stfield_distance(first_field: str, second_field: str,\n desc: bool) -> Query\n```\n\nApplies geometry sort order to return from query items. Wrapper for geometry sorting by shortest distance\n between 2 geometry fields (ST_Distance)\n\n#### Arguments:\n first_field (string): First field name used in condition\n second_field (string): Second field name used in condition\n desc (bool): Sort in descending order\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.op_and\"></a>\n\n### Query.op\\_and\n\n```python\ndef op_and() -> Query\n```\n\nNext condition will be added with AND.\n This is the default operation for WHERE statement. Do not have to be called explicitly in user's code.\n Used in DSL conversion\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.op_or\"></a>\n\n### Query.op\\_or\n\n```python\ndef op_or() -> Query\n```\n\nNext condition will be added with OR.\n Implements short-circuiting:\n if the previous condition is successful the next will not be evaluated, but except Join conditions\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.op_not\"></a>\n\n### Query.op\\_not\n\n```python\ndef op_not() -> Query\n```\n\nNext condition will be added with NOT AND.\n Implements short-circuiting: if the previous condition is failed the next will not be evaluated\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.request_total\"></a>\n\n### Query.request\\_total\n\n```python\ndef request_total() -> Query\n```\n\nRequests total items calculation\n\n#### Arguments:\n total_name (string, optional): Name to be requested\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.cached_total\"></a>\n\n### Query.cached\\_total\n\n```python\ndef cached_total() -> Query\n```\n\nRequests cached total items calculation\n\n#### Arguments:\n total_name (string, optional): Name to be requested\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.limit\"></a>\n\n### Query.limit\n\n```python\ndef limit(limit_items: int) -> Query\n```\n\nSets a limit (count) of returned items. Analog to sql LIMIT rowsNumber\n\n#### Arguments:\n limit_items (int): Number of rows to get from result set\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.offset\"></a>\n\n### Query.offset\n\n```python\ndef offset(start_offset: int) -> Query\n```\n\nSets the number of the first selected row from result query\n\n#### Arguments:\n limit_items (int): Index of the first row to get from result set\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.debug\"></a>\n\n### Query.debug\n\n```python\ndef debug(level: LogLevel) -> Query\n```\n\nChanges debug log level on server\n\n#### Arguments:\n level (:enum:`LogLevel`): Debug log level on server\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.strict\"></a>\n\n### Query.strict\n\n```python\ndef strict(mode: StrictMode) -> Query\n```\n\nChanges strict mode\n\n#### Arguments:\n mode (:enum:`StrictMode`): Strict mode\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.explain\"></a>\n\n### Query.explain\n\n```python\ndef explain() -> Query\n```\n\nEnables explain query\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.with_rank\"></a>\n\n### Query.with\\_rank\n\n```python\ndef with_rank() -> Query\n```\n\nOutputs fulltext rank. Allowed only with fulltext query\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.execute\"></a>\n\n### Query.execute\n\n```python\ndef execute() -> QueryResults\n```\n\nExecutes a select query\n\n#### Returns:\n (:obj:`QueryResults`): A QueryResults iterator\n\n#### Raises:\n ApiError: Raises with an error message when query is in an invalid state\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.delete\"></a>\n\n### Query.delete\n\n```python\ndef delete() -> int\n```\n\nExecutes a query, and delete items, matches query\n\n#### Returns:\n (int): Number of deleted elements\n\n#### Raises:\n QueryError: Raises with an error message when query is in an invalid state\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.set_object\"></a>\n\n### Query.set\\_object\n\n```python\ndef set_object(field: str, values: list[simple_types]) -> Query\n```\n\nAdds an update query to an object field for an update query\n\n#### Arguments:\n field (string): Field name\n values (list[simple_types]): List of values to add\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n QueryError: Raises with an error message if no values are specified\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.set\"></a>\n\n### Query.set\n\n```python\ndef set(field: str, values: list[simple_types]) -> Query\n```\n\nAdds a field update request to the update request\n\n#### Arguments:\n field (string): Field name\n values (list[simple_types]): List of values to add\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.drop\"></a>\n\n### Query.drop\n\n```python\ndef drop(index: str) -> Query\n```\n\nDrops a value for a field\n\n#### Arguments:\n index (string): Field name for drop operation\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.expression\"></a>\n\n### Query.expression\n\n```python\ndef expression(field: str, value: str) -> Query\n```\n\nUpdates indexed field by arithmetical expression\n\n#### Arguments:\n field (string): Field name\n value (string): New value expression for field\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.update\"></a>\n\n### Query.update\n\n```python\ndef update() -> QueryResults\n```\n\nExecutes update query, and update fields in items, which matches query\n\n#### Returns:\n (:obj:`QueryResults`): A QueryResults iterator\n\n#### Raises:\n QueryError: Raises with an error message when query is in an invalid state\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.must_execute\"></a>\n\n### Query.must\\_execute\n\n```python\ndef must_execute() -> QueryResults\n```\n\nExecutes a query, and update fields in items, which matches query, with status check\n\n#### Returns:\n (:obj:`QueryResults`): A QueryResults iterator\n\n#### Raises:\n ApiError: Raises with an error message when query is in an invalid state\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.get\"></a>\n\n### Query.get\n\n```python\ndef get() -> (str, bool)\n```\n\nExecutes a query, and return 1 JSON item\n\n#### Returns:\n (:tuple:string,bool): 1st string item and found flag\n\n#### Raises:\n ApiError: Raises with an error message when query is in an invalid state\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.inner_join\"></a>\n\n### Query.inner\\_join\n\n```python\ndef inner_join(query: Query, field: str) -> Query\n```\n\nJoins 2 queries.\n Items from the 1-st query are filtered by and expanded with the data from the 2-nd query\n\n#### Arguments:\n query (:obj:`Query`): Query object to left join\n field (string): Joined field name. As unique identifier for the join between this query and `join_query`.\n Parameter in order for InnerJoin to work: namespace of `query` contains `field` as one of its fields\n marked as `joined`\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.join\"></a>\n\n### Query.join\n\n```python\ndef join(query: Query, field: str) -> Query\n```\n\nJoin is an alias for LeftJoin. Joins 2 queries.\n Items from this query are expanded with the data from the `query`\n\n#### Arguments:\n query (:obj:`Query`): Query object to left join\n field (string): Joined field name. As unique identifier for the join between this query and `join_query`\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.left_join\"></a>\n\n### Query.left\\_join\n\n```python\ndef left_join(join_query: Query, field: str) -> Query\n```\n\nJoins 2 queries.\n Items from this query are expanded with the data from the join_query.\n One of the conditions below must hold for `field` parameter in order for LeftJoin to work:\n namespace of `join_query` contains `field` as one of its fields marked as `joined`\n\n#### Arguments:\n query (:obj:`Query`): Query object to left join\n field (string): Joined field name. As unique identifier for the join between this query and `join_query`\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.merge\"></a>\n\n### Query.merge\n\n```python\ndef merge(query: Query) -> Query\n```\n\nMerges queries of the same type\n\n#### Arguments:\n query (:obj:`Query`): Query object to merge\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n<a id=\"pyreindexer.query.Query.on\"></a>\n\n### Query.on\n\n```python\ndef on(index: str, condition: CondType, join_index: str) -> Query\n```\n\nOn specifies join condition\n\n#### Arguments:\n index (string): Field name from `Query` namespace should be used during join\n condition (:enum:`CondType`): Type of condition, specifies how `Query` will be joined with the latest join query issued on `Query` (e.g. `EQ`/`GT`/`SET`/...)\n join_index (string): Index-field name from namespace for the latest join query issued on `Query` should be used during join\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n QueryError: Raises with an error message when query is in an invalid state\n\n<a id=\"pyreindexer.query.Query.select\"></a>\n\n### Query.select\n\n```python\ndef select(*fields: str) -> Query\n```\n\nSets list of columns in this namespace to be finally selected.\n The columns should be specified in the same case as the jsonpaths corresponding to them.\n Non-existent fields and fields in the wrong case are ignored.\n If there are no fields in this list that meet these conditions, then the filter works as \"*\"\n\n#### Arguments:\n fields (*string): List of columns to be selected\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.functions\"></a>\n\n### Query.functions\n\n```python\ndef functions(*functions: str) -> Query\n```\n\nAdds sql-functions to query\n\n#### Arguments:\n functions (*string): Functions declaration\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.query.Query.equal_position\"></a>\n\n### Query.equal\\_position\n\n```python\ndef equal_position(*equal_position: str) -> Query\n```\n\nAdds equal position fields to arrays queries\n\n#### Arguments:\n equal_poses (*string): Equal position fields to arrays queries\n\n#### Returns:\n (:obj:`Query`): Query object for further customizations\n\n#### Raises:\n ApiError: Raises with an error message of API return on non-zero error code\n\n<a id=\"pyreindexer.index_definition\"></a>\n\n# pyreindexer.index\\_definition\n\n<a id=\"pyreindexer.index_definition.IndexDefinition\"></a>\n\n## IndexDefinition Objects\n\n```python\nclass IndexDefinition(dict)\n```\n\nIndexDefinition is a dictionary subclass which allows to construct and manage indexes more efficiently.\nNOT IMPLEMENTED YET. USE FIELDS DESCRIPTION ONLY.\n\n#### Arguments:\n name (str): An index name.\n json_paths (:obj:`list` of :obj:`str`): A name for mapping a value to a json field.\n field_type (str): A type of field. Possible values are: `int`, `int64`, `double`, `string`, `bool`, `composite`.\n index_type (str): An index type. Possible values are: `hash`, `tree`, `text`, `-`.\n is_pk (bool): True if a field is a primary key.\n is_array (bool): True if an index is an array.\n is_dense (bool): True if an index is dense. reduce index size. Saves 8 bytes per unique key value for 'hash'\n and 'tree' index types.\n For '-' index type saves 4-8 bytes per each element. Useful for indexes with high selectivity,\n but for tree and hash indexes with low selectivity could\n significantly decrease update performance.\n is_sparse (bool): True if a value of an index may be not presented.\n collate_mode (str): Sets an order of values by collate mode. Possible values are:\n `none`, `ascii`, `utf8`, `numeric`, `custom`.\n sort_order_letters (str): Order for a sort sequence for a custom collate mode.\n config (dict): A config for a fulltext engine.\n [More](https://github.com/Restream/reindexer/blob/master/fulltext.md).\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "A connector that allows to interact with Reindexer",
"version": "0.3.2",
"project_urls": {
"Documentation": "https://reindexer.io/",
"Homepage": "https://github.com/Restream/reindexer-py",
"Releases": "https://github.com/Restream/reindexer-py/releases",
"Telegram chat": "https://t.me/reindexer",
"Tracker": "https://github.com/Restream/reindexer-py/issues"
},
"split_keywords": [
"reindexer",
" in-memory-database",
" database",
" python",
" connector"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31cdf95e81cab247514b98abb3b5998c43ef9f0495702458035bf7afd5e75da4",
"md5": "ef28ccba97deadcff69c02bbe56b842f",
"sha256": "684d4586b225e8705798d10c7d7dd3317eecd208e50017f5fe880c43b2aa732d"
},
"downloads": -1,
"filename": "pyreindexer-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "ef28ccba97deadcff69c02bbe56b842f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 67952,
"upload_time": "2024-12-16T14:41:32",
"upload_time_iso_8601": "2024-12-16T14:41:32.626998Z",
"url": "https://files.pythonhosted.org/packages/31/cd/f95e81cab247514b98abb3b5998c43ef9f0495702458035bf7afd5e75da4/pyreindexer-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 14:41:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Restream",
"github_project": "reindexer-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "delegator",
"specs": [
[
"==",
"0.0.3"
]
]
},
{
"name": "envoy",
"specs": [
[
"==",
"0.0.3"
]
]
},
{
"name": "PyHamcrest",
"specs": [
[
"==",
"2.0.2"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"6.2.5"
]
]
}
],
"lcname": "pyreindexer"
}