libhdbpp-python 0.0.22__tar.gz → 0.0.31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/PKG-INFO +6 -5
  2. libhdbpp-python-0.0.31/README +15 -0
  3. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/__init__.py +2 -2
  4. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/mariadb/mariadb.py +6 -5
  5. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/qt/plot.py +2 -2
  6. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/reader.py +21 -8
  7. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/libhdbpp_python.egg-info/PKG-INFO +6 -5
  8. libhdbpp-python-0.0.31/libhdbpp_python.egg-info/SOURCES.txt +20 -0
  9. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/libhdbpp_python.egg-info/entry_points.txt +0 -1
  10. libhdbpp-python-0.0.31/libhdbpp_python.egg-info/top_level.txt +1 -0
  11. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/setup.cfg +4 -4
  12. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/setup.py +3 -3
  13. libhdbpp-python-0.0.22/README.md +0 -7
  14. libhdbpp-python-0.0.22/libhdbpp_python.egg-info/SOURCES.txt +0 -20
  15. libhdbpp-python-0.0.22/libhdbpp_python.egg-info/top_level.txt +0 -1
  16. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/LICENSE +0 -0
  17. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/abstract.py +0 -0
  18. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/mariadb/__init__.py +0 -0
  19. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/mariadb/timeutils.py +0 -0
  20. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/qt/__init__.py +0 -0
  21. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/timescaledb/__init__.py +0 -0
  22. {libhdbpp-python-0.0.22/pyhdbpp → libhdbpp-python-0.0.31/hdbpp}/timescaledb/timescaledb.py +0 -0
  23. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/libhdbpp_python.egg-info/dependency_links.txt +0 -0
  24. {libhdbpp-python-0.0.22 → libhdbpp-python-0.0.31}/libhdbpp_python.egg-info/requires.txt +0 -0
@@ -1,15 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libhdbpp-python
3
- Version: 0.0.22
4
- Summary: Python bindings for Tango Control System Archiving
3
+ Version: 0.0.31
4
+ Summary: Moved to https://pypi.org/project/pyhdbpp (Python bindings for Tango Control System Archiving)
5
5
  Home-page: https://gitlab.com/tango-controls/hdbpp/libhdbpp-python
6
6
  Author: Sergi Rubio
7
7
  Author-email: srubio@cells.es
8
8
  License: LGPL-3+
9
- Description: hdbbpp readers for mariadb and timescaledb
10
- Extract data from HDB++ Tango Archiving Systems, using either MariaDB or TimeScaleDB
11
- Platform: UNKNOWN
12
9
  Classifier: Programming Language :: Python :: 3
13
10
  Requires-Python: >=3.6
14
11
  Description-Content-Type: text/markdown
15
12
  Provides-Extra: timescaledb
13
+ License-File: LICENSE
14
+
15
+ hdbbpp readers for mariadb and timescaledb
16
+ Extract data from HDB++ Tango Archiving Systems, using either MariaDB or TimeScaleDB
@@ -0,0 +1,15 @@
1
+ RENAMED to pyhdbpp!
2
+
3
+ new pypi project at https://pypi.org/project/pyhdbpp
4
+
5
+ Development continues at https://gitlab.com/tango-controls/hdbpp/libhdbpp-python
6
+
7
+ # Python Hdb++ Reader
8
+
9
+ Python module for extraction from multiple hdb++ engines.
10
+
11
+ Renamed to pyhdbpp, see previous links.
12
+
13
+ For legacy archiving and full hdb++ api (MySQL only) use PyTangoArchiving instead
14
+
15
+
@@ -1,6 +1,6 @@
1
1
 
2
- RELEASE = (0,0,22)
2
+ RELEASE = (0,0,31)
3
3
 
4
4
  version_major, version_minor, version_patch = RELEASE
5
5
 
6
- from pyhdbpp.reader import *
6
+ from .reader import *
@@ -249,7 +249,8 @@ class MariaDBReader(AbstractReader):
249
249
  (epoch1, r_value, w_value, quality, error_desc),
250
250
  ... ]
