From 24967003f9d9ae082912d88240f541d2b78be0ad Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 10 May 2023 04:00:16 +0000 Subject: automatic import of python-gnista-library --- .gitignore | 1 + python-gnista-library.spec | 468 +++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 470 insertions(+) create mode 100644 python-gnista-library.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..6651cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/gnista-library-2.0.2.tar.gz diff --git a/python-gnista-library.spec b/python-gnista-library.spec new file mode 100644 index 0000000..caf2d44 --- /dev/null +++ b/python-gnista-library.spec @@ -0,0 +1,468 @@ +%global _empty_manifest_terminate_build 0 +Name: python-gnista-library +Version: 2.0.2 +Release: 1 +Summary: A client library for accessing gnista.io +License: MIT +URL: https://gnista.io +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3b/08/4d51fd69aae5aa3461c1406049540a5a3e3fea13e4bc611e9c91f364ace8/gnista-library-2.0.2.tar.gz +BuildArch: noarch + +Requires: python3-httpx +Requires: python3-attrs +Requires: python3-dateutil +Requires: python3-pandas +Requires: python3-oauth2-client +Requires: python3-PyJWT +Requires: python3-structlog +Requires: python3-colorama +Requires: python3-keyring + +%description +[![Gitlab Pipeline](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/badges/main/pipeline.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/-/pipelines) [![Python Version](https://img.shields.io/pypi/pyversions/gnista-library)](https://pypi.org/project/gnista-library/) [![PyPI version](https://img.shields.io/pypi/v/gnista-library)](https://pypi.org/project/gnista-library/) [![License](https://img.shields.io/pypi/l/gnista-library)](https://pypi.org/project/gnista-library/) [![Downloads](https://img.shields.io/pypi/dm/gnista-library)](https://pypi.org/project/gnista-library/) + +# gnista-library +A client library for accessing gnista.io + +## Tutorial +### Create new Poetry Project +Navigate to a folder where you want to create your project and type +```shell +poetry new my-gnista-client +cd my-gnista-client +``` + +### Add reference to your Project +Navigate to the newly created project and add the PyPI package +```shell +poetry add gnista-library +``` + +### Your first DataPoint +Create a new file you want to use to receive data this demo.py + +```python +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() + +print(data_point_data) +``` + +You need to replace the `DataPointId` with an ID from your gnista.io workspace. + +For example the DataPointId of this DataPoint `https://aws.gnista.io/secured/dashboard/datapoint/4684d681-8728-4f59-aeb0-ac3f3c573303` is `4684d681-8728-4f59-aeb0-ac3f3c573303` + +### Run and Login +Run your file in poetry's virtual environment +```console +$ poetry run python demo.py +2021-09-02 14:51.58 [info ] Authentication has been started. Please follow the link to authenticate with your user: [gnista_library.gnista_connetion] url=https://aws.gnista.io/authentication/connect/authorize?client_id=python&redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Fhome&response_type=code&scope=data-api%20openid%20profile%20offline_access&state=myState +``` +In order to login copy the `url` into your Browser and Login to gnista.io or, if allowed a browser window will open by itself. + +### Keystore +Once you loggedin, the library will try to store your access token in your private keystore. Next time you run your programm, it might request a password to access your keystore again to gain access to gnista.io +Please take a look at [Keyring](https://pypi.org/project/keyring/) for details. + +## Advanced Example +### Show received Data in a plot +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() +log.info("Data has been received. Plotting") +data_point_data.plot() +plt.show() + +``` + +### Filter by DataPoint Names +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +dataPoints = GnistaDataPoints(connection=connection) +data_point_list = list(dataPoints.get_data_point_list()) + +for data_point in data_point_list: + log.info(data_point) + +# Find Specific Data Points +filtered_data_points = filter( + lambda data_point: data_point.name.startswith("371880214002"), data_point_list +) +for data_point in filtered_data_points: + # get the data + data_point_data = data_point.get_data_point_data() + log.info(data_point_data) + data_point_data.plot() + plt.show() + +``` + + + +## Links +**Website** +[![gnista.io](https://www.gnista.io/assets/images/gnista-logo-small.svg)](gnista.io) + +**PyPi** +[![PyPi](https://pypi.org/static/images/logo-small.95de8436.svg)](https://pypi.org/project/gnista-library/) + +**GIT Repository** +[![Gitlab](https://about.gitlab.com/images/icons/logos/slp-logo.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library) + +%package -n python3-gnista-library +Summary: A client library for accessing gnista.io +Provides: python-gnista-library +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-gnista-library +[![Gitlab Pipeline](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/badges/main/pipeline.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/-/pipelines) [![Python Version](https://img.shields.io/pypi/pyversions/gnista-library)](https://pypi.org/project/gnista-library/) [![PyPI version](https://img.shields.io/pypi/v/gnista-library)](https://pypi.org/project/gnista-library/) [![License](https://img.shields.io/pypi/l/gnista-library)](https://pypi.org/project/gnista-library/) [![Downloads](https://img.shields.io/pypi/dm/gnista-library)](https://pypi.org/project/gnista-library/) + +# gnista-library +A client library for accessing gnista.io + +## Tutorial +### Create new Poetry Project +Navigate to a folder where you want to create your project and type +```shell +poetry new my-gnista-client +cd my-gnista-client +``` + +### Add reference to your Project +Navigate to the newly created project and add the PyPI package +```shell +poetry add gnista-library +``` + +### Your first DataPoint +Create a new file you want to use to receive data this demo.py + +```python +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() + +print(data_point_data) +``` + +You need to replace the `DataPointId` with an ID from your gnista.io workspace. + +For example the DataPointId of this DataPoint `https://aws.gnista.io/secured/dashboard/datapoint/4684d681-8728-4f59-aeb0-ac3f3c573303` is `4684d681-8728-4f59-aeb0-ac3f3c573303` + +### Run and Login +Run your file in poetry's virtual environment +```console +$ poetry run python demo.py +2021-09-02 14:51.58 [info ] Authentication has been started. Please follow the link to authenticate with your user: [gnista_library.gnista_connetion] url=https://aws.gnista.io/authentication/connect/authorize?client_id=python&redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Fhome&response_type=code&scope=data-api%20openid%20profile%20offline_access&state=myState +``` +In order to login copy the `url` into your Browser and Login to gnista.io or, if allowed a browser window will open by itself. + +### Keystore +Once you loggedin, the library will try to store your access token in your private keystore. Next time you run your programm, it might request a password to access your keystore again to gain access to gnista.io +Please take a look at [Keyring](https://pypi.org/project/keyring/) for details. + +## Advanced Example +### Show received Data in a plot +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() +log.info("Data has been received. Plotting") +data_point_data.plot() +plt.show() + +``` + +### Filter by DataPoint Names +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +dataPoints = GnistaDataPoints(connection=connection) +data_point_list = list(dataPoints.get_data_point_list()) + +for data_point in data_point_list: + log.info(data_point) + +# Find Specific Data Points +filtered_data_points = filter( + lambda data_point: data_point.name.startswith("371880214002"), data_point_list +) +for data_point in filtered_data_points: + # get the data + data_point_data = data_point.get_data_point_data() + log.info(data_point_data) + data_point_data.plot() + plt.show() + +``` + + + +## Links +**Website** +[![gnista.io](https://www.gnista.io/assets/images/gnista-logo-small.svg)](gnista.io) + +**PyPi** +[![PyPi](https://pypi.org/static/images/logo-small.95de8436.svg)](https://pypi.org/project/gnista-library/) + +**GIT Repository** +[![Gitlab](https://about.gitlab.com/images/icons/logos/slp-logo.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library) + +%package help +Summary: Development documents and examples for gnista-library +Provides: python3-gnista-library-doc +%description help +[![Gitlab Pipeline](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/badges/main/pipeline.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library/-/pipelines) [![Python Version](https://img.shields.io/pypi/pyversions/gnista-library)](https://pypi.org/project/gnista-library/) [![PyPI version](https://img.shields.io/pypi/v/gnista-library)](https://pypi.org/project/gnista-library/) [![License](https://img.shields.io/pypi/l/gnista-library)](https://pypi.org/project/gnista-library/) [![Downloads](https://img.shields.io/pypi/dm/gnista-library)](https://pypi.org/project/gnista-library/) + +# gnista-library +A client library for accessing gnista.io + +## Tutorial +### Create new Poetry Project +Navigate to a folder where you want to create your project and type +```shell +poetry new my-gnista-client +cd my-gnista-client +``` + +### Add reference to your Project +Navigate to the newly created project and add the PyPI package +```shell +poetry add gnista-library +``` + +### Your first DataPoint +Create a new file you want to use to receive data this demo.py + +```python +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() + +print(data_point_data) +``` + +You need to replace the `DataPointId` with an ID from your gnista.io workspace. + +For example the DataPointId of this DataPoint `https://aws.gnista.io/secured/dashboard/datapoint/4684d681-8728-4f59-aeb0-ac3f3c573303` is `4684d681-8728-4f59-aeb0-ac3f3c573303` + +### Run and Login +Run your file in poetry's virtual environment +```console +$ poetry run python demo.py +2021-09-02 14:51.58 [info ] Authentication has been started. Please follow the link to authenticate with your user: [gnista_library.gnista_connetion] url=https://aws.gnista.io/authentication/connect/authorize?client_id=python&redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Fhome&response_type=code&scope=data-api%20openid%20profile%20offline_access&state=myState +``` +In order to login copy the `url` into your Browser and Login to gnista.io or, if allowed a browser window will open by itself. + +### Keystore +Once you loggedin, the library will try to store your access token in your private keystore. Next time you run your programm, it might request a password to access your keystore again to gain access to gnista.io +Please take a look at [Keyring](https://pypi.org/project/keyring/) for details. + +## Advanced Example +### Show received Data in a plot +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +data_point_id = "56c5c6ff-3f7d-4532-8fbf-a3795f7b48b8" +data_point = GnistaDataPoint(connection=connection, data_point_id=data_point_id) + +data_point_data = data_point.get_data_point_data() +log.info("Data has been received. Plotting") +data_point_data.plot() +plt.show() + +``` + +### Filter by DataPoint Names +```shell +poetry new my-gnista-client +cd my-gnista-client +poetry add gnista-library +poetry add structlib +poetry add matplotlib +``` + +```python +import matplotlib.pyplot as plt +from structlog import get_logger + +from gnista_library import KeyringGnistaConnection, GnistaDataPoint, GnistaDataPoints + +log = get_logger() + +connection = KeyringGnistaConnection() + +dataPoints = GnistaDataPoints(connection=connection) +data_point_list = list(dataPoints.get_data_point_list()) + +for data_point in data_point_list: + log.info(data_point) + +# Find Specific Data Points +filtered_data_points = filter( + lambda data_point: data_point.name.startswith("371880214002"), data_point_list +) +for data_point in filtered_data_points: + # get the data + data_point_data = data_point.get_data_point_data() + log.info(data_point_data) + data_point_data.plot() + plt.show() + +``` + + + +## Links +**Website** +[![gnista.io](https://www.gnista.io/assets/images/gnista-logo-small.svg)](gnista.io) + +**PyPi** +[![PyPi](https://pypi.org/static/images/logo-small.95de8436.svg)](https://pypi.org/project/gnista-library/) + +**GIT Repository** +[![Gitlab](https://about.gitlab.com/images/icons/logos/slp-logo.svg)](https://gitlab.com/campfiresolutions/public/gnista.io-python-library) + +%prep +%autosetup -n gnista-library-2.0.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-gnista-library -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot - 2.0.2-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..1a70a9d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +b738d926e35627b3e0c0f1f48e655e04 gnista-library-2.0.2.tar.gz -- cgit v1.2.3