summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-05 07:10:52 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-05 07:10:52 +0000
commit90dda5ed26c29992c791f82273d05d822e963c95 (patch)
tree4c04c77390a3fd21e42f6376832daac00141360a
parent28a9bc0e8b6897705c906e20a4ce7c7ac0efc203 (diff)
automatic import of python-pyflumeopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-pyflume.spec349
-rw-r--r--sources1
3 files changed, 351 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..b35572a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/PyFlume-0.7.1.tar.gz
diff --git a/python-pyflume.spec b/python-pyflume.spec
new file mode 100644
index 0000000..665d6d0
--- /dev/null
+++ b/python-pyflume.spec
@@ -0,0 +1,349 @@
+%global _empty_manifest_terminate_build 0
+Name: python-PyFlume
+Version: 0.7.1
+Release: 1
+Summary: Package to integrate with Flume Sensor
+License: MIT License
+URL: https://github.com/ChrisMandich/PyFlume
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f2/14/ce54e23d0eb0bbf6391d99e14676dcb7d85d00b78764374c2314d9cafc65/PyFlume-0.7.1.tar.gz
+BuildArch: noarch
+
+Requires: python3-pyjwt
+Requires: python3-ratelimit
+Requires: python3-pytz
+Requires: python3-requests
+
+%description
+# PyFlume
+Authenticates to Flume API, returns a list of devices and allows you to pull the latest sensor results over a period of time.
+
+## Configuration
+You can find your Client ID and Client Secret under "API Access" on the [settings page](https://https://portal.flumetech.com/#settings).
+
+## Configuration Variables
+```
+username:
+ description: Your flume user id.
+ required: true
+ type: string
+password:
+ description: Your flume password.
+ required: true
+ type: string
+client_id:
+ description: Your flume Client ID.
+ required: true
+ type: string
+client_secret:
+ description: Your flume Client Secret.
+ required: true
+ type: string
+```
+
+## Examples
+
+```
+import pyflume
+from datetime import timedelta
+from requests import Session
+import logging
+
+logging.basicConfig(filename="flume.log",level=logging.DEBUG)
+
+KEY_DEVICE_TYPE = "type"
+KEY_DEVICE_ID = "id"
+FLUME_TYPE_SENSOR = 2
+
+username="<username>"
+password="<password>"
+client_id="<client_id>"
+client_secret="<client_secret>"
+
+SCAN_INTERVAL = timedelta(minutes=60)
+
+auth = pyflume.FlumeAuth(
+ username, password, client_id, client_secret, http_session=Session()
+ )
+
+flume_devices = pyflume.FlumeDeviceList(auth)
+devices = flume_devices.get_devices()
+
+print("DEVICE LIST")
+print(devices)
+
+print("DEVICE ID")
+for device in flume_devices.device_list:
+ if device[KEY_DEVICE_TYPE] == FLUME_TYPE_SENSOR:
+ print(device[KEY_DEVICE_ID])
+ device_id = device[KEY_DEVICE_ID]
+ device_timezone = device['location']['tz']
+
+flume = pyflume.FlumeData(
+ auth,
+ device_id,
+ device_timezone,
+ SCAN_INTERVAL,
+ http_session=Session(),
+ )
+
+flume_notifications = pyflume.FlumeNotificationList(auth, read="true")
+
+print("NOTIFICATION LIST")
+print(flume_notifications.notification_list)
+
+## Force Update
+flume.update_force()
+
+print("AUTH HEADER")
+print(auth.authorization_header)
+
+print("QUERY PAYLOAD")
+print(pyflume._generate_api_query_payload(SCAN_INTERVAL, device_timezone))
+
+print("FLUME VALUES")
+print(flume.values)
+```
+
+
+
+
+%package -n python3-PyFlume
+Summary: Package to integrate with Flume Sensor
+Provides: python-PyFlume
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-PyFlume
+# PyFlume
+Authenticates to Flume API, returns a list of devices and allows you to pull the latest sensor results over a period of time.
+
+## Configuration
+You can find your Client ID and Client Secret under "API Access" on the [settings page](https://https://portal.flumetech.com/#settings).
+
+## Configuration Variables
+```
+username:
+ description: Your flume user id.
+ required: true
+ type: string
+password:
+ description: Your flume password.
+ required: true
+ type: string
+client_id:
+ description: Your flume Client ID.
+ required: true
+ type: string
+client_secret:
+ description: Your flume Client Secret.
+ required: true
+ type: string
+```
+
+## Examples
+
+```
+import pyflume
+from datetime import timedelta
+from requests import Session
+import logging
+
+logging.basicConfig(filename="flume.log",level=logging.DEBUG)
+
+KEY_DEVICE_TYPE = "type"
+KEY_DEVICE_ID = "id"
+FLUME_TYPE_SENSOR = 2
+
+username="<username>"
+password="<password>"
+client_id="<client_id>"
+client_secret="<client_secret>"
+
+SCAN_INTERVAL = timedelta(minutes=60)
+
+auth = pyflume.FlumeAuth(
+ username, password, client_id, client_secret, http_session=Session()
+ )
+
+flume_devices = pyflume.FlumeDeviceList(auth)
+devices = flume_devices.get_devices()
+
+print("DEVICE LIST")
+print(devices)
+
+print("DEVICE ID")
+for device in flume_devices.device_list:
+ if device[KEY_DEVICE_TYPE] == FLUME_TYPE_SENSOR:
+ print(device[KEY_DEVICE_ID])
+ device_id = device[KEY_DEVICE_ID]
+ device_timezone = device['location']['tz']
+
+flume = pyflume.FlumeData(
+ auth,
+ device_id,
+ device_timezone,
+ SCAN_INTERVAL,
+ http_session=Session(),
+ )
+
+flume_notifications = pyflume.FlumeNotificationList(auth, read="true")
+
+print("NOTIFICATION LIST")
+print(flume_notifications.notification_list)
+
+## Force Update
+flume.update_force()
+
+print("AUTH HEADER")
+print(auth.authorization_header)
+
+print("QUERY PAYLOAD")
+print(pyflume._generate_api_query_payload(SCAN_INTERVAL, device_timezone))
+
+print("FLUME VALUES")
+print(flume.values)
+```
+
+
+
+
+%package help
+Summary: Development documents and examples for PyFlume
+Provides: python3-PyFlume-doc
+%description help
+# PyFlume
+Authenticates to Flume API, returns a list of devices and allows you to pull the latest sensor results over a period of time.
+
+## Configuration
+You can find your Client ID and Client Secret under "API Access" on the [settings page](https://https://portal.flumetech.com/#settings).
+
+## Configuration Variables
+```
+username:
+ description: Your flume user id.
+ required: true
+ type: string
+password:
+ description: Your flume password.
+ required: true
+ type: string
+client_id:
+ description: Your flume Client ID.
+ required: true
+ type: string
+client_secret:
+ description: Your flume Client Secret.
+ required: true
+ type: string
+```
+
+## Examples
+
+```
+import pyflume
+from datetime import timedelta
+from requests import Session
+import logging
+
+logging.basicConfig(filename="flume.log",level=logging.DEBUG)
+
+KEY_DEVICE_TYPE = "type"
+KEY_DEVICE_ID = "id"
+FLUME_TYPE_SENSOR = 2
+
+username="<username>"
+password="<password>"
+client_id="<client_id>"
+client_secret="<client_secret>"
+
+SCAN_INTERVAL = timedelta(minutes=60)
+
+auth = pyflume.FlumeAuth(
+ username, password, client_id, client_secret, http_session=Session()
+ )
+
+flume_devices = pyflume.FlumeDeviceList(auth)
+devices = flume_devices.get_devices()
+
+print("DEVICE LIST")
+print(devices)
+
+print("DEVICE ID")
+for device in flume_devices.device_list:
+ if device[KEY_DEVICE_TYPE] == FLUME_TYPE_SENSOR:
+ print(device[KEY_DEVICE_ID])
+ device_id = device[KEY_DEVICE_ID]
+ device_timezone = device['location']['tz']
+
+flume = pyflume.FlumeData(
+ auth,
+ device_id,
+ device_timezone,
+ SCAN_INTERVAL,
+ http_session=Session(),
+ )
+
+flume_notifications = pyflume.FlumeNotificationList(auth, read="true")
+
+print("NOTIFICATION LIST")
+print(flume_notifications.notification_list)
+
+## Force Update
+flume.update_force()
+
+print("AUTH HEADER")
+print(auth.authorization_header)
+
+print("QUERY PAYLOAD")
+print(pyflume._generate_api_query_payload(SCAN_INTERVAL, device_timezone))
+
+print("FLUME VALUES")
+print(flume.values)
+```
+
+
+
+
+%prep
+%autosetup -n PyFlume-0.7.1
+
+%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-PyFlume -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 0.7.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..ecaae85
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+dfa77210b5adbf99a873ad420152bb97 PyFlume-0.7.1.tar.gz