
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
easierai-elasticsearchlib
Advanced tools
This library manages the communication between python programs and elasticsearch database
This library allows access to a Elasticsearch from a Python program.
https://pypi.org/project/elasticsearchlib/
This library can be installed with the following command:
pip3 install elasticsearchlib
You can add these lines in your Dockerfile to include this library in your image:
RUN pip3 install elasticsearchlib
These steps are needed to distribute the library on Pip repository manager:
First, these packages must be installed on your Python environment:
sudo python -m pip install --upgrade pip setuptools wheel
sudo python -m pip install tqdm
sudo python -m pip install --user --upgrade twine
On the setup.py file, these fields can be customized:
python3 setup.py bdist_wheel
This command will generate a .whl file inside the dist folder of the root of the project. Then, execute the following command to upload this file to PyPi repository:
python3 -m twine upload dist/*
This section will explain the usage of this library.
Elasticsearchlib()
This function creates the connection to the elasticsearch database, checking if the server is up. Returns True if the database answered correctly.
def start_connection(self, host, port, request_retries=3, total_retries=9):
This function checks if an index is already created and, if not, creates it, according to the provided mapping.
def create_index(self, index, mapping=None):
This function adds a document to the provided index. If the index does not exist, it will be created first.
def add_to_index(self, index, body, id=''):
This functions allows for the retrieval of the last n measures of one dataset item.
def search_last_n_measures(self, index, id_dataset, n):
This function returns all measures stored in an index, following a query.
def scrolled_query(self, query, index, filter_path=None):
This function returns all the entity ids stored under an index.
def get_entities_ids(self, index):
This function returns the last document stored under an index, for a specific device_id.
def get_last_document(self, index, device_id):
This function returns the data history for a specific device in a period of time.
def get_data_history(self, index, device_id, gte, lte='now'):
FAQs
This library manages the communication between python programs and elasticsearch database
We found that easierai-elasticsearchlib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.