TSG Client is a Python library for interacting with the TNO Security Gateway (TSG). It is current version, it is a simple REST API client that interacts with TSG Core Connector APIs and TSG OpenAPI Data APP. It provides a simple and easy-to-use interface for tasks such as:
- Connecting to a TSG core container (via API KEY)
- Retrieving connector self-descriptions
- Parsing / filtering connector catalogs and artifacts, retrieved from self-descriptions
- Requesting and consuming data artifacts (via dataspace)
- Queries to the dataspace Metadata Broker to list registered connectors and respective self-descriptions
- Perform requests via OpenAPI Data APP
This document provides detailed instructions for setting up the INESC TEC Client for TNO Security Gateway (TSG-Client) environment. Please follow these steps carefully to ensure successful configuration and deployment.
NOTE: This library assumes that you have a running instance of the TSG Core Connector and OpenAPI Data APP. For this, please follow the Official TSG Documentation.
WARNING: This library is under active development and is not yet recommended for production use at this time.
IMPORTANT: This development is an internal initiative from INESC TEC within ENERSHARE, and it is not officially maintained/supported by TNO team.
A detailed documentation is available here. Python example scripts (and respective description) are also available in the examples directory of the repository.
Although the tsg-client
is not yet published on public Python repositories of software (e.g., PyPI), you can install it (as a package) by directly referencing this repository URL.
You can use the command below to install it directly using pip.
pip install git+https://github.com/CPES-Power-and-Energy-Systems/tsg-client.git
Do not forget that you will need to set up some environment variables to use this library. You can find a more detailed documentation here.
If you want to modify the source code of this library, it is recommended to clone and then use Poetry to create a virtual environment to install the library dependencies and do any modifications needed.
To do this, please follow the steps below:
- Clone the repository.
git clone https://github.com/CPES-Power-and-Energy-Systems/tsg-client.git
- Assuming you have Poetry installed, run the following command to install the required dependencies:
poetry install
- Activate the virtual environment*:
poetry shell
Now you are ready to use the TSG-Client.
*It's possible to use poetry without virtual environments (although recommended). For more info see Poetry documentation.
To add a new dependency to the project, use the following command:
$ poetry add <package-name>
Poetry will automatically update the pyproject.toml
file and install the new package.
To get started, check out the examples in the examples directory. These examples demonstrate how to instanciate the TSGController
and use the multiple functionalities of TSG Client.
If you have any questions regarding this project, please contact the following people:
Developers (SW source code / methodology questions):
- Carolina Catorze: carolina.catorze@inesctec.pt
- Vasco Guedes: vasco.r.maia@inesctec.pt
- José Luís Rodrigues: jose.l.rodrigues@inesctec.pt
- José Ricardo Andrade: jose.r.andrade@inesctec.pt