Quickstart guide

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

Prerequisites quickstart

  • Supported Python version [3.9 3.10, 3.11, 3.12].

  • 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 helpers

from volue.mesh import Connection


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
    session = connection.create_session()
    session.open()
    print("You have now an open session and can request time series")

    # Close the remote session
    session.close()


if __name__ == "__main__":
    address, tls_root_pem_cert = helpers.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.