251
251
  """
252
- r = self.get_attributes_values([attribute], start_date, stop_date, decimate, False, **params)
252
+ r = self.get_attributes_values([attribute], start_date, stop_date,
253
+ decimate, False, **params)
253
254
  #print(r.keys(),start_date,stop_date)
254
255
  return r[attribute]
255
256
 
@@ -309,19 +310,19 @@ class MariaDBReader(AbstractReader):
309
310
  #print(cols)
310
311
  if 'data_time,' in cols:
311
312
  cols = cols.replace('data_time,',
312
- 'CAST(UNIX_TIMESTAMP(data_time) AS DOUBLE),')
313
+ 'CAST(UNIX_TIMESTAMP(data_time) AS DOUBLE),')
313
314
  q = ('select %s from %s where '
314
315
  'att_conf_id = %s and %s between %s and %s '
315
316
  'order by data_time'
316
317
  % (cols, t, i, tcol, b, e))
317
- print(q)
318
+
319
+ #print(q)
318
320
  data[a] = self._query(q, prune=decimate)
319
- print(len(data[a]),'L')
321
+ print('obtained data: {}'.format(len(data[a]),'L'))
320
322
  except:
321
323
  import traceback
322
324
  traceback.print_exc()
323
325
  data[a] = []
324
- #raise Exception('AttributeNotFound: %s' % a)
325
326
 
326
327
  return data
327
328
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
3
  import sys
4
- import pyhdbpp
4
+ import hdbpp
5
5
  import pyqtgraph
6
6
  import threading
7
7
 
@@ -9,7 +9,7 @@ import threading
9
9
 
10
10
  def plot_attributes_values(attributes,begin,end,schema='',show=False):
11
11
 
12
- rd = pyhdbpp.get_default_reader() if not schema else pyhdbpp.reader(config=schema)
12
+ rd = hdbpp.get_default_reader() if not schema else hdbpp.reader(config=schema)
13
13
  _cursor = rd._cursor
14
14
 
15
15
  plot = pyqtgraph.plot()
@@ -50,20 +50,26 @@ def get_default_reader(tango_host=''):
50
50
 
51
51
  get_hdb_property = lambda p: tangodb.get_property('HDB++',p)[p]
52
52
  schema = get_hdb_property('DefaultSchema')
53
- schema = schema[0] if not isinstance(schema,str) else schema
54
- data = dict(l.split('=') for l in get_hdb_property(schema))
53
+ try:
54
+ print('DefaultSchema',schema)
55
+ schema = schema[0] if not isinstance(schema,str) else schema
56
+ except:
57
+ traceback.print_exc()
58
+
59
+ data = dict(l.split('=') for l in get_hdb_property(schema) if '=' in l)
60
+ print(schema,data)
55
61
  return reader(apiclass=data['apiclass'],config=data['config'])
56
62
 
57
63
  except:
58
64
  traceback.print_exc()
59
65
  logger.info(traceback.format_exc())
60
66
 
61
- def reader(apiclass='pyhdbpp.abstract.AbstractReader', config=None):
67
+ def reader(apiclass='hdbpp.abstract.AbstractReader', config=None):
62
68
  """
63
69
  Initialize a reader object, based on the specified backend
64
70
  and a config dictionnary.
65
71
  """
66
-
72
+ print('Creating hdbpp.reader(%s)' % config)
67
73
  if isinstance(config,(bytes,str)):
68
74
 
69
75
  if os.path.isfile(config):
@@ -73,6 +79,8 @@ def reader(apiclass='pyhdbpp.abstract.AbstractReader', config=None):
73
79
  else:
74
80
  config = parse_config_string(config)
75
81
 
82
+ print(config)
83
+
76
84
  if not validate_config(config):
77
85
  logger.error(config)
78
86
  raise Exception('InvalidConfig')
@@ -93,6 +101,7 @@ def load_config_from_file(config_file):
93
101
  """
94
102
 
95
103
  try:
104
+ print('load_config_from_file(%s)' % config_file)
96
105
  with open(config_file, 'r') as fp:
97
106
  try:
98
107
  config = yaml.safe_load(fp)
@@ -117,6 +126,7 @@ def load_config_from_tango(schema, root = 'HDB++', tango_host = ''):
117
126
  Current version only accept Tango Free Properties
118
127
  """
119
128
  try:
129
+ print('load_config_from_tango(%s)' % schema)
120
130
  schema = schema.replace('tango:','').strip('/')
121
131
  if '.' in schema:
122
132
  root,schema = schema.rsplit('.',1)
@@ -131,8 +141,9 @@ def load_config_from_tango(schema, root = 'HDB++', tango_host = ''):
131
141
 
132
142
  print(tango_host,root,schema)
133
143
  get_hdb_property = lambda p: tangodb.get_property(root,p)[p]
134
- config = dict(l.split('=') for l in get_hdb_property(schema))
135
-
144
+ config = dict(l.split('=') for l in get_hdb_property(schema)
145
+ if '=' in l)
146
+
136
147
  config['database'] = config.get('database',
137
148
  config.get('db_name',
138
149
  config.get('dbname','hdbpp')))
@@ -154,8 +165,9 @@ def parse_config_string(connect_str):
154
165
  dict -- dictionary of values from the connect string.
155
166
  """
156
167
  try:
168
+ print('parse_config_str(%s)' % connect_str)
169
+
157
170
  config = {}
158
-
159
171
  config_split, config['database'] = connect_str.split('/')
160
172
  user_pass, host_port = config_split.split('@')
161
173
  config['user'], config['password'] = user_pass.split(':')
@@ -164,6 +176,7 @@ def parse_config_string(connect_str):
164
176
  return config
165
177
 
166
178
  except Exception as e:
179
+ print(traceback.print_exc())
167
180
  logger.error(str(e))
168
181
  return None
169
182
 
@@ -267,7 +280,7 @@ def read():
267
280
  logger.setLevel(logging.INFO)
268
281
 
269
282
  if args.version:
270
- from pyhdbpp import version_major, version_minor, version_patch
283
+ from hdbpp import version_major, version_minor, version_patch
271
284
  print("Version {}.{}.{}".format(str(version_major), str(version_minor), str(version_patch)))
272
285
 
