dnaStreaming 2.2.1.dev1__tar.gz → 2.3.0__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 (28) hide show
  1. {dnastreaming-2.2.1.dev1/dnaStreaming.egg-info → dnastreaming-2.3.0}/PKG-INFO +29 -4
  2. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/README.rst +26 -2
  3. dnastreaming-2.3.0/dnaStreaming/__init__.py +45 -0
  4. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0/dnaStreaming.egg-info}/PKG-INFO +29 -4
  5. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming.egg-info/requires.txt +1 -0
  6. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/setup.py +2 -1
  7. dnastreaming-2.2.1.dev1/dnaStreaming/__init__.py +0 -29
  8. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/LICENSE +0 -0
  9. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/MANIFEST.in +0 -0
  10. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/config.py +0 -0
  11. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/customer_config.json +0 -0
  12. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/demo/__init__.py +0 -0
  13. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/demo/pubsub_stream.py +0 -0
  14. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/demo/show_ha_stream_async.py +0 -0
  15. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/demo/show_stream.py +0 -0
  16. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/demo/show_stream_async.py +0 -0
  17. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/listener.py +0 -0
  18. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/services/__init__.py +0 -0
  19. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/services/authentication_service.py +0 -0
  20. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/services/availability_service.py +0 -0
  21. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/services/credentials_service.py +0 -0
  22. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/services/pubsub_service.py +0 -0
  23. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/test/__init__.py +0 -0
  24. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming/test/test_config.py +0 -0
  25. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming.egg-info/SOURCES.txt +0 -0
  26. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming.egg-info/dependency_links.txt +0 -0
  27. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/dnaStreaming.egg-info/top_level.txt +0 -0
  28. {dnastreaming-2.2.1.dev1 → dnastreaming-2.3.0}/setup.cfg +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dnaStreaming
3
- Version: 2.2.1.dev1
3
+ Version: 2.3.0
4
4
  Summary: Dow Jones DNA Streaming Project
5
5
  Home-page: https://github.com/dowjones/dj-dna-streams-python
6
- Download-URL: https://github.com/dowjones/dj-dna-streams-python/archive/release-2.2.1.dev1.tar.gz
6
+ Download-URL: https://github.com/dowjones/dj-dna-streams-python/archive/release-2.3.0.tar.gz
7
7
  Author: Zachary Kagan
8
8
  Author-email: zachary.kagan@dowjones.com
9
9
  License: MIT
@@ -14,6 +14,7 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Description-Content-Type: text/x-rst
16
16
  License-File: LICENSE
17
+ Requires-Dist: setuptools>=75.1.0
17
18
  Requires-Dist: googleapis-common-protos>=1.56.4
18
19
  Requires-Dist: google-auth>=2.11.0
19
20
  Requires-Dist: google-cloud-pubsub==2.13.6
@@ -66,7 +67,13 @@ To set your subscription ID, simply set an environment variable named 'SUBSCRIPT
66
67
  export SUBSCRIPTION_ID="ABC1234567889"
67
68
 
68
69
 
69
- The code above is the command line expression for setting this environment variable on Mac OSX. Other operating systems might have a slightly different techniques for setting environment variables on the command line.
70
+ To set your log folder path, simply set this folder variable named 'LOG_PATH' like so
71
+
72
+ .. code-block::
73
+
74
+ export LOG_PATH="/your/custom/log/path"
75
+
76
+
70
77
 
71
78
  2. Using the configuration file.
72
79
  ###################################################################
@@ -146,7 +153,25 @@ You may want to listen messages asynchronously like so:
146
153
  Log Files
147
154
  _________
148
155
 
149
- Very minimal logging is written to the module's path 'logs/dj-dna-streaming-python.log'. To keep maintenance simple this log is overwritten every time the app starts.
156
+
157
+ Minimal logging is written to a file named `dj-dna-streaming-python.log`.
158
+
159
+ By default, logs are written to the first available directory from the following list:
160
+
161
+ 1. A custom path set via the environment variable `LOG_PATH`.
162
+ 2. A `logs/` folder located within the package installation directory.
163
+ 3. A fallback directory: `~/.dj-dna-streaming-python/logs/`.
164
+
165
+ The first writable location found is selected. A message like `Will log to: /your/custom/log/path` is printed to the console on startup.
166
+
167
+ 💡 The log file is overwritten each time the application starts to keep maintenance simple.
168
+
169
+ You can specify:
170
+
171
+ - **Absolute paths**: For example, `/var/log/dna-streaming`.
172
+ - **Relative paths**: For example, `./logs`, relative to the current working directory at runtime.
173
+
174
+ The code verifies that the specified path is writable. If it isn’t, it automatically falls back to the next available option.
150
175
 
