zebra-day 0.0.37__py3-none-any.whl → 2.0.0__py3-none-any.whl

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 (173) hide show
  1. zebra_day/__init__.py +35 -0
  2. zebra_day/bin/__init__.py +0 -0
  3. zebra_day/cli/__init__.py +240 -0
  4. zebra_day/cli/cognito.py +121 -0
  5. zebra_day/cli/gui.py +338 -0
  6. zebra_day/cli/printer.py +168 -0
  7. zebra_day/cli/template.py +176 -0
  8. zebra_day/cmd_mgr.py +35 -0
  9. zebra_day/etc/Monoid-Regular-HalfTight-Dollar-0-1-l.ttf +0 -0
  10. zebra_day/etc/label_styles/blank.zpl +0 -0
  11. zebra_day/etc/label_styles/cornersStripOf4Squares_1inX1in.zpl +55 -0
  12. zebra_day/etc/label_styles/corners_1inX2in.zpl +28 -0
  13. zebra_day/etc/label_styles/corners_20cmX30cm.zpl +6 -0
  14. zebra_day/etc/label_styles/corners_smallTube.zpl +7 -0
  15. zebra_day/etc/label_styles/corners_unspecifiedDimensions.zpl +15 -0
  16. zebra_day/etc/label_styles/generic_2inX1in.zpl +21 -0
  17. zebra_day/etc/label_styles/plate_1inX0.25in.zpl +9 -0
  18. zebra_day/etc/label_styles/plate_1inX0.25inHD.zpl +9 -0
  19. zebra_day/etc/label_styles/smallTubeWdotHD_prod.zpl +8 -0
  20. zebra_day/etc/label_styles/smallTubeWdot_corners.zpl +7 -0
  21. zebra_day/etc/label_styles/smallTubeWdot_prod.zpl +8 -0
  22. zebra_day/etc/label_styles/smallTubeWdot_prodAlt1.zpl +6 -0
  23. zebra_day/etc/label_styles/smallTubeWdot_prodAlt1b.zpl +3 -0
  24. zebra_day/etc/label_styles/smallTubeWdot_prodV2.zpl +8 -0
  25. zebra_day/etc/label_styles/smallTubeWdot_reagent.zpl +29 -0
  26. zebra_day/etc/label_styles/stripOf4Squares_1inX1in.zpl +32 -0
  27. zebra_day/etc/label_styles/test_800dX800dCoordinateArray.zpl +1 -0
  28. zebra_day/etc/label_styles/tmps/.hold +0 -0
  29. zebra_day/etc/label_styles/tmps/tmp_zpl_templates.here +0 -0
  30. zebra_day/etc/label_styles/tube_20mmX30mmA.zpl +7 -0
  31. zebra_day/etc/label_styles/tube_2inX0.3in.zpl +15 -0
  32. zebra_day/etc/label_styles/tube_2inX0.5in.zpl +15 -0
  33. zebra_day/etc/label_styles/tube_2inX0.5inHD.zpl +15 -0
  34. zebra_day/etc/label_styles/tube_2inX1in.zpl +25 -0
  35. zebra_day/etc/label_styles/tube_2inX1inHD.zpl +22 -0
  36. zebra_day/etc/label_styles/tube_2inX1inHDv3.zpl +21 -0
  37. zebra_day/etc/old_printer_config/.hold +0 -0
  38. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.022846_printer_config.json +1 -0
  39. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.033657_printer_config.json +1 -0
  40. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.039597_printer_config.json +3 -0
  41. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.047295_printer_config.json +1 -0
  42. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.055804_printer_config.json +1 -0
  43. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.061337_printer_config.json +3 -0
  44. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.073326_printer_config.json +1 -0
  45. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.081950_printer_config.json +1 -0
  46. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.088251_printer_config.json +3 -0
  47. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.096501_printer_config.json +1 -0
  48. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.104767_printer_config.json +1 -0
  49. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.110364_printer_config.json +3 -0
  50. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.118239_printer_config.json +1 -0
  51. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.125950_printer_config.json +1 -0
  52. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.349866_printer_config.json +1 -0
  53. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.361085_printer_config.json +3 -0
  54. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.558323_printer_config.json +1 -0
  55. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.565756_printer_config.json +3 -0
  56. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.739070_printer_config.json +16 -0
  57. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.753796_printer_config.json +1 -0
  58. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.760201_printer_config.json +3 -0
  59. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.768747_printer_config.json +1 -0
  60. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.775312_printer_config.json +3 -0
  61. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.782533_printer_config.json +1 -0
  62. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.789287_printer_config.json +1 -0
  63. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.794230_printer_config.json +3 -0
  64. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.800021_printer_config.json +5 -0
  65. zebra_day/etc/printer_config.json +4 -0
  66. zebra_day/etc/printer_config.template.json +24 -0
  67. zebra_day/etc/tmp_printers0.json +5 -0
  68. zebra_day/etc/tmp_printers120.json +10 -0
  69. zebra_day/etc/tmp_printers145.json +10 -0
  70. zebra_day/etc/tmp_printers207.json +10 -0
  71. zebra_day/etc/tmp_printers374.json +5 -0
  72. zebra_day/etc/tmp_printers383.json +5 -0
  73. zebra_day/etc/tmp_printers450.json +5 -0
  74. zebra_day/etc/tmp_printers469.json +10 -0
  75. zebra_day/etc/tmp_printers485.json +10 -0
  76. zebra_day/etc/tmp_printers504.json +5 -0
  77. zebra_day/etc/tmp_printers531.json +10 -0
  78. zebra_day/etc/tmp_printers540.json +10 -0
  79. zebra_day/etc/tmp_printers542.json +10 -0
  80. zebra_day/etc/tmp_printers552.json +10 -0
  81. zebra_day/etc/tmp_printers608.json +5 -0
  82. zebra_day/etc/tmp_printers657.json +5 -0
  83. zebra_day/etc/tmp_printers715.json +10 -0
  84. zebra_day/etc/tmp_printers838.json +5 -0
  85. zebra_day/etc/tmp_printers839.json +5 -0
  86. zebra_day/etc/tmp_printers933.json +5 -0
  87. zebra_day/etc/tmp_printers957.json +5 -0
  88. zebra_day/etc/tmp_printers972.json +10 -0
  89. zebra_day/exceptions.py +88 -0
  90. zebra_day/files/.hold +0 -0
  91. zebra_day/files/blank_preview.png +0 -0
  92. zebra_day/files/corners_20cmX30cm_preview.png +0 -0
  93. zebra_day/files/generic_2inX1in_preview.png +0 -0
  94. zebra_day/files/hold +0 -0
  95. zebra_day/files/test_png_12020.png +0 -0
  96. zebra_day/files/test_png_12352.png +0 -0
  97. zebra_day/files/test_png_15472.png +0 -0
  98. zebra_day/files/test_png_17696.png +0 -0
  99. zebra_day/files/test_png_23477.png +0 -0
  100. zebra_day/files/test_png_24493.png +0 -0
  101. zebra_day/files/test_png_28157.png +0 -0
  102. zebra_day/files/test_png_30069.png +0 -0
  103. zebra_day/files/test_png_35832.png +0 -0
  104. zebra_day/files/test_png_36400.png +0 -0
  105. zebra_day/files/test_png_40816.png +0 -0
  106. zebra_day/files/test_png_47791.png +0 -0
  107. zebra_day/files/test_png_47799.png +0 -0
  108. zebra_day/files/test_png_49564.png +0 -0
  109. zebra_day/files/test_png_53848.png +0 -0
  110. zebra_day/files/test_png_55588.png +0 -0
  111. zebra_day/files/test_png_58809.png +0 -0
  112. zebra_day/files/test_png_62542.png +0 -0
  113. zebra_day/files/test_png_67242.png +0 -0
  114. zebra_day/files/test_png_89893.png +0 -0
  115. zebra_day/files/test_png_91597.png +0 -0
  116. zebra_day/files/test_png_93633.png +0 -0
  117. zebra_day/files/tmpbjo3k7q1.png +0 -0
  118. zebra_day/files/tmpigtr4pwy.png +0 -0
  119. zebra_day/files/tube_20mmX30mmA_preview.png +0 -0
  120. zebra_day/files/zpl_label_tube_2inX1in_2026-02-01_01:51:24.370964.png +0 -0
  121. zebra_day/logging_config.py +74 -0
  122. zebra_day/logs/.hold +0 -0
  123. zebra_day/logs/print_requests.log +2 -0
  124. zebra_day/paths.py +143 -0
  125. zebra_day/print_mgr.py +557 -117
  126. zebra_day/static/datschund.css +140 -0
  127. zebra_day/static/datschund.png +0 -0
  128. zebra_day/static/daylily.png +0 -0
  129. zebra_day/static/favicon.svg +20 -0
  130. zebra_day/static/general.css +99 -0
  131. zebra_day/static/js/zebra_modern.js +172 -0
  132. zebra_day/static/lsmc.css +354 -0
  133. zebra_day/static/moon.jpeg +0 -0
  134. zebra_day/static/oakland.css +197 -0
  135. zebra_day/static/petrichor.css +150 -0
  136. zebra_day/static/popday_daylily.css +140 -0
  137. zebra_day/static/style.css +183 -0
  138. zebra_day/static/triangles.css +122 -0
  139. zebra_day/static/tron.css +277 -0
  140. zebra_day/static/zebra_modern.css +771 -0
  141. zebra_day/static/zebras.css +176 -0
  142. zebra_day/templates/modern/base.html +98 -0
  143. zebra_day/templates/modern/config.html +141 -0
  144. zebra_day/templates/modern/config_backups.html +59 -0
  145. zebra_day/templates/modern/config_editor.html +95 -0
  146. zebra_day/templates/modern/config_new.html +93 -0
  147. zebra_day/templates/modern/dashboard.html +160 -0
  148. zebra_day/templates/modern/print_request.html +145 -0
  149. zebra_day/templates/modern/print_result.html +88 -0
  150. zebra_day/templates/modern/printer_detail.html +244 -0
  151. zebra_day/templates/modern/printers.html +144 -0
  152. zebra_day/templates/modern/save_result.html +46 -0
  153. zebra_day/templates/modern/template_editor.html +175 -0
  154. zebra_day/templates/modern/templates.html +122 -0
  155. zebra_day/web/__init__.py +9 -0
  156. zebra_day/web/app.py +248 -0
  157. zebra_day/web/auth.py +172 -0
  158. zebra_day/web/middleware.py +159 -0
  159. zebra_day/web/routers/__init__.py +2 -0
  160. zebra_day/web/routers/api.py +313 -0
  161. zebra_day/web/routers/ui.py +636 -0
  162. zebra_day/zpl_renderer.py +273 -0
  163. zebra_day-2.0.0.dist-info/METADATA +847 -0
  164. zebra_day-2.0.0.dist-info/RECORD +168 -0
  165. {zebra_day-0.0.37.dist-info → zebra_day-2.0.0.dist-info}/WHEEL +1 -1
  166. zebra_day-2.0.0.dist-info/entry_points.txt +4 -0
  167. zebra_day/bin/scan_for_networed_zebra_printers.py +0 -23
  168. zebra_day/bin/te.py +0 -905
  169. zebra_day/bin/zserve.py +0 -620
  170. zebra_day-0.0.37.dist-info/METADATA +0 -1177
  171. zebra_day-0.0.37.dist-info/RECORD +0 -10
  172. {zebra_day-0.0.37.dist-info → zebra_day-2.0.0.dist-info/licenses}/LICENSE +0 -0
  173. {zebra_day-0.0.37.dist-info → zebra_day-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,847 @@
1
+ Metadata-Version: 2.4
2
+ Name: zebra_day
3
+ Version: 2.0.0
4
+ Summary: A Python library to manage a Zebra printer fleet and an API for ZPL print requests.
5
+ Home-page: https://github.com/Daylily-Informatics/zebra_day
6
+ Author: John Major
7
+ Author-email: John Major <john@daylilyinformatics.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/Daylily-Informatics/zebra_day
10
+ Project-URL: Repository, https://github.com/Daylily-Informatics/zebra_day.git
11
+ Project-URL: Issues, https://github.com/Daylily-Informatics/zebra_day/issues
12
+ Keywords: zebra,printer,zpl,label,barcode,fleet
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Manufacturing
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Printing
24
+ Classifier: Topic :: System :: Hardware
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: yaml-config-day>=0.0.5
29
+ Requires-Dist: requests>=2.28.0
30
+ Requires-Dist: pytz>=2023.3
31
+ Requires-Dist: fastapi>=0.109.0
32
+ Requires-Dist: uvicorn[standard]>=0.27.0
33
+ Requires-Dist: jinja2>=3.1.0
34
+ Requires-Dist: pydantic>=2.0.0
35
+ Requires-Dist: python-multipart>=0.0.6
36
+ Requires-Dist: typer>=0.9.0
37
+ Requires-Dist: rich>=13.0.0
38
+ Requires-Dist: pillow>=10.0.0
39
+ Requires-Dist: zint-bindings>=1.2.0
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
42
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
43
+ Requires-Dist: ipython>=8.16.0; extra == "dev"
44
+ Provides-Extra: lint
45
+ Requires-Dist: black>=23.0.0; extra == "lint"
46
+ Requires-Dist: ruff>=0.1.0; extra == "lint"
47
+ Requires-Dist: mypy>=1.0.0; extra == "lint"
48
+ Provides-Extra: docs
49
+ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
50
+ Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
51
+ Provides-Extra: auth
52
+ Requires-Dist: daylily-cognito>=0.1.10; extra == "auth"
53
+ Requires-Dist: python-jose[cryptography]>=3.3.0; extra == "auth"
54
+ Requires-Dist: boto3>=1.26.0; extra == "auth"
55
+ Provides-Extra: all
56
+ Requires-Dist: zebra_day[auth,dev,docs,lint]; extra == "all"
57
+ Dynamic: author
58
+ Dynamic: home-page
59
+ Dynamic: license-file
60
+
61
+ <img src=zebra_day/imgs/bar_red.png>
62
+
63
+ ## zebra_day Overview [2.0.0](https://github.com/Daylily-Informatics/zebra_day/releases/tag/2.0.0)
64
+
65
+ ### Build, Deploy, Run, Monitor, Teardown
66
+
67
+ ```bash
68
+ # Build & Install (development mode)
69
+ pip install -e ".[dev]"
70
+
71
+ # Activate environment (for development)
72
+ source zday_activate # Sets up env, installs package, enables tab completion
73
+
74
+ # Run Tests
75
+ pytest -v
76
+
77
+ # Run Linting (requires pip install -e ".[lint]")
78
+ ruff check zebra_day tests
79
+ black --check zebra_day tests
80
+ mypy zebra_day --ignore-missing-imports
81
+
82
+ # CLI Commands (new in 0.6.0)
83
+ zday --help # Show all commands
84
+ zday bootstrap # First-time setup: scan for printers
85
+ zday gui start # Start web UI in background
86
+ zday gui stop # Stop web UI
87
+ zday gui status # Check if web UI is running
88
+
89
+ # Health Checks (use https:// if certificates are configured, http:// otherwise)
90
+ curl https://localhost:8118/healthz # Basic health check
91
+ curl https://localhost:8118/readyz # Readiness check (printer mgr initialized)
92
+
93
+ # API Documentation
94
+ # Visit https://localhost:8118/docs for interactive OpenAPI docs
95
+ # Visit https://localhost:8118/redoc for alternative API documentation
96
+ ```
97
+
98
+ <ul>
99
+
100
+ <table border="1" >
101
+ <tr >
102
+ <td > * auto discovery * of networked printers</td>
103
+ <td> ui configurable printer fleet details</td>
104
+ <td >zpl template drafting & live ui preview </td>
105
+ </tr>
106
+ <tr >
107
+ <td>monitor printer fleet status in one dashboard</td>
108
+ <td >simple and powerful python package offers ability to include barcode label printing in other s/w systems</td>
109
+ <td>fast and straight forward deployment and maintaince</td>
110
+ </tr>
111
+ <tr >
112
+ <td >directly access each printers admin console</td>
113
+ <td >integrate with other systems (Salesforce, AWS)</td>
114
+ <td > simple print API endpoints <hr>(commercial alternatives are quite expensive, and often offer less)</td>
115
+ </tr>
116
+ </table>
117
+ </ul>
118
+
119
+
120
+ <hr>
121
+
122
+ #### For The Impatient
123
+
124
+ <ul>
125
+ * Verify there are zebra printers connected & powered up to the same network that the PC you are installing this s/w to is connected.
126
+
127
+ ```bash
128
+ python --version # should be 3.10+ # advisable to run in some kind of venv
129
+
130
+ pip install zebra_day
131
+
132
+ # You should load a fresh env / open a fresh terminal so the package is available
133
+
134
+ # First-time setup: scan network for printers and initialize configuration
135
+ zday bootstrap
136
+
137
+ # Start the web UI (runs in background)
138
+ zday gui start
139
+ # Web UI available at http://0.0.0.0:8118
140
+
141
+ # Or start in foreground (for debugging)
142
+ zday gui start --foreground
143
+
144
+ # Check status
145
+ zday gui status
146
+ zday info
147
+
148
+ # Stop the server
149
+ zday gui stop
150
+ ```
151
+ <ul>
152
+ <a href=zebra_day/docs/zebra_day_ui_guide.md ><hr></a>
153
+
154
+ > <a href=zebra_day/docs/zebra_day_ui_guide.md >ui capabilities full details</a>
155
+
156
+ #### Some UI Niceties
157
+ ##### Zebra Printer Fleet Dashboard
158
+ <img width="400" alt="fleetreport" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/8a66bc11-f8f5-4c40-9970-36d554a4593a">
159
+
160
+ ##### Zebra Printer, Single Printer Detail View
161
+ <img width="690" alt="Screenshot 2023-11-01 at 1 35 36 AM" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/7438df35-9e92-474e-a2ef-57d3c3ee23d7">
162
+
163
+ ##### ZPL Label Editing IRT
164
+ <img width="345" alt="zpl_editing" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/15aac332-c5f8-4ce6-be6c-9c403fd8d35d">
165
+
166
+ </ul>
167
+
168
+ ### CLI Reference (0.6.0+)
169
+
170
+ The `zday` CLI provides a comprehensive interface for managing your Zebra printer fleet.
171
+
172
+ ```bash
173
+ # Get help on any command
174
+ zday --help
175
+ zday gui --help
176
+ zday printer --help
177
+
178
+ # Core commands
179
+ zday info # Show version, config paths, server status
180
+ zday status # Show printer fleet status, service health
181
+ zday bootstrap # First-time setup: scan network, initialize config
182
+
183
+ # GUI server management
184
+ zday gui start [--auth none|cognito] [--host HOST] [--port PORT] [--cert FILE] [--key FILE] [--no-https]
185
+ zday gui stop
186
+ zday gui status
187
+ zday gui logs [--tail N] [--follow]
188
+ zday gui restart
189
+
190
+ # Printer management
191
+ zday printer scan [--ip-stub IP] # Scan network for printers
192
+ zday printer list [--lab LAB] # List configured printers
193
+ zday printer test PRINTER_NAME # Send test print
194
+
195
+ # Template management
196
+ zday template list # List ZPL templates
197
+ zday template preview TEMPLATE # Generate PNG preview
198
+ zday template edit TEMPLATE # Open in editor
199
+ zday template show TEMPLATE # Display template contents
200
+
201
+ # Cognito authentication (requires pip install -e ".[auth]")
202
+ zday cognito status # Show auth configuration
203
+ zday cognito info # Setup instructions
204
+ ```
205
+
206
+ #### Migration from 0.5.x
207
+
208
+ The old commands `zday_start` and `zday_quickstart` still work but are deprecated:
209
+
210
+ | Old Command | New Command |
211
+ |-------------|-------------|
212
+ | `zday_quickstart` | `zday bootstrap && zday gui start` |
213
+ | `zday_start` | `zday gui start` |
214
+ | `zday_start --auth cognito` | `zday gui start --auth cognito` |
215
+
216
+ ### Local HTTPS Setup
217
+
218
+ The zebra_day web UI supports HTTPS for secure local development. By default, HTTPS is enabled if certificates are found.
219
+
220
+ #### One-Time Setup (mkcert)
221
+
222
+ ```bash
223
+ # Install mkcert
224
+ # macOS
225
+ brew install mkcert
226
+
227
+ # Ubuntu/Debian
228
+ sudo apt install mkcert
229
+
230
+ # Create and install local CA (one-time, requires password)
231
+ mkcert -install
232
+ ```
233
+
234
+ #### Generate Certificates for zebra_day
235
+
236
+ ```bash
237
+ # Create certificate directory
238
+ mkdir -p ~/.config/zebra_day/certs
239
+
240
+ # Generate locally-trusted certificates
241
+ mkcert -cert-file ~/.config/zebra_day/certs/server.crt \
242
+ -key-file ~/.config/zebra_day/certs/server.key \
243
+ localhost 127.0.0.1 ::1
244
+ ```
245
+
246
+ #### HTTPS Options
247
+
248
+ | Method | Description |
249
+ |--------|-------------|
250
+ | **Auto-detect** | If certs exist in `~/.config/zebra_day/certs/`, HTTPS is enabled automatically |
251
+ | **Explicit paths** | `zday gui start --cert /path/to/cert.crt --key /path/to/key.key` |
252
+ | **Environment vars** | Set `SSL_CERT_PATH` and `SSL_KEY_PATH` |
253
+ | **Force HTTP** | `zday gui start --no-https` |
254
+
255
+ #### Verify HTTPS
256
+
257
+ ```bash
258
+ # Start server (will use HTTPS if certs are found)
259
+ zday gui start
260
+
261
+ # Test connection
262
+ curl https://localhost:8118/healthz
263
+ ```
264
+
265
+ #### Troubleshooting
266
+
267
+ | Issue | Solution |
268
+ |-------|----------|
269
+ | Browser shows "Not Secure" | Run `mkcert -install` to trust the local CA |
270
+ | Certificate not found | Check paths: `ls ~/.config/zebra_day/certs/` |
271
+ | Permission denied | Ensure cert files are readable: `chmod 644 ~/.config/zebra_day/certs/*` |
272
+ | Want HTTP only | Use `--no-https` flag: `zday gui start --no-https` |
273
+
274
+ ### It Is 3+ Things
275
+
276
+ (1) Zebra Printer Management & Configuration
277
+
278
+ (2) ZPL Label Template Tools
279
+
280
+ (3) A Python Library To Manage Formulating & Sending Label Print Requests
281
+
282
+ (bonuses)
283
+ * a web gui to make some of the above more approachable && expose (3) as a http API.
284
+ * Documentation sufficent for organization to successfuly assemble & deploy a reasonalbly sized barcoding system in your operational environment in potentially weeks.
285
+ * ... and cheaply! a 10 printer install could cost ~$5,000.00 in purchases. With ongoing operational expenses of ~$150/mo (depends on label stock consumption mostly).
286
+
287
+ ### And It Is Not
288
+
289
+ * _An Identify Generating Authority_
290
+ * you will need to produce your own UID/GUID/etc. This can be manual, spreadsheets, custom code, various RDBMS, LIMS systems, Salesforce... but should not be tangled in this package.
291
+ * also, METADATA regaring your UID is important as these metadata can be presented on the labels in addition to the human readable and scannable representation of the provided UID. [Unique Identifier Maxims](zebra_day/docs/uid_screed_light.md).
292
+
293
+ </ul>
294
+
295
+ ## Getting Started
296
+
297
+ <ul>
298
+
299
+ ### Facilitated :: Daylily Orchestrated Build and Deploy ( deliverable in ~1month )
300
+ * [Daylily is available to lead or contribute to the building and deployment of universal barcoding systems to your organizations operations](https://www.linkedin.com/in/john--major/). Daylily offers expertise with the entire process from evaluating existing operations systems, proposing integration options, securing all hardware, deploying hardware and software, and importantly: connecting newly deployed barcoding services to other LIS systems.
301
+
302
+ #### Universal Barcoding Capability Project Timing Estimates
303
+
304
+ <ul>
305
+ <ul>
306
+
307
+ > <img src=zebra_day/imgs/UBC_gantt_chart.png height=200 width=450>
308
+
309
+ </ul>
310
+ </ul>
311
+
312
+ ### Requirements
313
+ * Tested and runs on MAC and Ubuntu (but other flavors of Linux should be no problem). Windows would be a rather large hassle, though presumably possible.
314
+ * [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html#regular-installation) and [mamba](https://anaconda.org/conda-forge/mamba) installed. This is not, in fact, a blocking requirement, but other env setups have not been tested yet. __for MAC users, it may be advisable to install conda with homebrew__.
315
+ * create conda environment `ZDAY`, which will be used to run the UI
316
+ ```bash
317
+ mamba create -n ZDAY -c conda-forge python==3.10 pip ipython
318
+ ```
319
+ #### Nice To Have
320
+ * For MAC address discovery, `arp` should be installed (both for MAC and Linux).
321
+ ##### Ubuntu
322
+ ```bash
323
+ sudo apt-get install net-tools
324
+ ```
325
+
326
+ ##### MAC
327
+ * Should be pre-installed by default.
328
+
329
+ ### Install From PIP
330
+ you can pip install `zebra_day` to any python environment running 3.10.*. If you plan to run the web UI or use the HTTP API functionality, run this in the above described `ZDAY` conda env. To install with pip:
331
+
332
+ ```bash
333
+ pip install zebra_day
334
+ ```
335
+ * reload your environment/shell.
336
+
337
+
338
+ ### Install From Source
339
+
340
+ #### Clone Repository & Local PIP
341
+
342
+ * [From github via ssh](https://github.com/Daylily-Informatics/zebra_day)
343
+
344
+ ```bash
345
+ git clone git@github.com:Daylily-Informatics/zebra_day.git
346
+ cd zebra_day
347
+ conda activate ZDAY # ZDAY was built with mamba earlier
348
+
349
+ # Modern install (recommended)
350
+ pip install -e . # Install in editable mode
351
+ pip install -e ".[dev]" # Include dev dependencies
352
+ pip install -e ".[lint]" # Include linting tools
353
+ pip install -e ".[all]" # Include all extras
354
+
355
+ # Build wheel/sdist
356
+ pip install build
357
+ python -m build # Creates dist/*.whl and dist/*.tar.gz
358
+ ```
359
+
360
+ * `zebra_day` is now installed in your current python environment.
361
+ * reload your environment/shell.
362
+
363
+ ### File Locations (XDG-compliant)
364
+
365
+ zebra_day 0.6.0+ uses XDG Base Directory specification for file storage:
366
+
367
+ | Type | macOS | Linux |
368
+ |------|-------|-------|
369
+ | **Config** | `~/Library/Preferences/zebra_day/` | `~/.config/zebra_day/` |
370
+ | **Data** | `~/Library/Application Support/zebra_day/` | `~/.local/share/zebra_day/` |
371
+ | **Logs** | `~/Library/Logs/zebra_day/` | `~/.local/state/zebra_day/` |
372
+ | **Cache** | `~/Library/Caches/zebra_day/` | `~/.cache/zebra_day/` |
373
+
374
+ Key files:
375
+ - `printer_config.json` - Printer fleet configuration (in config dir)
376
+ - `label_styles/` - ZPL template files (in data dir)
377
+ - `label_styles/tmps/` - Draft templates (in data dir)
378
+
379
+ Use `zday info` to see the exact paths on your system.
380
+
381
+ <br><br><br>
382
+
383
+ </ul>
384
+
385
+
386
+ ## Hardware Config
387
+ ### Quick
388
+ * Connect all zebra printers to the same network as the machine you'll be running `zebra_day` is connected to. Load labels, power on printers , confirm status lights are green, etc.
389
+
390
+ ### [Hardware Guide](zebra_day/docs/hardware_config_guide.md)
391
+ * Info on hardware and consumables known to work with `zebra_day`. User guides, notes, part#s and costs for:
392
+ * Printers
393
+ * Label Stock
394
+ * Barcode Scanners
395
+
396
+
397
+ <br><br>
398
+
399
+ </ul>
400
+
401
+ <img src=zebra_day/imgs/bar_purp3.png>
402
+
403
+ # USAGE
404
+
405
+ <ul>
406
+
407
+ ## QUICKSTART
408
+ * zebra printers -> power on and connect via cable or wifi to the same network the machine you installed `zebra_day` is on.
409
+ * activate the environment you have `zebra_day` installed into.
410
+ * If you have just pip installed `zebra_day` in the shell you are in, start a new shell.
411
+
412
+ ```bash
413
+ # First-time setup: scan network for printers and initialize configuration
414
+ zday bootstrap
415
+
416
+ # Start the web UI (runs in background by default)
417
+ zday gui start
418
+
419
+ # Or start in foreground for debugging
420
+ zday gui start --foreground
421
+ ```
422
+
423
+ ### Example Output From `zday bootstrap`
424
+ <pre>
425
+ $ zday bootstrap
426
+
427
+ Detecting local IP address...
428
+ IP detected: 192.168.1.12 ... using IP root: 192.168.1
429
+
430
+ Scanning for Zebra printers on network (this may take a few minutes)...
431
+
432
+ Zebra Printer Scan Complete.
433
+ Found 2 printers:
434
+ - 192.168.1.7 (ZTC GX420d)
435
+ - 192.168.1.20 (ZD620)
436
+
437
+ Configuration saved to: ~/.config/zebra_day/printer_config.json
438
+
439
+ Run 'zday gui start' to launch the web interface.
440
+ </pre>
441
+
442
+ ### Example Output From `zday gui start`
443
+ <pre>
444
+ $ zday gui start
445
+
446
+ Starting zebra_day web server...
447
+ Server running at: http://192.168.1.12:8118
448
+
449
+ Modern UI: http://192.168.1.12:8118/
450
+ Legacy UI: http://192.168.1.12:8118/legacy
451
+ API Docs: http://192.168.1.12:8118/docs
452
+
453
+ Server started in background (PID: 12345)
454
+ Use 'zday gui status' to check status
455
+ Use 'zday gui stop' to stop the server
456
+ </pre>
457
+
458
+ > The web service runs in the background. Use `zday gui status` to check if it's running, and `zday gui stop` to stop it.
459
+
460
+ #### zebra_day Web GUI
461
+
462
+ ##### Home Page
463
+ <img src=zebra_day/imgs/zday_quick_gui.png>
464
+
465
+ ##### Zebra Fleet Auto Discovery & Status Report
466
+
467
+ <img width="1024" alt="fleetreport" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/8a66bc11-f8f5-4c40-9970-36d554a4593a">
468
+
469
+
470
+ ##### Zebra Printer Fleet Config Json Editing
471
+ <img width="472" alt="pconfjson" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/0813cb07-4c5a-4cc9-9b33-d00e8424385e">
472
+ One printer configured.
473
+
474
+
475
+ ##### ZPL Template Drafting / Preview PNG / Test Print / Save
476
+ <img width="953" alt="zpl_editing" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/15aac332-c5f8-4ce6-be6c-9c403fd8d35d">
477
+
478
+
479
+ ##### Manual Print Requests
480
+ <img width="895" alt="printmanual" src="https://github.com/Daylily-Informatics/zebra_day/assets/4713659/72442f68-984f-4264-93ec-9878372d26f2">
481
+
482
+
483
+ <br><br>
484
+
485
+
486
+ ## Programatic
487
+ ### Quick
488
+ Open an ipython shell.
489
+
490
+ ```python
491
+ import zebra_day.print_mgr as zdpm
492
+
493
+ zlab = zdpm.zpl()
494
+
495
+ zlab.probe_zebra_printers_add_to_printers_json('192.168.1') # REPLACE the IP stub with the correct value for your network. This may take a few min to run. !! This command is not required if you've sucessuflly run the quickstart already, also, won't hurt.
496
+
497
+ print(zlab.printers) # This should print out the json dict of all detected zebra printers. An empty dict, {}, is a failure of autodetection, and manual creation of the json file may be needed. If successful, the lab name assigned is 'scan-results', this may be edited latter.
498
+
499
+ # The json will loook something like this
500
+ ## {'labs': {'scan-results': {'192.168.1.7': {'ip_address': '192.168.1.7', 'label_zpl_styles': ['test_2inX1in'], 'print_method': 'unk'}}}
501
+ ## 'lab' name 'printer' name(can be edited latter) label_zpl_style
502
+
503
+ # Assuming a printer was detected, send a test print request. Using the 'lab', 'printer' and 'label_zpl_style' above (you'd have your own IP/Name, other values should remain the same for now. There are multiple label ZPL formats available, the test_2inX1in is for quick testing & only formats in the two UID values specified.
504
+
505
+ zlab.print_zpl(lab='scan-results', printer_name='192.168.1.7', label_zpl_style='test_2inX1in', uid_barcode="123aUID")
506
+ # ZPL code sent successfully to the printer!
507
+ # Out[13]: '^XA\n^FO235,20\n^BY1\n^B3N,N,40,N,N\n^FD123aUID^FS\n^FO235,70\n^ADN,30,20\n^FD123aUID^FS\n^FO235,115\n^ADN,25,12\n^FDalt_a^FS\n^FO235,145\n^ADN,25,12\n^FDalt_b^FS\n^FO70,180\n^FO235,170\n^ADN,30,20\n^FDalt_c^FS\n^FO490,180\n^ADN,25,12\n^FDalt_d^FS\n^XZ'
508
+ ```
509
+
510
+ * This will produce a label which looks like this (modulo printer config items needing attention).
511
+ ![test_lab](zebra_day/imgs/quick_start_test_label2.png)
512
+
513
+
514
+ ### [Programatic Guide](zebra_day/docs/programatic_guide.md)
515
+
516
+
517
+ <br><br>
518
+
519
+ ## Print Request HTTP API
520
+
521
+ ### Quick Start
522
+
523
+ The HTTP API is available via the web UI, and can be used programatically as well. The following is a quick example of how to send a print request via the HTTP API.
524
+
525
+ ```bash
526
+ curl "http://localhost:8118/_print_label?lab=MA&printer=192.168.1.31&printer_ip=&label_zpl_style=tube_2inX1in&uid_barcode=BARCODE&alt_a=FIELDAAAA&alt_b=FIELDBBBB&alt_c=FIELDCCCC&alt_d=FIELDDDD&alt_e=FIELDEEEE&alt_f=FIELDFFFF"
527
+
528
+ # RETURNS 200 OK -or- 500 Internal Server Error (usually b/c the target printer is not reachable)
529
+
530
+ ```
531
+ > The above would send a print request to the specified printer, identified by it's network IP. Label style can be set, and some styles use more `alt_*` fields than others. This reuest will return `200` or `500`.
532
+
533
+ ## Web UI
534
+
535
+ ### Quick Start
536
+
537
+ ```bash
538
+ # Start the web server (runs in background)
539
+ zday gui start
540
+
541
+ # Check status
542
+ zday gui status
543
+
544
+ # View logs
545
+ zday gui logs --tail 50
546
+
547
+ # Stop the server
548
+ zday gui stop
549
+
550
+ # Or run in foreground for debugging
551
+ zday gui start --foreground
552
+
553
+ # Or run via uvicorn directly (more control over options)
554
+ uvicorn zebra_day.web.app:create_app --host 0.0.0.0 --port 8118 --factory
555
+ ```
556
+
557
+ ### Modern vs Legacy UI
558
+
559
+ zebra_day 0.6.0+ includes a redesigned modern UI alongside the preserved legacy interface:
560
+
561
+ | Interface | URL | Description |
562
+ |-----------|-----|-------------|
563
+ | **Modern UI** | `https://localhost:8118/` | New dashboard with stats, quick actions, improved navigation |
564
+ | **Legacy UI** | `https://localhost:8118/legacy` | Original interface, fully functional |
565
+ | **API Docs** | `https://localhost:8118/docs` | Interactive OpenAPI/Swagger documentation |
566
+ | **ReDoc** | `https://localhost:8118/redoc` | Alternative API documentation |
567
+
568
+ > **Note:** Use `http://` instead of `https://` if running without certificates (`--no-https`).
569
+
570
+ Both interfaces provide full functionality. The modern UI offers:
571
+ - Dashboard with printer fleet statistics
572
+ - Streamlined navigation
573
+ - Improved template editor
574
+ - Better mobile responsiveness
575
+
576
+ ### Print via HTTP API
577
+
578
+ ```http
579
+ http://YOUR.HOST.IP.ADDR:8118/_print_label?lab=scan-results&printer=192.168.1.7&label_zpl_style=test_2inX1in&uid_barcode=123aUID
580
+ ```
581
+
582
+ * See the [Web UI Guide](zebra_day/docs/zebra_day_ui_guide.md) for full details.
583
+
584
+ ### [Web UI Guide](zebra_day/docs/zebra_day_ui_guide.md)
585
+
586
+
587
+ <br><br>
588
+
589
+ </ul>
590
+ <img src=zebra_day/imgs/bar_red.png>
591
+
592
+ # Other Topics
593
+
594
+ ## Security
595
+
596
+ ### Authentication
597
+
598
+ zebra_day supports optional AWS Cognito authentication for production deployments.
599
+
600
+ #### Enabling Cognito Authentication
601
+
602
+ 1. **Install auth dependencies**:
603
+ ```bash
604
+ pip install -e ".[auth]"
605
+ ```
606
+
607
+ 2. **Set required environment variables**:
608
+ ```bash
609
+ export COGNITO_USER_POOL_ID="us-west-2_XXXXXXXXX"
610
+ export COGNITO_APP_CLIENT_ID="your-app-client-id"
611
+ export COGNITO_REGION="us-west-2" # Optional, defaults to us-west-2
612
+ export AWS_PROFILE="your-profile" # Optional, for local development
613
+ ```
614
+
615
+ 3. **Start server with authentication**:
616
+ ```bash
617
+ zday gui start --auth cognito
618
+
619
+ # Check auth status
620
+ zday cognito status
621
+ ```
622
+
623
+ #### Authentication Modes
624
+
625
+ | Mode | CLI Flag | Description |
626
+ |------|----------|-------------|
627
+ | None (default) | `--auth none` | No authentication required. All endpoints are publicly accessible. |
628
+ | Cognito | `--auth cognito` | AWS Cognito JWT authentication. All endpoints except health checks require a valid Bearer token. |
629
+
630
+ #### Protected Endpoints
631
+
632
+ When `--auth cognito` is enabled:
633
+ - All UI and API endpoints require a valid JWT Bearer token
634
+ - Health endpoints (`/healthz`, `/readyz`) remain publicly accessible
635
+ - Static files (`/static/*`, `/files/*`, `/etc/*`) remain publicly accessible
636
+ - API documentation (`/docs`, `/redoc`, `/openapi.json`) remains accessible
637
+
638
+ #### Making Authenticated Requests
639
+
640
+ Include the JWT token in the Authorization header:
641
+ ```bash
642
+ curl -H "Authorization: Bearer YOUR_JWT_TOKEN" https://localhost:8118/api/v1/printers
643
+ ```
644
+
645
+ ### Secrets
646
+ No credentials of any kind are stored or used by `zebra_day`. It solely offers zebra printer management and label print request formatting and brokering services. It does not need to know how to connect to other systems, other systems will use the library code provided here, or the http api.
647
+
648
+ ### Host and Network Security
649
+ In it's present state, `zebra_day` is safe to run on a machine located in a properly configured & secure local network or cloud hosted instance residing in a secure VPN/VPC.
650
+ * `zebra_day` should not be deployed in such a way the host is fully visible to the public internet.
651
+ * a potential exception would be exposing the service via an encryped and secure open port. __POC demonstrating this concept can be found below__.
652
+
653
+ ### Programatic Use Of `zebra_day` Package/Library
654
+ Using the python library in other python code poses no particularly unique new risk. `zebra_day` may be treated similarly to how other third party tools are handled in each users organization.
655
+
656
+ ## Regulatory & Compliance
657
+ ### HIPAA / CAP / CLIA
658
+ No PHI is needed by `zebra_day` to function. PHI may be sent in print rquests, each organization will have their own use cases. `zebra_day` does not store any of the print request metadata sent to it, the info is redirected to the appropriate zebra printer, and that is that. It is straightforward when setting up the host machine/environment this package will be running in to check off the various HIPAA and CAP/CLIA expectations where they apply.
659
+
660
+
661
+
662
+
663
+
664
+ # A Few Integration Demonstrations
665
+
666
+ # Send Label Print Requests From Public Internet To Host PC w/In Your Private Network
667
+
668
+ ## Ditch The Private Local Network & Expose Server Publicly ( not advised )
669
+ really
670
+
671
+ ## Using NGROK To Present A Tunneled Port Connected To The `zebra_day` Host Port (up and running in <5 min!)
672
+
673
+ * Create a tunnel to connect to the zebra_day service running on a machine within your network on port 8118. This could be a cloud instance w/in a VPC you control, or a machine physically present w/in your network.
674
+
675
+ * [NGROK DOCS]( https://dashboard.ngrok.com/get-started/setup/macos)
676
+
677
+ ### Install ngrok
678
+
679
+ ```bash
680
+ brew install ngrok/ngrok/ngrok
681
+ ngrok config add-authtoken MYTOKEN # you get this once registered (its free!)
682
+ ```
683
+
684
+ ### Running ngrok
685
+ ```bash
686
+ ngrok http 8118
687
+ ```
688
+
689
+ Which starts a tunnel and presents a monitoring dashboard. And it looks like this:
690
+ <pre>
691
+ ngrok (Ctrl+C to quit)
692
+
693
+ Introducing Always-On Global Server Load Balancer: https://ngrok.com/r/gslb
694
+
695
+ Session Status online
696
+ Account USERNAME (Plan: Free)
697
+ Version 3.3.5
698
+ Region United States (California) (us-cal-1)
699
+ Latency 12ms
700
+ Web Interface http://127.0.0.1:4040
701
+ Forwarding https://dfbf-23-93-175-197.ngrok-free.app -> http://localhost:8118
702
+
703
+ Connections ttl opn rt1 rt5 p50 p90
704
+ 8 0 0.00 0.01 10.03 28.05
705
+
706
+ HTTP Requests
707
+ -------------
708
+
709
+ GET /_print_label 200 OK
710
+ GET /_print_label 200 OK
711
+ GET /build_print_request 200 OK
712
+ GET /send_print_request 200 OK
713
+ GET / 200 OK
714
+ GET /_print_label 200 OK
715
+ GET /_print_label 200 OK
716
+ GET /build_print_request 200 OK
717
+ GET /send_print_request 200 OK
718
+ GET /favicon.ico 200 OK ~
719
+ </pre>
720
+
721
+ And looks like:
722
+ <img src=zebra_day/imgs/ngrok.png>
723
+
724
+ * If you leave the ngrok tunnel running, go to a different network, you can use the link named in the `Forwarding` row above to access the zebra_day UI, in the above example, this url would be `https://dfbf-23-93-175-197.ngrok-free.app`.
725
+
726
+ #### Sending Label Print Requests
727
+ ##### from a web browser on a different network
728
+
729
+ `https://dfbf-23-93-175-197.ngrok-free.app/_print_label?uid_barcode=UID33344455&alt_a=altTEXTAA&alt_b=altTEXTBB&alt_c=altTEXTCC&alt_d=&alt_e=&alt_f=&lab=scan-results&printer=192.168.1.20&printer_ip=192.168.1.20&label_zpl_style=tube_2inX1in`
730
+
731
+ ##### Using wget from a shell on a machine outside your local network
732
+ ```bash
733
+ wget "https://dfbf-23-93-175-197.ngrok-free.app/_print_label?uid_barcode=UID33344455&alt_a=altTEXTAA&alt_b=altTEXTBB&alt_c=altTEXTCC&alt_d=&alt_e=&alt_f=&lab=scan-results&printer=192.168.1.20&printer_ip=192.168.1.20&label_zpl_style=tube_2inX1in"
734
+ ```
735
+
736
+ ### From SalesForce
737
+
738
+ * There are several ways to do this, but they all boil down to somehow formulating a URL for each print request, ie: `https://dfbf-23-93-175-197.ngrok-free.app/_print_label?uid_barcode=UID33344455&lab=scan-results&printer=192.168.1.20&label_zpl_style=tube_2inX1in`, and hitting the URL via Apex, Flow, etc.
739
+ * To send a print request, you will need to know the API url, and the `lab`, `printer_name`, and `label_zpl_style` you wish to print the salesforce `Name` aka `UID` as a label. This example explains how to pass just one variable to print from salesforce, adding additional metadata to print involves adding additional params to the url being constructed.
740
+
741
+
742
+ #### Print Upon Object Creation (Apex Class + Flow)
743
+
744
+ > The following is a very quick prof of concept to see it work(success!). I fully expect there are more robust ways to reach this goal.
745
+
746
+ Create an Apex class to handle sending HTTP requests.
747
+
748
+ * Setup->Apex Classes, create new Apex Class, save the following as the Apex Class:
749
+
750
+ ```java
751
+ public class HttpRequestFlowAction {
752
+
753
+ public class RequestInput {
754
+ @InvocableVariable(label='Endpoint URL' required=true)
755
+ public String url;
756
+
757
+ // Add other variables as needed, e.g. headers, body, method, etc.
758
+ }
759
+
760
+ @InvocableMethod(label='Make HTTP Request' description='Makes an HTTP request from a Flow.')
761
+ public static List<String> makeHttpRequest(List<RequestInput> requests) {
762
+ List<String> responses = new List<String>();
763
+
764
+ for(RequestInput req : requests) {
765
+ Http http = new Http();
766
+ HttpRequest request = new HttpRequest();
767
+ request.setEndpoint(req.url);
768
+ request.setMethod('GET'); // Change method as needed: POST, PUT, etc.
769
+
770
+ // Add headers, body, etc. if needed.
771
+
772
+ HttpResponse response = http.send(request);
773
+ responses.add(response.getBody());
774
+ }
775
+
776
+ return responses;
777
+ }
778
+ }
779
+ ```
780
+
781
+ * click save, the apex class is now ready. Check the security settings and verify the profile associated with your user has access to see/use this class.
782
+
783
+ Next, create a flow which uses this Apex Class.
784
+
785
+ * setup->Flow & click `New Flow`. I remained in the `Auto Layout` view.
786
+ * Choose `Record-Triggered Flow`
787
+ * Select the object type the flow will be triggered when an instance of this object type is created.
788
+ * Select 'A record is created` as the trigger.
789
+ * Set Entry Conditions (this might be unecessary), `Any Condition Is Met`, Field `Name`, Operator `Starts with`, Value `X`(X being the first letter of the Name field UID salesforce creates for this object. Again, this is probably not needed, but I have not gone back to try w/out this step).
790
+ * Choose `Actions and Related Records`, and check the box at the bottom of the page to `Include a Run Asynchronously path...`
791
+ * upon clicking this box, the graphic representation of the flow to the left of the page will now have 2 branches at the bottom of the flow rule, one `Run Immediately` and one `Run Asynchronously`. The `Run Immediately` branch was throwing errors, so I removed it to debug at a latter date.
792
+ * Click the node just below the `Run Asynch` oval. Add an `Action`. Select the `Make HTTP Request` we created via the Apex Class above. Give it a `Label`, let the API Name auto generate.
793
+ * In the `Endpoint URL` field, enter the url `https://dfbf-23-93-175-197.ngrok-free.app/_print_label?uid_barcode={!$Record.Name}&lab=scan-results&printer=!!YOURPRINTERIP!!&label_zpl_style=tube_2inX1in`, where Record.Name will be replaced with the Object.Name from the object triggering the flow. Replace !!YOURPRINTERIP!! with one of the printer IPs zebra_day detected above. If you are using the auto-generated zebra printers config json file, you may leave `scan-results` as the value for `lab=` as this will be the default name given when zebra_day autodetects printers.
794
+ * add the same HTTPrequest action to the node just below `Run Immediately`.
795
+ * click `Save` in the upper right corner of the page. Give it a name
796
+ * Click `Debug Again`, run the `Run Immediately` branch first. This will fail.
797
+ * You need to whitelist the URL used by Apex in this flow with Salesforce. To do this: Setup->Remote Site Settings, click `New Remote Site`. Give it a name, and enter your ngrok URL up to the `.app`, so: `https://dfbf-23-93-175-197.ngrok-free.app`. Click the `active` checkbox and then save.
798
+ * CLick `Debug Again`, run the `Asyncronous` branch, this should succeed.
799
+ * Click `Save As`, new version.
800
+ * Click `Activate`
801
+ * Go create one of the objects you made this flow for. This will fail!
802
+ * Go back to your flow, click `edit flow`, switch from `Auto Layout` to `Freeform` view.
803
+ * Click the connector labeled `Run Immediately`, delete it (leave the Async branch intact)
804
+ * Click `Save As`, new version.
805
+ * Click `Activate`
806
+ * Go create a new object of the type this trigger is built to respond to... it should print, and should do so each time a new object is created.
807
+ * This toy example is intended to demonstrate this can work. Next, you should determine how you'd like to send print requests that best suits your needs.
808
+
809
+ > This was all rather a PITA honestly.
810
+
811
+ ###### Create a Formula Text Field For Objects
812
+ You can construct the print URL in the formula, and this formula field can be presented on the object salesforce page. If the user clicks the URL on the page, a print request is sent containing the data inserted by the formula for the current object.
813
+
814
+
815
+ ## Host Machine Options
816
+ ### Machine physically connected to your local network.
817
+ This is covered in the config and setup/install instructions above.
818
+
819
+ ### AWS
820
+ #### ec2 instance
821
+ more info coming soon. The instructions for getting the package s/w up and running is largely the same as above. However, care must be taken when configuring the network and instances which will be used at amazon.
822
+
823
+ ##### From AMI?
824
+
825
+
826
+ ## Other Providers
827
+ If it will work on AWS, it will work anyplace really (with some provider specific tweaks).
828
+
829
+ ## Docker
830
+ Find an example in the docker folder at the top level of this project. Copy the Dockerfile and the docker-compose.yml to a local folder on your computer.
831
+ In that folder, `mkdir etc && chmod 777 etc && mkdir logs && chmod 777 logs` to setup the example folders.
832
+ Tthen run `sudo docker compose up --build -d` to run it then reach it at http://<your-ip>:8118. This doesn't auto-detect printers so you'll have to run the printer discovery and probably manually edit your JSON file.
833
+
834
+ # Add'l Future Development
835
+
836
+ * Set varios printer config via ZPL commands (presently this package only fetches config).
837
+
838
+
839
+ # BadgeLand
840
+
841
+ [![Python CI](https://github.com/Daylily-Informatics/zebra_day/actions/workflows/main.yaml/badge.svg)](https://github.com/Daylily-Informatics/zebra_day/actions/workflows/main.yaml)
842
+
843
+ <br>
844
+
845
+
846
+
847
+