Skip to content

1st December 2022

Coding

Languages

Libraries

  • New: Introduce python gnupg.

    python-gnupg is a Python library to interact with gpg taking care of the internal details and allows its users to generate and manage keys, encrypt and decrypt data, and sign and verify messages.

    Installation:

    pip install python-gnupg
    

    Usage:

    ```python gpg = gnupg.GPG(gnupghome="/path/to/home/directory")

    gpg.decrypt("path/to/file")

    public_keys = gpg.list_keys() private_keys = gpg.list_keys(True)

Python Snippets

Elasticsearch

  • New: Introduce python elasticsearch library.

    Python elasticsearch is the Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable.

    Installation:

    pip install elasticsearch
    

    Usage:

    ```python from elasticsearch import Elasticsearch

    client = Elasticsearch("http://localhost:9200")

    +client.indices.get(index="*")

    resp = client.search(index="test-index", query={"match_all": {}}) documents = resp.body["hits"]["hits"]

    doc = {"partial_document": "value"} resp = client.update(index=INDEX, id=id_, doc=doc) ```