151
176
 
152
177
  Testing
@@ -41,7 +41,13 @@ To set your subscription ID, simply set an environment variable named 'SUBSCRIPT
41
41
  export SUBSCRIPTION_ID="ABC1234567889"
42
42
 
43
43
 
44
- The code above is the command line expression for setting this environment variable on Mac OSX. Other operating systems might have a slightly different techniques for setting environment variables on the command line.
44
+ To set your log folder path, simply set this folder variable named 'LOG_PATH' like so
45
+
46
+ .. code-block::
47
+
48
+ export LOG_PATH="/your/custom/log/path"
49
+
50
+
45
51
 
46
52
  2. Using the configuration file.
47
53
  ###################################################################
@@ -121,7 +127,25 @@ You may want to listen messages asynchronously like so:
121
127
  Log Files
122
128
  _________
123
129
 
124
- Very minimal logging is written to the module's path 'logs/dj-dna-streaming-python.log'. To keep maintenance simple this log is overwritten every time the app starts.
130
+
131
+ Minimal logging is written to a file named `dj-dna-streaming-python.log`.
132
+
133
+ By default, logs are written to the first available directory from the following list:
134
+
135
+ 1. A custom path set via the environment variable `LOG_PATH`.
136
+ 2. A `logs/` folder located within the package installation directory.
137
+ 3. A fallback directory: `~/.dj-dna-streaming-python/logs/`.
138
+
139
+ The first writable location found is selected. A message like `Will log to: /your/custom/log/path` is printed to the console on startup.
140
+
141
+ 💡 The log file is overwritten each time the application starts to keep maintenance simple.
142
+
143
+ You can specify:
144
+
145
+ - **Absolute paths**: For example, `/var/log/dna-streaming`.
146
+ - **Relative paths**: For example, `./logs`, relative to the current working directory at runtime.
147
+
148
+ The code verifies that the specified path is writable. If it isn’t, it automatically falls back to the next available option.
125
149
 
126
150
 
127
151
  Testing
@@ -0,0 +1,45 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ import os
4
+ import sys
5
+ import logging
6
+
7
+
8
+ def get_log_path():
9
+ env_log_path = os.getenv("LOG_PATH")
10
+ fallback_log_dir = os.path.expanduser('~/.dj-dna-streaming-python/logs')
11
+ base_dir = os.path.dirname(__file__)
12
+ default_path = os.path.join(base_dir, 'logs')
13
+
14
+ candidates = [env_log_path, default_path, fallback_log_dir]
15
+
16
+ for path in candidates:
17
+ if path:
18
+ try:
19
+ os.makedirs(path, exist_ok=True)
20
+ testfile = os.path.join(path, '.write_test')
21
+ with open(testfile, 'w') as f:
22
+ f.write('test')
23
+ os.remove(testfile)
24
+ return path
25
+ except Exception as e:
26
+ print(f"WARNING: Cannot write to '{path}': {e}")
27
+
28
+ raise RuntimeError("ERROR: Could not find a writable log directory.")
29
+
30
+
31
+ log_path = get_log_path()
32
+ print("Will log to: {}".format(log_path))
33
+
34
+ # Logging setup
35
+ logging.basicConfig(level=logging.WARN)
36
+ logger = logging.getLogger()
37
+
38
+ fileHandler = logging.FileHandler(os.path.join(log_path, 'dj-dna-streaming-python.log'))
39
+ logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s")
40
+ fileHandler.setFormatter(logFormatter)
41
+ logger.addHandler(fileHandler)
42
+
43
+ consoleHandler = logging.StreamHandler(sys.stdout)
44
+ consoleHandler.setFormatter(logFormatter)
45
+ logger.addHandler(consoleHandler)
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dnaStreaming
3
- Version: 2.2.1.dev1
3
+ Version: 2.3.0
4
4
  Summary: Dow Jones DNA Streaming Project
5
5
  Home-page: https://github.com/dowjones/dj-dna-streams-python
6
- Download-URL: https://github.com/dowjones/dj-dna-streams-python/archive/release-2.2.1.dev1.tar.gz
6
+ Download-URL: https://github.com/dowjones/dj-dna-streams-python/archive/release-2.3.0.tar.gz
7
7
  Author: Zachary Kagan
