Quickstart guide

Here is a quick start guide to setup your first project using the library.

Prerequisites quickstart

  • Supported Python version [3.10, 3.11, 3.12, 3.13, 3.14].

  • Running Volue Mesh server with gRPC enabled (either locally or on a different machine within your network).

Installation quickstart

Using pip:

python -m pip install git+https://github.com/Volue-Public/energy-mesh-python

Recommended way is to use pip with a virtual environment. For more information refer to Installation.

First call to Mesh server

Lets connect to the server, get its version and create a session for getting data.

import sys

from volue.mesh import Connection


def get_connection_info():
    """Helper function to set hand over connection info to examples."""
    address = "localhost:50051"
    tls_root_pem_cert = ""

    if len(sys.argv) > 1:
        address = sys.argv[1]
    if len(sys.argv) > 2:
        root_certificate_path = sys.argv[2]
        if root_certificate_path:
            with open(root_certificate_path, "rb") as file:
                # In case multiple root certificates are needed, e.g.:
                # the same client accesses different Mesh servers (with different root certs)
                # Just combine into single file the root certificates, like:
                # -----BEGIN CERTIFICATE-----
                # ...(first certificate)...
                # -----END CERTIFICATE-----
                # -----BEGIN CERTIFICATE-----
                # ..(second certificate)..
                # -----END CERTIFICATE-----
                tls_root_pem_cert = file.read()

    return address, tls_root_pem_cert


def main(address, tls_root_pem_cert):
    """Showing the quickest way to get started."""

    # For production environments create connection using: with_tls, with_kerberos, or with_external_access_token, e.g.:
    # connection = Connection.with_tls(address, tls_root_pem_cert)
    connection = Connection.insecure(address)

    # Which version is the server running
    version_info = connection.get_version()
    print(f"Connected to {version_info.name} {version_info.version}")

    # Create a remote session on the Volue Mesh server
    with connection.create_session() as session:
        print("You have now an open session and can request time series")
        # Do some work with the session, e.g. read time series points, write time series points, etc.
        # The session will be automatically closed when the block is exited.


if __name__ == "__main__":
    address, tls_root_pem_cert = get_connection_info()
    main(address, tls_root_pem_cert)

Name this file quickstart.py.

Warning

It assumes Volue Mesh server is running locally with gRPC enabled on default port 50051 and TLS is disabled for gRPC. If you are using a remote server or a non-default port for gRPC communication please change the address and port variables. In case of problems or questions regarding Mesh server configuration please contact Volue consultant.

Now that you made your first script to contact the Volue Mesh server, we have to run the script.:

$ python quickstart.py

If everything is set up right you should be getting output like the following:

Connected to Volue Mesh Server 99.0.0+0
You have now an open session and can request timeseries

If there are some problems with this code check out Frequently Asked Questions.

Next steps

For more examples refer to Examples.