273
286
  # Build a config based on the provided information
@@ -1,15 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libhdbpp-python
3
- Version: 0.0.22
4
- Summary: Python bindings for Tango Control System Archiving
3
+ Version: 0.0.31
4
+ Summary: Moved to https://pypi.org/project/pyhdbpp (Python bindings for Tango Control System Archiving)
5
5
  Home-page: https://gitlab.com/tango-controls/hdbpp/libhdbpp-python
6
6
  Author: Sergi Rubio
7
7
  Author-email: srubio@cells.es
8
8
  License: LGPL-3+
9
- Description: hdbbpp readers for mariadb and timescaledb
10
- Extract data from HDB++ Tango Archiving Systems, using either MariaDB or TimeScaleDB
11
- Platform: UNKNOWN
12
9
  Classifier: Programming Language :: Python :: 3
13
10
  Requires-Python: >=3.6
14
11
  Description-Content-Type: text/markdown
15
12
  Provides-Extra: timescaledb
13
+ License-File: LICENSE
14
+
15
+ hdbbpp readers for mariadb and timescaledb
16
+ Extract data from HDB++ Tango Archiving Systems, using either MariaDB or TimeScaleDB
@@ -0,0 +1,20 @@
1
+ LICENSE
2
+ README
3
+ setup.cfg
4
+ setup.py
5
+ hdbpp/__init__.py
6
+ hdbpp/abstract.py
7
+ hdbpp/reader.py
8
+ hdbpp/mariadb/__init__.py
9
+ hdbpp/mariadb/mariadb.py
10
+ hdbpp/mariadb/timeutils.py
11
+ hdbpp/qt/__init__.py
12
+ hdbpp/qt/plot.py
13
+ hdbpp/timescaledb/__init__.py
14
+ hdbpp/timescaledb/timescaledb.py
15
+ libhdbpp_python.egg-info/PKG-INFO
16
+ libhdbpp_python.egg-info/SOURCES.txt
17
+ libhdbpp_python.egg-info/dependency_links.txt
18
+ libhdbpp_python.egg-info/entry_points.txt
19
+ libhdbpp_python.egg-info/requires.txt
20
+ libhdbpp_python.egg-info/top_level.txt
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  hdbpp-reader = pyhdbpp.reader:read
3
-
@@ -1,9 +1,9 @@
1
1
  [metadata]
2
- name = pyhdbpp
3
- version = 0.0.1
2
+ name = hdbpp
3
+ version = 0.0.31
4
4
  url = https://gitlab.com/tango-controls/hdbpp/libhdbpp-python
5
- description = HDB++ data extraction for python
6
- long_description = file: README.md
5
+ description = "Moved to https://pypi.org/project/pyhdbpp (Python bindings for Tango Control System Archiving)"
6
+ long_description = file: README
7
7
  long_description_content_type = text/markdown
8
8
  license = LGPL
9
9
  license_file = LICENSE
@@ -2,8 +2,8 @@
2
2
  import setuptools
3
3
 
4
4
  try:
5
- import pyhdbpp
6
- version = '.'.join(map(str,pyhdbpp.RELEASE))
5
+ import hdbpp
6
+ version = '.'.join(map(str,hdbpp.RELEASE))
7
7
  except:
8
8
  import traceback
9
9
  traceback.print_exc()
@@ -15,7 +15,7 @@ if __name__ == "__main__":
15
15
  version=version,
16
16
  license='LGPL-3+',
17
17
  packages=setuptools.find_packages(),
18
- description="Python bindings for Tango Control System Archiving",
18
+ description="Moved to https://pypi.org/project/pyhdbpp (Python bindings for Tango Control System Archiving)",
19
19
  long_description="hdbbpp readers for mariadb and timescaledb\n"
20
20
  "Extract data from HDB++ Tango Archiving Systems, using either "
21
21
  "MariaDB or TimeScaleDB",
@@ -1,7 +0,0 @@
1
- # Python HdbReader
2
-
3
- New python module for extraction from multiple hdb++ engines.
4
-
5
- For legacy archiving and full hdb++ api (MySQL only) use PyTangoArchiving instead
6
-
7
-
@@ -1,20 +0,0 @@
1
- LICENSE
2
- README.md
3
- setup.cfg
4
- setup.py
5
- libhdbpp_python.egg-info/PKG-INFO
6
- libhdbpp_python.egg-info/SOURCES.txt
7
- libhdbpp_python.egg-info/dependency_links.txt
8
- libhdbpp_python.egg-info/entry_points.txt
9
- libhdbpp_python.egg-info/requires.txt
10
- libhdbpp_python.egg-info/top_level.txt
11
- pyhdbpp/__init__.py
12
- pyhdbpp/abstract.py
13
- pyhdbpp/reader.py
14
- pyhdbpp/mariadb/__init__.py
15
- pyhdbpp/mariadb/mariadb.py
16
- pyhdbpp/mariadb/timeutils.py
17
- pyhdbpp/qt/__init__.py
18
- pyhdbpp/qt/plot.py
19
- pyhdbpp/timescaledb/__init__.py
20
- pyhdbpp/timescaledb/timescaledb.py