8
8
  Author-email: zachary.kagan@dowjones.com
9
9
  License: MIT
@@ -14,6 +14,7 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Description-Content-Type: text/x-rst
16
16
  License-File: LICENSE
17
+ Requires-Dist: setuptools>=75.1.0
17
18
  Requires-Dist: googleapis-common-protos>=1.56.4
18
19
  Requires-Dist: google-auth>=2.11.0
19
20
  Requires-Dist: google-cloud-pubsub==2.13.6
@@ -66,7 +67,13 @@ To set your subscription ID, simply set an environment variable named 'SUBSCRIPT
66
67
  export SUBSCRIPTION_ID="ABC1234567889"
67
68
 
68
69
 
69
- The code above is the command line expression for setting this environment variable on Mac OSX. Other operating systems might have a slightly different techniques for setting environment variables on the command line.
70
+ To set your log folder path, simply set this folder variable named 'LOG_PATH' like so
71
+
72
+ .. code-block::
73
+
74
+ export LOG_PATH="/your/custom/log/path"
75
+
76
+
70
77
 
71
78
  2. Using the configuration file.
72
79
  ###################################################################
@@ -146,7 +153,25 @@ You may want to listen messages asynchronously like so:
146
153
  Log Files
147
154
  _________
148
155
 
149
- Very minimal logging is written to the module's path 'logs/dj-dna-streaming-python.log'. To keep maintenance simple this log is overwritten every time the app starts.
156
+
157
+ Minimal logging is written to a file named `dj-dna-streaming-python.log`.
158
+
159
+ By default, logs are written to the first available directory from the following list:
160
+
161
+ 1. A custom path set via the environment variable `LOG_PATH`.
162
+ 2. A `logs/` folder located within the package installation directory.
163
+ 3. A fallback directory: `~/.dj-dna-streaming-python/logs/`.
164
+
165
+ The first writable location found is selected. A message like `Will log to: /your/custom/log/path` is printed to the console on startup.
166
+
167
+ 💡 The log file is overwritten each time the application starts to keep maintenance simple.
168
+
169
+ You can specify:
170
+
171
+ - **Absolute paths**: For example, `/var/log/dna-streaming`.
172
+ - **Relative paths**: For example, `./logs`, relative to the current working directory at runtime.
173
+
174
+ The code verifies that the specified path is writable. If it isn’t, it automatically falls back to the next available option.
150
175
 
151
176
 
152
177
  Testing
@@ -1,3 +1,4 @@
1
+ setuptools>=75.1.0
1
2
  googleapis-common-protos>=1.56.4
2
3
  google-auth>=2.11.0
3
4
  google-cloud-pubsub==2.13.6
@@ -6,7 +6,7 @@ this_directory = path.abspath(path.dirname(__file__))
6
6
  with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
7
7
  long_description = f.read()
8
8
 
9
- VERSION = "2.2.1.dev1"
9
+ VERSION = "2.3.0"
10
10
  RELEASE_TAG = f"release-{VERSION}"
11
11
 
12
12
  setup(
@@ -28,6 +28,7 @@ setup(
28
28
  include_package_data=True,
29
29
 
30
30
  install_requires=[
31
+ 'setuptools>=75.1.0',
31
32
  'googleapis-common-protos>=1.56.4',
32
33
  'google-auth>=2.11.0',
33
34
  'google-cloud-pubsub==2.13.6',
@@ -1,29 +0,0 @@
1
- from __future__ import absolute_import, division, print_function
2
-
3
- import os
4
- import sys
5
- import logging
6
-
7
-
8
- BASE_DIR = os.path.dirname(__file__)
9
-
10
- logging.basicConfig(level=logging.WARN)
11
-
12
- logger = logging.getLogger()
13
-
14
- log_path = os.path.join(BASE_DIR, 'logs')
15
-
16
- print("Will log to: {}".format(log_path))
17
-
18
- if not os.path.exists(log_path):
19
- os.mkdir(log_path)
20
-
21
- fileHandler = logging.FileHandler("{0}/{1}.log".format(log_path, 'dj-dna-streaming-python'))
22
-
23
- logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s")
24
- fileHandler.setFormatter(logFormatter)
25
- logger.addHandler(fileHandler)
26
-
27
- consoleHandler = logging.StreamHandler(sys.stdout)
28
- consoleHandler.setFormatter(logFormatter)
29
- logger.addHandler(consoleHandler)
File without changes