bitswan 2024.4__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 (625) hide show
  1. bitswan-2024.4/.coveragerc +5 -0
  2. bitswan-2024.4/.github/workflows/docker-publish.yml +31 -0
  3. bitswan-2024.4/.github/workflows/test.yml +36 -0
  4. bitswan-2024.4/.gitignore +118 -0
  5. bitswan-2024.4/.gitlab-ci.yml +23 -0
  6. bitswan-2024.4/Dockerfile +40 -0
  7. bitswan-2024.4/LICENSE +29 -0
  8. bitswan-2024.4/MANIFEST.in +1 -0
  9. bitswan-2024.4/PKG-INFO +148 -0
  10. bitswan-2024.4/README.md +70 -0
  11. bitswan-2024.4/bitswan/__init__.py +54 -0
  12. bitswan-2024.4/bitswan/__main__.py +4 -0
  13. bitswan-2024.4/bitswan/__version__.py +12 -0
  14. bitswan-2024.4/bitswan/abc/__init__.py +0 -0
  15. bitswan-2024.4/bitswan/abc/anomaly.py +41 -0
  16. bitswan-2024.4/bitswan/abc/connection.py +71 -0
  17. bitswan-2024.4/bitswan/abc/generator.py +81 -0
  18. bitswan-2024.4/bitswan/abc/lookup.py +307 -0
  19. bitswan-2024.4/bitswan/abc/lookupprovider.py +46 -0
  20. bitswan-2024.4/bitswan/abc/processor.py +136 -0
  21. bitswan-2024.4/bitswan/abc/sink.py +12 -0
  22. bitswan-2024.4/bitswan/abc/source.py +356 -0
  23. bitswan-2024.4/bitswan/aggregation/__init__.py +5 -0
  24. bitswan-2024.4/bitswan/aggregation/hyperloglog.py +125 -0
  25. bitswan-2024.4/bitswan/aio/__init__.py +6 -0
  26. bitswan-2024.4/bitswan/aio/sink.py +70 -0
  27. bitswan-2024.4/bitswan/amqp/__init__.py +10 -0
  28. bitswan-2024.4/bitswan/amqp/connection.py +73 -0
  29. bitswan-2024.4/bitswan/amqp/sink.py +79 -0
  30. bitswan-2024.4/bitswan/amqp/source.py +144 -0
  31. bitswan-2024.4/bitswan/analyzer/__init__.py +20 -0
  32. bitswan-2024.4/bitswan/analyzer/analyzer.py +112 -0
  33. bitswan-2024.4/bitswan/analyzer/analyzingsource.py +49 -0
  34. bitswan-2024.4/bitswan/analyzer/geoanalyzer.py +98 -0
  35. bitswan-2024.4/bitswan/analyzer/latch.py +117 -0
  36. bitswan-2024.4/bitswan/analyzer/sessionanalyzer.py +102 -0
  37. bitswan-2024.4/bitswan/analyzer/threshold.py +208 -0
  38. bitswan-2024.4/bitswan/analyzer/timedriftanalyzer.py +164 -0
  39. bitswan-2024.4/bitswan/analyzer/timewindowanalyzer.py +83 -0
  40. bitswan-2024.4/bitswan/anomaly/__init__.py +12 -0
  41. bitswan-2024.4/bitswan/anomaly/analyzer.py +100 -0
  42. bitswan-2024.4/bitswan/anomaly/generalanomaly.py +57 -0
  43. bitswan-2024.4/bitswan/anomaly/manager.py +117 -0
  44. bitswan-2024.4/bitswan/anomaly/storage.py +219 -0
  45. bitswan-2024.4/bitswan/application.py +146 -0
  46. bitswan-2024.4/bitswan/asab/__init__.py +50 -0
  47. bitswan-2024.4/bitswan/asab/__version__.py +12 -0
  48. bitswan-2024.4/bitswan/asab/abc/__init__.py +9 -0
  49. bitswan-2024.4/bitswan/asab/abc/module.py +75 -0
  50. bitswan-2024.4/bitswan/asab/abc/service.py +81 -0
  51. bitswan-2024.4/bitswan/asab/abc/singleton.py +24 -0
  52. bitswan-2024.4/bitswan/asab/alert.py +258 -0
  53. bitswan-2024.4/bitswan/asab/api/__init__.py +5 -0
  54. bitswan-2024.4/bitswan/asab/api/discovery.py +179 -0
  55. bitswan-2024.4/bitswan/asab/api/doc.py +366 -0
  56. bitswan-2024.4/bitswan/asab/api/doc_templates.py +109 -0
  57. bitswan-2024.4/bitswan/asab/api/log.py +161 -0
  58. bitswan-2024.4/bitswan/asab/api/service.py +235 -0
  59. bitswan-2024.4/bitswan/asab/api/web_handler.py +127 -0
  60. bitswan-2024.4/bitswan/asab/application.py +869 -0
  61. bitswan-2024.4/bitswan/asab/config.py +566 -0
  62. bitswan-2024.4/bitswan/asab/exceptions.py +54 -0
  63. bitswan-2024.4/bitswan/asab/library/__init__.py +16 -0
  64. bitswan-2024.4/bitswan/asab/library/dirsync.py +63 -0
  65. bitswan-2024.4/bitswan/asab/library/item.py +23 -0
  66. bitswan-2024.4/bitswan/asab/library/providers/__init__.py +0 -0
  67. bitswan-2024.4/bitswan/asab/library/providers/abc.py +49 -0
  68. bitswan-2024.4/bitswan/asab/library/providers/azurestorage.py +256 -0
  69. bitswan-2024.4/bitswan/asab/library/providers/filesystem.py +221 -0
  70. bitswan-2024.4/bitswan/asab/library/providers/filesystem_inotify.py +53 -0
  71. bitswan-2024.4/bitswan/asab/library/providers/git.py +217 -0
  72. bitswan-2024.4/bitswan/asab/library/providers/libsreg.py +176 -0
  73. bitswan-2024.4/bitswan/asab/library/providers/zookeeper.py +366 -0
  74. bitswan-2024.4/bitswan/asab/library/service.py +496 -0
  75. bitswan-2024.4/bitswan/asab/log.py +617 -0
  76. bitswan-2024.4/bitswan/asab/metrics/__init__.py +43 -0
  77. bitswan-2024.4/bitswan/asab/metrics/http.py +29 -0
  78. bitswan-2024.4/bitswan/asab/metrics/influxdb.py +308 -0
  79. bitswan-2024.4/bitswan/asab/metrics/metrics.py +606 -0
  80. bitswan-2024.4/bitswan/asab/metrics/native.py +66 -0
  81. bitswan-2024.4/bitswan/asab/metrics/openmetric.py +165 -0
  82. bitswan-2024.4/bitswan/asab/metrics/service.py +411 -0
  83. bitswan-2024.4/bitswan/asab/metrics/storage.py +48 -0
  84. bitswan-2024.4/bitswan/asab/metrics/web_handler.py +292 -0
  85. bitswan-2024.4/bitswan/asab/pdict.py +93 -0
  86. bitswan-2024.4/bitswan/asab/proactor/__init__.py +32 -0
  87. bitswan-2024.4/bitswan/asab/proactor/service.py +47 -0
  88. bitswan-2024.4/bitswan/asab/pubsub.py +357 -0
  89. bitswan-2024.4/bitswan/asab/sentry/__init__.py +15 -0
  90. bitswan-2024.4/bitswan/asab/sentry/service.py +300 -0
  91. bitswan-2024.4/bitswan/asab/socket.py +38 -0
  92. bitswan-2024.4/bitswan/asab/storage/__init__.py +39 -0
  93. bitswan-2024.4/bitswan/asab/storage/elasticsearch.py +621 -0
  94. bitswan-2024.4/bitswan/asab/storage/exceptions.py +9 -0
  95. bitswan-2024.4/bitswan/asab/storage/inmemory.py +151 -0
  96. bitswan-2024.4/bitswan/asab/storage/mongodb.py +211 -0
  97. bitswan-2024.4/bitswan/asab/storage/service.py +233 -0
  98. bitswan-2024.4/bitswan/asab/storage/upsertor.py +177 -0
  99. bitswan-2024.4/bitswan/asab/task.py +142 -0
  100. bitswan-2024.4/bitswan/asab/timer.py +97 -0
  101. bitswan-2024.4/bitswan/asab/tls.py +104 -0
  102. bitswan-2024.4/bitswan/asab/utils.py +205 -0
  103. bitswan-2024.4/bitswan/asab/web/__init__.py +63 -0
  104. bitswan-2024.4/bitswan/asab/web/accesslog.py +54 -0
  105. bitswan-2024.4/bitswan/asab/web/auth/__init__.py +8 -0
  106. bitswan-2024.4/bitswan/asab/web/auth/decorator.py +82 -0
  107. bitswan-2024.4/bitswan/asab/web/auth/service.py +607 -0
  108. bitswan-2024.4/bitswan/asab/web/authz/__init__.py +12 -0
  109. bitswan-2024.4/bitswan/asab/web/authz/decorator.py +118 -0
  110. bitswan-2024.4/bitswan/asab/web/authz/middleware.py +19 -0
  111. bitswan-2024.4/bitswan/asab/web/authz/service.py +228 -0
  112. bitswan-2024.4/bitswan/asab/web/container.py +238 -0
  113. bitswan-2024.4/bitswan/asab/web/metrics.py +51 -0
  114. bitswan-2024.4/bitswan/asab/web/rest/__init__.py +8 -0
  115. bitswan-2024.4/bitswan/asab/web/rest/json.py +329 -0
  116. bitswan-2024.4/bitswan/asab/web/service.py +88 -0
  117. bitswan-2024.4/bitswan/asab/web/session/__init__.py +54 -0
  118. bitswan-2024.4/bitswan/asab/web/session/cookies.py +37 -0
  119. bitswan-2024.4/bitswan/asab/web/session/inmemstor.py +60 -0
  120. bitswan-2024.4/bitswan/asab/web/session/session.py +81 -0
  121. bitswan-2024.4/bitswan/asab/web/session/storage.py +40 -0
  122. bitswan-2024.4/bitswan/asab/web/staticdir.py +33 -0
  123. bitswan-2024.4/bitswan/asab/web/tenant/__init__.py +9 -0
  124. bitswan-2024.4/bitswan/asab/web/tenant/midleware.py +44 -0
  125. bitswan-2024.4/bitswan/asab/web/tenant/service.py +93 -0
  126. bitswan-2024.4/bitswan/asab/web/tenant/web.py +13 -0
  127. bitswan-2024.4/bitswan/asab/web/webcrypto.py +103 -0
  128. bitswan-2024.4/bitswan/asab/web/websocket.py +156 -0
  129. bitswan-2024.4/bitswan/asab/zookeeper/__init__.py +17 -0
  130. bitswan-2024.4/bitswan/asab/zookeeper/container.py +259 -0
  131. bitswan-2024.4/bitswan/asab/zookeeper/service.py +28 -0
  132. bitswan-2024.4/bitswan/asab/zookeeper/wrapper.py +110 -0
  133. bitswan-2024.4/bitswan/avro/__init__.py +11 -0
  134. bitswan-2024.4/bitswan/avro/deserializer.py +34 -0
  135. bitswan-2024.4/bitswan/avro/loader.py +28 -0
  136. bitswan-2024.4/bitswan/avro/serializer.py +56 -0
  137. bitswan-2024.4/bitswan/avro/sink.py +140 -0
  138. bitswan-2024.4/bitswan/avro/source.py +34 -0
  139. bitswan-2024.4/bitswan/cache/__init__.py +7 -0
  140. bitswan-2024.4/bitswan/cache/cachedict.py +2 -0
  141. bitswan-2024.4/bitswan/cache/lrucachedict.py +58 -0
  142. bitswan-2024.4/bitswan/common/__init__.py +76 -0
  143. bitswan-2024.4/bitswan/common/aggregator.py +339 -0
  144. bitswan-2024.4/bitswan/common/bytes.py +74 -0
  145. bitswan-2024.4/bitswan/common/flatten.py +100 -0
  146. bitswan-2024.4/bitswan/common/hexlify.py +23 -0
  147. bitswan-2024.4/bitswan/common/iterator.py +57 -0
  148. bitswan-2024.4/bitswan/common/jq.py +77 -0
  149. bitswan-2024.4/bitswan/common/json.py +78 -0
  150. bitswan-2024.4/bitswan/common/jsonbytes.py +27 -0
  151. bitswan-2024.4/bitswan/common/mapping.py +119 -0
  152. bitswan-2024.4/bitswan/common/null.py +19 -0
  153. bitswan-2024.4/bitswan/common/print.py +182 -0
  154. bitswan-2024.4/bitswan/common/routing.py +404 -0
  155. bitswan-2024.4/bitswan/common/tee.py +161 -0
  156. bitswan-2024.4/bitswan/common/time.py +57 -0
  157. bitswan-2024.4/bitswan/common/transfr.py +61 -0
  158. bitswan-2024.4/bitswan/crypto/__init__.py +17 -0
  159. bitswan-2024.4/bitswan/crypto/aes.py +47 -0
  160. bitswan-2024.4/bitswan/crypto/hashing.py +73 -0
  161. bitswan-2024.4/bitswan/declarative/__init__.py +39 -0
  162. bitswan-2024.4/bitswan/declarative/abc.py +154 -0
  163. bitswan-2024.4/bitswan/declarative/builder.py +334 -0
  164. bitswan-2024.4/bitswan/declarative/declerror.py +16 -0
  165. bitswan-2024.4/bitswan/declarative/dot.py +68 -0
  166. bitswan-2024.4/bitswan/declarative/expression/__init__.py +157 -0
  167. bitswan-2024.4/bitswan/declarative/expression/arithmetic.py +214 -0
  168. bitswan-2024.4/bitswan/declarative/expression/comparison.py +264 -0
  169. bitswan-2024.4/bitswan/declarative/expression/datastructs/__init__.py +0 -0
  170. bitswan-2024.4/bitswan/declarative/expression/datastructs/dict_parse.py +122 -0
  171. bitswan-2024.4/bitswan/declarative/expression/datastructs/dictexpr.py +208 -0
  172. bitswan-2024.4/bitswan/declarative/expression/datastructs/itemexpr.py +212 -0
  173. bitswan-2024.4/bitswan/declarative/expression/datastructs/listexpr.py +31 -0
  174. bitswan-2024.4/bitswan/declarative/expression/datastructs/tupleexpr.py +12 -0
  175. bitswan-2024.4/bitswan/declarative/expression/datetime/__init__.py +0 -0
  176. bitswan-2024.4/bitswan/declarative/expression/datetime/dtformat.py +53 -0
  177. bitswan-2024.4/bitswan/declarative/expression/datetime/dtget.py +72 -0
  178. bitswan-2024.4/bitswan/declarative/expression/datetime/dtparse.py +80 -0
  179. bitswan-2024.4/bitswan/declarative/expression/datetime/nowexpr.py +33 -0
  180. bitswan-2024.4/bitswan/declarative/expression/ip/__init__.py +0 -0
  181. bitswan-2024.4/bitswan/declarative/expression/ip/insubnetexpr.py +50 -0
  182. bitswan-2024.4/bitswan/declarative/expression/ip/ipformatexpr.py +42 -0
  183. bitswan-2024.4/bitswan/declarative/expression/ip/ipparseexpr.py +32 -0
  184. bitswan-2024.4/bitswan/declarative/expression/logical.py +89 -0
  185. bitswan-2024.4/bitswan/declarative/expression/lookup/__init__.py +0 -0
  186. bitswan-2024.4/bitswan/declarative/expression/lookup/lookupexpr.py +48 -0
  187. bitswan-2024.4/bitswan/declarative/expression/statement/__init__.py +0 -0
  188. bitswan-2024.4/bitswan/declarative/expression/statement/firstexpr.py +11 -0
  189. bitswan-2024.4/bitswan/declarative/expression/statement/forexpr.py +21 -0
  190. bitswan-2024.4/bitswan/declarative/expression/statement/funexpr.py +30 -0
  191. bitswan-2024.4/bitswan/declarative/expression/statement/ifexpr.py +52 -0
  192. bitswan-2024.4/bitswan/declarative/expression/statement/selfexpr.py +31 -0
  193. bitswan-2024.4/bitswan/declarative/expression/statement/whenexpr.py +109 -0
  194. bitswan-2024.4/bitswan/declarative/expression/string/__init__.py +0 -0
  195. bitswan-2024.4/bitswan/declarative/expression/string/contains.py +34 -0
  196. bitswan-2024.4/bitswan/declarative/expression/string/cutexpr.py +51 -0
  197. bitswan-2024.4/bitswan/declarative/expression/string/endswith.py +34 -0
  198. bitswan-2024.4/bitswan/declarative/expression/string/joinexpr.py +78 -0
  199. bitswan-2024.4/bitswan/declarative/expression/string/lowerexpr.py +25 -0
  200. bitswan-2024.4/bitswan/declarative/expression/string/regex.py +270 -0
  201. bitswan-2024.4/bitswan/declarative/expression/string/split.py +41 -0
  202. bitswan-2024.4/bitswan/declarative/expression/string/startswith.py +38 -0
  203. bitswan-2024.4/bitswan/declarative/expression/string/substringexpr.py +48 -0
  204. bitswan-2024.4/bitswan/declarative/expression/string/upperexpr.py +25 -0
  205. bitswan-2024.4/bitswan/declarative/expression/test/__init__.py +0 -0
  206. bitswan-2024.4/bitswan/declarative/expression/test/inexpr.py +112 -0
  207. bitswan-2024.4/bitswan/declarative/expression/utility/__init__.py +0 -0
  208. bitswan-2024.4/bitswan/declarative/expression/utility/castexpr.py +90 -0
  209. bitswan-2024.4/bitswan/declarative/expression/utility/context.py +80 -0
  210. bitswan-2024.4/bitswan/declarative/expression/utility/debugexpr.py +25 -0
  211. bitswan-2024.4/bitswan/declarative/expression/utility/hashexpr.py +92 -0
  212. bitswan-2024.4/bitswan/declarative/expression/utility/mapexpr.py +66 -0
  213. bitswan-2024.4/bitswan/declarative/expression/value/__init__.py +0 -0
  214. bitswan-2024.4/bitswan/declarative/expression/value/eventexpr.py +94 -0
  215. bitswan-2024.4/bitswan/declarative/expression/value/valueexpr.py +27 -0
  216. bitswan-2024.4/bitswan/declarative/generator.py +51 -0
  217. bitswan-2024.4/bitswan/declarative/optimizer.py +65 -0
  218. bitswan-2024.4/bitswan/declarative/processor.py +34 -0
  219. bitswan-2024.4/bitswan/declarative/segmentbuilder.py +159 -0
  220. bitswan-2024.4/bitswan/declarative/timewindowanalyzer.py +115 -0
  221. bitswan-2024.4/bitswan/elasticsearch/__init__.py +12 -0
  222. bitswan-2024.4/bitswan/elasticsearch/connection.py +560 -0
  223. bitswan-2024.4/bitswan/elasticsearch/data_feeder.py +107 -0
  224. bitswan-2024.4/bitswan/elasticsearch/lookup.py +307 -0
  225. bitswan-2024.4/bitswan/elasticsearch/sink.py +153 -0
  226. bitswan-2024.4/bitswan/elasticsearch/source.py +241 -0
  227. bitswan-2024.4/bitswan/exception.py +6 -0
  228. bitswan-2024.4/bitswan/file/__init__.py +19 -0
  229. bitswan-2024.4/bitswan/file/fileabcsource.py +384 -0
  230. bitswan-2024.4/bitswan/file/fileblocksink.py +93 -0
  231. bitswan-2024.4/bitswan/file/fileblocksource.py +59 -0
  232. bitswan-2024.4/bitswan/file/filecsvsink.py +146 -0
  233. bitswan-2024.4/bitswan/file/filecsvsource.py +103 -0
  234. bitswan-2024.4/bitswan/file/filejsonsource.py +52 -0
  235. bitswan-2024.4/bitswan/file/filelinesource.py +133 -0
  236. bitswan-2024.4/bitswan/file/globscan.py +127 -0
  237. bitswan-2024.4/bitswan/file/lookupprovider.py +75 -0
  238. bitswan-2024.4/bitswan/fileloader.py +25 -0
  239. bitswan-2024.4/bitswan/filter/__init__.py +9 -0
  240. bitswan-2024.4/bitswan/filter/attributefilter.py +49 -0
  241. bitswan-2024.4/bitswan/filter/contentfilter.py +64 -0
  242. bitswan-2024.4/bitswan/filter/timedriftfilter.py +53 -0
  243. bitswan-2024.4/bitswan/ftp/__init__.py +7 -0
  244. bitswan-2024.4/bitswan/ftp/connection.py +59 -0
  245. bitswan-2024.4/bitswan/ftp/source.py +132 -0
  246. bitswan-2024.4/bitswan/googledrive/__init__.py +10 -0
  247. bitswan-2024.4/bitswan/googledrive/abcsink.py +72 -0
  248. bitswan-2024.4/bitswan/googledrive/blocksink.py +61 -0
  249. bitswan-2024.4/bitswan/googledrive/connection.py +70 -0
  250. bitswan-2024.4/bitswan/http/__init__.py +19 -0
  251. bitswan-2024.4/bitswan/http/client/__init__.py +0 -0
  252. bitswan-2024.4/bitswan/http/client/abcsource.py +100 -0
  253. bitswan-2024.4/bitswan/http/client/source.py +32 -0
  254. bitswan-2024.4/bitswan/http/client/wssink.py +130 -0
  255. bitswan-2024.4/bitswan/http/lookupprovider.py +152 -0
  256. bitswan-2024.4/bitswan/http/web/__init__.py +0 -0
  257. bitswan-2024.4/bitswan/http/web/server.py +586 -0
  258. bitswan-2024.4/bitswan/http/web/sink.py +93 -0
  259. bitswan-2024.4/bitswan/http/web/source.py +137 -0
  260. bitswan-2024.4/bitswan/http/web/wssource.py +57 -0
  261. bitswan-2024.4/bitswan/influxdb/__init__.py +7 -0
  262. bitswan-2024.4/bitswan/influxdb/connection.py +218 -0
  263. bitswan-2024.4/bitswan/influxdb/sink.py +99 -0
  264. bitswan-2024.4/bitswan/integrity/__init__.py +5 -0
  265. bitswan-2024.4/bitswan/integrity/integrityenricher.py +77 -0
  266. bitswan-2024.4/bitswan/ipc/__init__.py +19 -0
  267. bitswan-2024.4/bitswan/ipc/datagram.py +171 -0
  268. bitswan-2024.4/bitswan/ipc/protocol.py +115 -0
  269. bitswan-2024.4/bitswan/ipc/stream.py +166 -0
  270. bitswan-2024.4/bitswan/ipc/stream_client_sink.py +195 -0
  271. bitswan-2024.4/bitswan/ipc/stream_server_source.py +228 -0
  272. bitswan-2024.4/bitswan/jupyter/__init__.py +49 -0
  273. bitswan-2024.4/bitswan/jupyter/jupyter.py +648 -0
  274. bitswan-2024.4/bitswan/kafka/__init__.py +13 -0
  275. bitswan-2024.4/bitswan/kafka/batchsink.py +113 -0
  276. bitswan-2024.4/bitswan/kafka/connection.py +36 -0
  277. bitswan-2024.4/bitswan/kafka/keyfilter.py +53 -0
  278. bitswan-2024.4/bitswan/kafka/sink.py +128 -0
  279. bitswan-2024.4/bitswan/kafka/source.py +181 -0
  280. bitswan-2024.4/bitswan/kafka/topic_initializer.py +324 -0
  281. bitswan-2024.4/bitswan/ldap/__init__.py +7 -0
  282. bitswan-2024.4/bitswan/ldap/connection.py +110 -0
  283. bitswan-2024.4/bitswan/ldap/source.py +94 -0
  284. bitswan-2024.4/bitswan/lookup/__init__.py +12 -0
  285. bitswan-2024.4/bitswan/lookup/index.py +312 -0
  286. bitswan-2024.4/bitswan/lookup/ipgeolookup.py +155 -0
  287. bitswan-2024.4/bitswan/lookup/matrixlookup.py +110 -0
  288. bitswan-2024.4/bitswan/lookup/memcachedlookup.py +51 -0
  289. bitswan-2024.4/bitswan/mail/__init__.py +8 -0
  290. bitswan-2024.4/bitswan/mail/smtpconnection.py +111 -0
  291. bitswan-2024.4/bitswan/mail/smtpsink.py +25 -0
  292. bitswan-2024.4/bitswan/main.py +99 -0
  293. bitswan-2024.4/bitswan/matrix/__init__.py +26 -0
  294. bitswan-2024.4/bitswan/matrix/geomatrix.py +260 -0
  295. bitswan-2024.4/bitswan/matrix/matrix.py +247 -0
  296. bitswan-2024.4/bitswan/matrix/matrixexportcsvgenerator.py +70 -0
  297. bitswan-2024.4/bitswan/matrix/namedmatrix.py +165 -0
  298. bitswan-2024.4/bitswan/matrix/sessionmatrix.py +106 -0
  299. bitswan-2024.4/bitswan/matrix/source.py +19 -0
  300. bitswan-2024.4/bitswan/matrix/timewindowmatrix.py +482 -0
  301. bitswan-2024.4/bitswan/matrix/utils/__init__.py +16 -0
  302. bitswan-2024.4/bitswan/matrix/utils/closedrows.py +87 -0
  303. bitswan-2024.4/bitswan/matrix/utils/index.py +109 -0
  304. bitswan-2024.4/bitswan/matrix/utils/timeconfig.py +56 -0
  305. bitswan-2024.4/bitswan/matrix/utils/warmingupcount.py +60 -0
  306. bitswan-2024.4/bitswan/model/__init__.py +3 -0
  307. bitswan-2024.4/bitswan/model/model.py +61 -0
  308. bitswan-2024.4/bitswan/mongodb/__init__.py +13 -0
  309. bitswan-2024.4/bitswan/mongodb/changestreamsource.py +75 -0
  310. bitswan-2024.4/bitswan/mongodb/connection.py +95 -0
  311. bitswan-2024.4/bitswan/mongodb/lookup.py +212 -0
  312. bitswan-2024.4/bitswan/mongodb/sink.py +118 -0
  313. bitswan-2024.4/bitswan/mongodb/source.py +67 -0
  314. bitswan-2024.4/bitswan/mqtt/__init__.py +6 -0
  315. bitswan-2024.4/bitswan/mqtt/connection.py +63 -0
  316. bitswan-2024.4/bitswan/mqtt/service.py +221 -0
  317. bitswan-2024.4/bitswan/mqtt/sink.py +19 -0
  318. bitswan-2024.4/bitswan/mqtt/source.py +35 -0
  319. bitswan-2024.4/bitswan/mysql/__init__.py +12 -0
  320. bitswan-2024.4/bitswan/mysql/binlogsource.py +244 -0
  321. bitswan-2024.4/bitswan/mysql/connection.py +356 -0
  322. bitswan-2024.4/bitswan/mysql/convertors.py +32 -0
  323. bitswan-2024.4/bitswan/mysql/lookup.py +180 -0
  324. bitswan-2024.4/bitswan/mysql/sink.py +36 -0
  325. bitswan-2024.4/bitswan/mysql/source.py +56 -0
  326. bitswan-2024.4/bitswan/odbc/__init__.py +9 -0
  327. bitswan-2024.4/bitswan/odbc/connection.py +174 -0
  328. bitswan-2024.4/bitswan/odbc/sink.py +36 -0
  329. bitswan-2024.4/bitswan/odbc/source.py +36 -0
  330. bitswan-2024.4/bitswan/parquet/__init__.py +3 -0
  331. bitswan-2024.4/bitswan/parquet/sink.py +264 -0
  332. bitswan-2024.4/bitswan/pipeline.py +1025 -0
  333. bitswan-2024.4/bitswan/postgresql/__init__.py +13 -0
  334. bitswan-2024.4/bitswan/postgresql/connection.py +292 -0
  335. bitswan-2024.4/bitswan/postgresql/logicalreplicationsource.py +113 -0
  336. bitswan-2024.4/bitswan/postgresql/lookup.py +182 -0
  337. bitswan-2024.4/bitswan/postgresql/sink.py +36 -0
  338. bitswan-2024.4/bitswan/postgresql/source.py +52 -0
  339. bitswan-2024.4/bitswan/pumpbuilder.py +274 -0
  340. bitswan-2024.4/bitswan/random/__init__.py +10 -0
  341. bitswan-2024.4/bitswan/random/randomdrop.py +21 -0
  342. bitswan-2024.4/bitswan/random/randomenricher.py +41 -0
  343. bitswan-2024.4/bitswan/random/source.py +71 -0
  344. bitswan-2024.4/bitswan/service.py +374 -0
  345. bitswan-2024.4/bitswan/slack/__init__.py +10 -0
  346. bitswan-2024.4/bitswan/slack/connection.py +75 -0
  347. bitswan-2024.4/bitswan/slack/sink.py +57 -0
  348. bitswan-2024.4/bitswan/socket/__init__.py +15 -0
  349. bitswan-2024.4/bitswan/ssh/__init__.py +7 -0
  350. bitswan-2024.4/bitswan/ssh/connection.py +104 -0
  351. bitswan-2024.4/bitswan/ssh/sink.py +158 -0
  352. bitswan-2024.4/bitswan/subprocess/__init__.py +3 -0
  353. bitswan-2024.4/bitswan/subprocess/source.py +57 -0
  354. bitswan-2024.4/bitswan/test/__init__.py +9 -0
  355. bitswan-2024.4/bitswan/test/test.py +108 -0
  356. bitswan-2024.4/bitswan/test-data/globscan/1 +1 -0
  357. bitswan-2024.4/bitswan/test-data/globscan/2 +1 -0
  358. bitswan-2024.4/bitswan/test-data/globscan/3 +1 -0
  359. bitswan-2024.4/bitswan/test-data/globscan/4-locked +1 -0
  360. bitswan-2024.4/bitswan/test-data/globscan/5-failed +1 -0
  361. bitswan-2024.4/bitswan/test-data/globscan/6-processed +1 -0
  362. bitswan-2024.4/bitswan/timeseries/__init__.py +3 -0
  363. bitswan-2024.4/bitswan/timeseries/analyzer.py +92 -0
  364. bitswan-2024.4/bitswan/trigger/__init__.py +15 -0
  365. bitswan-2024.4/bitswan/trigger/crontrig.py +55 -0
  366. bitswan-2024.4/bitswan/trigger/opportunistic.py +44 -0
  367. bitswan-2024.4/bitswan/trigger/periodic.py +31 -0
  368. bitswan-2024.4/bitswan/trigger/pubsub.py +22 -0
  369. bitswan-2024.4/bitswan/trigger/runonce.py +21 -0
  370. bitswan-2024.4/bitswan/trigger/trigger.py +61 -0
  371. bitswan-2024.4/bitswan/unittest/__init__.py +13 -0
  372. bitswan-2024.4/bitswan/unittest/pipeline.py +39 -0
  373. bitswan-2024.4/bitswan/unittest/sink.py +10 -0
  374. bitswan-2024.4/bitswan/unittest/source.py +18 -0
  375. bitswan-2024.4/bitswan/unittest/unit_test_case.py +84 -0
  376. bitswan-2024.4/bitswan/watch.py +51 -0
  377. bitswan-2024.4/bitswan/web/__init__.py +155 -0
  378. bitswan-2024.4/bitswan/web/static/app.html +67 -0
  379. bitswan-2024.4/bitswan/web/static/app.js +8 -0
  380. bitswan-2024.4/bitswan/zookeeper/__init__.py +3 -0
  381. bitswan-2024.4/bitswan/zookeeper/lookupprovider.py +36 -0
  382. bitswan-2024.4/build_and_push.sh +17 -0
  383. bitswan-2024.4/doc/.readthedocs.yml +22 -0
  384. bitswan-2024.4/doc/mqtt-metrics-and-visibility.md +40 -0
  385. bitswan-2024.4/doc/opsgenie.md +21 -0
  386. bitswan-2024.4/doc/secrets.md +48 -0
  387. bitswan-2024.4/examples/Advanced/bspump-aggregator.py +54 -0
  388. bitswan-2024.4/examples/Advanced/bspump-amqp.py +48 -0
  389. bitswan-2024.4/examples/Advanced/bspump-analyzing-source.py +94 -0
  390. bitswan-2024.4/examples/Advanced/bspump-anomaly.py +267 -0
  391. bitswan-2024.4/examples/Advanced/bspump-avro-serialization.py +69 -0
  392. bitswan-2024.4/examples/Advanced/bspump-avro-sink.py +69 -0
  393. bitswan-2024.4/examples/Advanced/bspump-avro-source.py +43 -0
  394. bitswan-2024.4/examples/Advanced/bspump-catch-error.py +40 -0
  395. bitswan-2024.4/examples/Advanced/bspump-coindesk.py +64 -0
  396. bitswan-2024.4/examples/Advanced/bspump-content-filter.py +69 -0
  397. bitswan-2024.4/examples/Advanced/bspump-csv-tableau-export.py +167 -0
  398. bitswan-2024.4/examples/Advanced/bspump-csv.py +52 -0
  399. bitswan-2024.4/examples/Advanced/bspump-csvsink-periodic.py +72 -0
  400. bitswan-2024.4/examples/Advanced/bspump-cysimdjson-parser.py +60 -0
  401. bitswan-2024.4/examples/Advanced/bspump-declarative-parser.py +49 -0
  402. bitswan-2024.4/examples/Advanced/bspump-declarative-twa.py +65 -0
  403. bitswan-2024.4/examples/Advanced/bspump-declarative.py +82 -0
  404. bitswan-2024.4/examples/Advanced/bspump-direct-source.py +87 -0
  405. bitswan-2024.4/examples/Advanced/bspump-dnsenricher.py +92 -0
  406. bitswan-2024.4/examples/Advanced/bspump-elasticlookup.py +82 -0
  407. bitswan-2024.4/examples/Advanced/bspump-es-context-enrichment.py +66 -0
  408. bitswan-2024.4/examples/Advanced/bspump-es-es.py +74 -0
  409. bitswan-2024.4/examples/Advanced/bspump-es-sink.py +62 -0
  410. bitswan-2024.4/examples/Advanced/bspump-es-source.py +52 -0
  411. bitswan-2024.4/examples/Advanced/bspump-essource-sftpsink.py +0 -0
  412. bitswan-2024.4/examples/Advanced/bspump-ftp-source.py +59 -0
  413. bitswan-2024.4/examples/Advanced/bspump-http.py +57 -0
  414. bitswan-2024.4/examples/Advanced/bspump-hyperloglog.py +100 -0
  415. bitswan-2024.4/examples/Advanced/bspump-influx.py +46 -0
  416. bitswan-2024.4/examples/Advanced/bspump-insert-pipeline.py +46 -0
  417. bitswan-2024.4/examples/Advanced/bspump-integrity-enricher.py +78 -0
  418. bitswan-2024.4/examples/Advanced/bspump-ipc-datagram.py +39 -0
  419. bitswan-2024.4/examples/Advanced/bspump-ipc-ssl-source.py +50 -0
  420. bitswan-2024.4/examples/Advanced/bspump-ipc-tcp-sink.py +41 -0
  421. bitswan-2024.4/examples/Advanced/bspump-ipc-tcp-source.py +39 -0
  422. bitswan-2024.4/examples/Advanced/bspump-ipgeo.py +94 -0
  423. bitswan-2024.4/examples/Advanced/bspump-kafka-topic-initializer.py +72 -0
  424. bitswan-2024.4/examples/Advanced/bspump-kafka.py +48 -0
  425. bitswan-2024.4/examples/Advanced/bspump-latch.py +47 -0
  426. bitswan-2024.4/examples/Advanced/bspump-ldap-source.py +61 -0
  427. bitswan-2024.4/examples/Advanced/bspump-locate.py +66 -0
  428. bitswan-2024.4/examples/Advanced/bspump-lookup-memcached.py +60 -0
  429. bitswan-2024.4/examples/Advanced/bspump-lookup.py +127 -0
  430. bitswan-2024.4/examples/Advanced/bspump-mongo-sink.py +36 -0
  431. bitswan-2024.4/examples/Advanced/bspump-mongo-source.py +69 -0
  432. bitswan-2024.4/examples/Advanced/bspump-mongolookup.py +79 -0
  433. bitswan-2024.4/examples/Advanced/bspump-mongosource-sftpsink.py +116 -0
  434. bitswan-2024.4/examples/Advanced/bspump-mysql-binary-log.py +88 -0
  435. bitswan-2024.4/examples/Advanced/bspump-mysql-lookup-microservice.py +78 -0
  436. bitswan-2024.4/examples/Advanced/bspump-mysql-lookup.py +100 -0
  437. bitswan-2024.4/examples/Advanced/bspump-mysql.py +103 -0
  438. bitswan-2024.4/examples/Advanced/bspump-net-flow.py +27 -0
  439. bitswan-2024.4/examples/Advanced/bspump-odbc.py +98 -0
  440. bitswan-2024.4/examples/Advanced/bspump-oob-async.py +73 -0
  441. bitswan-2024.4/examples/Advanced/bspump-oob-proactor.py +84 -0
  442. bitswan-2024.4/examples/Advanced/bspump-parquet.py +63 -0
  443. bitswan-2024.4/examples/Advanced/bspump-parser.py +89 -0
  444. bitswan-2024.4/examples/Advanced/bspump-postgres-wal-source.py +41 -0
  445. bitswan-2024.4/examples/Advanced/bspump-postgresql-lookup.py +102 -0
  446. bitswan-2024.4/examples/Advanced/bspump-postgresql.py +83 -0
  447. bitswan-2024.4/examples/Advanced/bspump-profiler.py +68 -0
  448. bitswan-2024.4/examples/Advanced/bspump-pumpbuilder.py +46 -0
  449. bitswan-2024.4/examples/Advanced/bspump-random.py +52 -0
  450. bitswan-2024.4/examples/Advanced/bspump-router.py +177 -0
  451. bitswan-2024.4/examples/Advanced/bspump-sa.py +135 -0
  452. bitswan-2024.4/examples/Advanced/bspump-serialization-mmap.py +141 -0
  453. bitswan-2024.4/examples/Advanced/bspump-simple-twa.py +115 -0
  454. bitswan-2024.4/examples/Advanced/bspump-sklearn-random-forest-classifier.py +197 -0
  455. bitswan-2024.4/examples/Advanced/bspump-slack.py +54 -0
  456. bitswan-2024.4/examples/Advanced/bspump-smtp.py +72 -0
  457. bitswan-2024.4/examples/Advanced/bspump-ssh-sink.py +101 -0
  458. bitswan-2024.4/examples/Advanced/bspump-subprocess.py +38 -0
  459. bitswan-2024.4/examples/Advanced/bspump-tensorflow-lstm-time-series.py +161 -0
  460. bitswan-2024.4/examples/Advanced/bspump-threshold-analyzer.py +112 -0
  461. bitswan-2024.4/examples/Advanced/bspump-transformator.py +58 -0
  462. bitswan-2024.4/examples/Advanced/bspump-twa.py +206 -0
  463. bitswan-2024.4/examples/Advanced/bspump-udp.py +33 -0
  464. bitswan-2024.4/examples/Advanced/bspump-weather-api.py +50 -0
  465. bitswan-2024.4/examples/Advanced/bspump-web.py +42 -0
  466. bitswan-2024.4/examples/Advanced/bspump-winrm.py +49 -0
  467. bitswan-2024.4/examples/Advanced/bspump-ws-client.py +42 -0
  468. bitswan-2024.4/examples/Advanced/bspump-ws-server.py +28 -0
  469. bitswan-2024.4/examples/Advanced/classification/MBDomainsModel.pkl +0 -0
  470. bitswan-2024.4/examples/Advanced/classification/MBLabelEncoder.pkl +0 -0
  471. bitswan-2024.4/examples/Advanced/classification/named.log-processed +1 -0
  472. bitswan-2024.4/examples/Advanced/data/anomalies.txt +4 -0
  473. bitswan-2024.4/examples/Advanced/data/avro_data.avro +0 -0
  474. bitswan-2024.4/examples/Advanced/data/avro_schema.avsc +11 -0
  475. bitswan-2024.4/examples/Advanced/data/bspump-profiler.json +5 -0
  476. bitswan-2024.4/examples/Advanced/data/city.csv +4 -0
  477. bitswan-2024.4/examples/Advanced/data/country_names.json +252 -0
  478. bitswan-2024.4/examples/Advanced/data/declarative-input.yml +28 -0
  479. bitswan-2024.4/examples/Advanced/data/declarative-parser-input.yml +5 -0
  480. bitswan-2024.4/examples/Advanced/data/es_sink.json +2 -0
  481. bitswan-2024.4/examples/Advanced/data/hello.txt +1 -0
  482. bitswan-2024.4/examples/Advanced/data/ip_address_source.csv +2 -0
  483. bitswan-2024.4/examples/Advanced/data/ip_addresses.csv +3 -0
  484. bitswan-2024.4/examples/Advanced/data/kafka-topic-config.yml +8 -0
  485. bitswan-2024.4/examples/Advanced/data/large-file.json +11352 -0
  486. bitswan-2024.4/examples/Advanced/data/sample-for-avro-schema.avsc +10 -0
  487. bitswan-2024.4/examples/Advanced/data/sample-for-avro.csv +23 -0
  488. bitswan-2024.4/examples/Advanced/data/sample.csv +3 -0
  489. bitswan-2024.4/examples/Advanced/data/sample.json +9 -0
  490. bitswan-2024.4/examples/Advanced/data/sample2-schema.json +11 -0
  491. bitswan-2024.4/examples/Advanced/data/sample2.csv +2 -0
  492. bitswan-2024.4/examples/Advanced/data/sample_to_avro.json +4 -0
  493. bitswan-2024.4/examples/Advanced/data/sampledata.json +18 -0
  494. bitswan-2024.4/examples/Advanced/data/test_ec_key +10 -0
  495. bitswan-2024.4/examples/Advanced/data/users.csv +4 -0
  496. bitswan-2024.4/examples/Advanced/data/users_duration_link.csv +4 -0
  497. bitswan-2024.4/examples/Advanced/matrix-lookup/bspump-matrix-lookup-master.py +123 -0
  498. bitswan-2024.4/examples/Advanced/matrix-lookup/bspump-matrix-lookup-slave.py +101 -0
  499. bitswan-2024.4/examples/Advanced/matrix-lookup/lookup.py +70 -0
  500. bitswan-2024.4/examples/Advanced/ssl/cert.pem +31 -0
  501. bitswan-2024.4/examples/Advanced/ssl/key.pem +52 -0
  502. bitswan-2024.4/examples/Advanced/timeseries/bspump-gettingstarted.py +41 -0
  503. bitswan-2024.4/examples/Advanced/timeseries/data.csv-processed +478 -0
  504. bitswan-2024.4/examples/Advanced/timeseries/exported.json +1 -0
  505. bitswan-2024.4/examples/Advanced/timeseries/my_model.h5 +0 -0
  506. bitswan-2024.4/examples/Advanced/timeseries/my_parameters.json +1 -0
  507. bitswan-2024.4/examples/AutoPipeline/main.ipynb +229 -0
  508. bitswan-2024.4/examples/AutoPipeline/pipelines.conf +8 -0
  509. bitswan-2024.4/examples/JWTWebForm/main.ipynb +134 -0
  510. bitswan-2024.4/examples/JWTWebForm/pipelines.conf +3 -0
  511. bitswan-2024.4/examples/Kafka2Kafka/main.ipynb +192 -0
  512. bitswan-2024.4/examples/Kafka2Kafka/pipelines.conf +12 -0
  513. bitswan-2024.4/examples/Lookups/main.ipynb +183 -0
  514. bitswan-2024.4/examples/Lookups/pipelines.conf +7 -0
  515. bitswan-2024.4/examples/ProtectedWebForm/main.ipynb +130 -0
  516. bitswan-2024.4/examples/ProtectedWebForm/pipelines.conf +2 -0
  517. bitswan-2024.4/examples/ProtectedWebRouteSource/main.ipynb +95 -0
  518. bitswan-2024.4/examples/ProtectedWebRouteSource/pipelines.conf +2 -0
  519. bitswan-2024.4/examples/Secrets/example-secrets-dir/bar +1 -0
  520. bitswan-2024.4/examples/Secrets/example-secrets-dir/baz +1 -0
  521. bitswan-2024.4/examples/Secrets/example-secrets-dir/foo +1 -0
  522. bitswan-2024.4/examples/Secrets/main.ipynb +95 -0
  523. bitswan-2024.4/examples/Secrets/pipelines.conf +2 -0
  524. bitswan-2024.4/examples/Testing/AutoPipeline/main.ipynb +115 -0
  525. bitswan-2024.4/examples/Testing/AutoPipeline/pipelines.conf +8 -0
  526. bitswan-2024.4/examples/Testing/ExpectError/main.ipynb +354 -0
  527. bitswan-2024.4/examples/Testing/ExpectError/pipelines.conf +8 -0
  528. bitswan-2024.4/examples/Testing/InspectError/main.ipynb +354 -0
  529. bitswan-2024.4/examples/Testing/InspectError/pipelines.conf +8 -0
  530. bitswan-2024.4/examples/Testing/MultiplePipelines/main.ipynb +354 -0
  531. bitswan-2024.4/examples/Testing/MultiplePipelines/pipelines.conf +8 -0
  532. bitswan-2024.4/examples/Testing/ProbeError/main.ipynb +354 -0
  533. bitswan-2024.4/examples/Testing/ProbeError/pipelines.conf +8 -0
  534. bitswan-2024.4/examples/Testing/main.ipynb +285 -0
  535. bitswan-2024.4/examples/Testing/pipelines.conf +8 -0
  536. bitswan-2024.4/examples/WebForms/main.ipynb +113 -0
  537. bitswan-2024.4/examples/WebHooks/main.ipynb +158 -0
  538. bitswan-2024.4/examples/WebHooks/pipelines.conf +12 -0
  539. bitswan-2024.4/examples/WebServer/main.ipynb +96 -0
  540. bitswan-2024.4/icons/bitswan-logo.svg +47 -0
  541. bitswan-2024.4/perf/README.md +4 -0
  542. bitswan-2024.4/perf/data/sample-for-avro-schema.avsc +10 -0
  543. bitswan-2024.4/perf/data/sample-for-avro.csv +23 -0
  544. bitswan-2024.4/perf/elasticsearch/README.md +18 -0
  545. bitswan-2024.4/perf/elasticsearch/perf-baseline-sink.py +53 -0
  546. bitswan-2024.4/perf/elasticsearch/perf-es-sink.py +57 -0
  547. bitswan-2024.4/pre/entrypoint.sh +8 -0
  548. bitswan-2024.4/pyproject.toml +74 -0
  549. bitswan-2024.4/pytest.ini +3 -0
  550. bitswan-2024.4/shell.nix +22 -0
  551. bitswan-2024.4/test/__init__.py +11 -0
  552. bitswan-2024.4/test/analyzer/__init__.py +6 -0
  553. bitswan-2024.4/test/analyzer/test_analyzer.py +24 -0
  554. bitswan-2024.4/test/analyzer/test_geoanalyzer.py +20 -0
  555. bitswan-2024.4/test/analyzer/test_latch.py +94 -0
  556. bitswan-2024.4/test/analyzer/test_sessionanalyzer.py +22 -0
  557. bitswan-2024.4/test/analyzer/test_timedriftanalyzer.py +21 -0
  558. bitswan-2024.4/test/analyzer/test_timewindowanalyzer.py +22 -0
  559. bitswan-2024.4/test/common/__init__.py +14 -0
  560. bitswan-2024.4/test/common/test_aggregator.py +112 -0
  561. bitswan-2024.4/test/common/test_bytes.py +64 -0
  562. bitswan-2024.4/test/common/test_flatten.py +43 -0
  563. bitswan-2024.4/test/common/test_hexlify.py +20 -0
  564. bitswan-2024.4/test/common/test_iterator.py +45 -0
  565. bitswan-2024.4/test/common/test_json.py +63 -0
  566. bitswan-2024.4/test/common/test_mapping.py +104 -0
  567. bitswan-2024.4/test/common/test_null.py +15 -0
  568. bitswan-2024.4/test/common/test_print.py +109 -0
  569. bitswan-2024.4/test/common/test_time.py +38 -0
  570. bitswan-2024.4/test/crypto/__init__.py +2 -0
  571. bitswan-2024.4/test/crypto/test_aes.py +45 -0
  572. bitswan-2024.4/test/crypto/test_hashing.py +198 -0
  573. bitswan-2024.4/test/declarative/__init__.py +11 -0
  574. bitswan-2024.4/test/declarative/test_add_01.yaml +4 -0
  575. bitswan-2024.4/test/declarative/test_add_02.yaml +5 -0
  576. bitswan-2024.4/test/declarative/test_and_01.yaml +8 -0
  577. bitswan-2024.4/test/declarative/test_config_01.yaml +5 -0
  578. bitswan-2024.4/test/declarative/test_datetime_add.yaml +6 -0
  579. bitswan-2024.4/test/declarative/test_datetime_parse_fail.yaml +6 -0
  580. bitswan-2024.4/test/declarative/test_datetime_parse_set_year.yaml +5 -0
  581. bitswan-2024.4/test/declarative/test_datetime_parse_timezone.yaml +5 -0
  582. bitswan-2024.4/test/declarative/test_datetime_parse_tz.yaml +4 -0
  583. bitswan-2024.4/test/declarative/test_declarative_add.py +34 -0
  584. bitswan-2024.4/test/declarative/test_declarative_and.py +20 -0
  585. bitswan-2024.4/test/declarative/test_declarative_config.py +23 -0
  586. bitswan-2024.4/test/declarative/test_declarative_datetime.py +56 -0
  587. bitswan-2024.4/test/declarative/test_declarative_dict.py +53 -0
  588. bitswan-2024.4/test/declarative/test_declarative_dict_parse.py +54 -0
  589. bitswan-2024.4/test/declarative/test_declarative_join.py +37 -0
  590. bitswan-2024.4/test/declarative/test_declarative_nested_expression.py +71 -0
  591. bitswan-2024.4/test/declarative/test_declarative_nested_expression.yaml +36 -0
  592. bitswan-2024.4/test/declarative/test_declarative_regex.py +59 -0
  593. bitswan-2024.4/test/declarative/test_declarative_time.py +25 -0
  594. bitswan-2024.4/test/declarative/test_declarative_when.py +35 -0
  595. bitswan-2024.4/test/declarative/test_dict_01.yaml +6 -0
  596. bitswan-2024.4/test/declarative/test_dict_02.yaml +6 -0
  597. bitswan-2024.4/test/declarative/test_dict_parse_kvdqs_01.yaml +4 -0
  598. bitswan-2024.4/test/declarative/test_dict_parse_kvs_01.yaml +4 -0
  599. bitswan-2024.4/test/declarative/test_dict_parse_qs_01.yaml +4 -0
  600. bitswan-2024.4/test/declarative/test_join_01.yaml +9 -0
  601. bitswan-2024.4/test/declarative/test_join_02.yaml +10 -0
  602. bitswan-2024.4/test/declarative/test_now.yaml +2 -0
  603. bitswan-2024.4/test/declarative/test_regex_parse_01.yaml +22 -0
  604. bitswan-2024.4/test/declarative/test_regex_parse_02.yaml +24 -0
  605. bitswan-2024.4/test/declarative/test_when.yaml +34 -0
  606. bitswan-2024.4/test/file/__init__.py +1 -0
  607. bitswan-2024.4/test/file/test_fileblocksink.py +24 -0
  608. bitswan-2024.4/test/filter/__init__.py +3 -0
  609. bitswan-2024.4/test/filter/test_attributefilter.py +74 -0
  610. bitswan-2024.4/test/filter/test_contentfilter.py +60 -0
  611. bitswan-2024.4/test/filter/test_timedriftfilter.py +28 -0
  612. bitswan-2024.4/test/influxdb/__init__.py +1 -0
  613. bitswan-2024.4/test/influxdb/test_influxdbsink.py +42 -0
  614. bitswan-2024.4/test/integrity/__init__.py +1 -0
  615. bitswan-2024.4/test/integrity/test_integrity.py +53 -0
  616. bitswan-2024.4/test/kafka/__init__.py +1 -0
  617. bitswan-2024.4/test/kafka/test_kafkasink.py +57 -0
  618. bitswan-2024.4/test/matrix/__init__.py +5 -0
  619. bitswan-2024.4/test/matrix/test_geo_matrix.py +68 -0
  620. bitswan-2024.4/test/matrix/test_matrix.py +81 -0
  621. bitswan-2024.4/test/matrix/test_named_matrix.py +83 -0
  622. bitswan-2024.4/test/matrix/test_session_matrix.py +83 -0
  623. bitswan-2024.4/test/matrix/test_time_window_matrix.py +96 -0
  624. bitswan-2024.4/test/test_config_defaults.py +27 -0
  625. bitswan-2024.4/test/test_metrics_service.py +63 -0
@@ -0,0 +1,5 @@
1
+ [run]
2
+ source=bspump/
3
+
4
+ [report]
5
+ include=bspump*
@@ -0,0 +1,31 @@
1
+ name: Build and Push Docker Image
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+
7
+ jobs:
8
+ build-and-push:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Check out the repo
13
+ uses: actions/checkout@v2
14
+
15
+ - name: Set up Docker Buildx
16
+ uses: docker/setup-buildx-action@v1
17
+
18
+ - name: Log in to Docker Hub
19
+ uses: docker/login-action@v1
20
+ with:
21
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
22
+ password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
23
+
24
+ - name: Get Year and Commit Hash
25
+ id: vars
26
+ run: |
27
+ echo "::set-output name=year::$(date +%Y)"
28
+ echo "::set-output name=commit_hash::$(git rev-parse --short HEAD)"
29
+
30
+ - name: Build and Push
31
+ run: bash build_and_push.sh
@@ -0,0 +1,36 @@
1
+ name: Python 3.10 Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ container:
10
+ image: python:3.10
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Install dependencies
15
+ run: |
16
+ apt-get update
17
+ apt-get -y install unixodbc-dev
18
+ git config --global --add safe.directory /__w/BitSwan/BitSwan
19
+ pip3 install --upgrade cython
20
+ pip3 install .[dev]
21
+
22
+ - name: Run tests
23
+ run: |
24
+ pytest bspump/file
25
+
26
+ - name: Run bitswan tests
27
+ run: |
28
+ bitswan-cli --test examples/Testing/main.ipynb
29
+ bitswan-cli --test examples/Testing/MultiplePipelines/main.ipynb
30
+ bitswan-cli --test examples/Testing/AutoPipeline/main.ipynb
31
+
32
+
33
+ - name: Run linter
34
+ run: |
35
+ black --check bspump
36
+ ruff check bspump
@@ -0,0 +1,118 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ *.dot
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # Django stuff:
55
+ *.log
56
+ local_settings.py
57
+
58
+ # Flask stuff:
59
+ instance/
60
+ .webassets-cache
61
+
62
+ # Scrapy stuff:
63
+ .scrapy
64
+
65
+ # Sphinx documentation
66
+ docs/_build/
67
+
68
+ # PyBuilder
69
+ target/
70
+
71
+ # Jupyter Notebook
72
+ .ipynb_checkpoints
73
+
74
+ # pyenv
75
+ .python-version
76
+
77
+ # celery beat schedule file
78
+ celerybeat-schedule
79
+
80
+ # SageMath parsed files
81
+ *.sage.py
82
+
83
+ # dotenv
84
+ .env
85
+
86
+ # virtualenv
87
+ .venv
88
+ venv/
89
+ ENV/
90
+
91
+ # Spyder project settings
92
+ .spyderproject
93
+ .spyproject
94
+
95
+ # Rope project settings
96
+ .ropeproject
97
+
98
+ # mkdocs documentation
99
+ /site
100
+
101
+ # mypy
102
+ .mypy_cache/
103
+
104
+ # idea
105
+ .idea/
106
+
107
+ # ignoring site configuration
108
+ etc/site.conf
109
+ etc/site.d/
110
+
111
+ # ignoring example outputs
112
+ examples/data/ignore_*
113
+
114
+ doc/_build
115
+
116
+ # VSCode
117
+ .vscode/
118
+
@@ -0,0 +1,23 @@
1
+ variables:
2
+ DOCKER_IMAGE: bitswan-pre
3
+
4
+ stages:
5
+ - test
6
+ - build
7
+
8
+ test-py310:
9
+ image: python:3.10
10
+ stage: test
11
+ coverage: '/\d+\%$/'
12
+ script:
13
+ - apt-get update
14
+ - apt-get -y install unixodbc-dev
15
+ - pip3 install --upgrade cython
16
+ - pip3 install .
17
+ - pip install -r requirements-dev.txt
18
+ - pytest bspump/file
19
+ - ruff bspump
20
+
21
+ include:
22
+ - project: 'LibertyAces/Product/bitswanmonorepo'
23
+ file: 'cicd/docker-build-public.yml'
@@ -0,0 +1,40 @@
1
+ FROM python:3.10-slim-bullseye
2
+ MAINTAINER LibertyAces Ltd
3
+ LABEL "space.bitswan.pipeline.protocol-version"="2023.12-1"
4
+ LABEL "space.bitswan.pipeline.ide"="Jupyter"
5
+ LABEL src=https://github.com/bitswan-space/BitSwan
6
+ ENV ASABFORCECONSOLE=1
7
+ ENV PYTHONUNBUFFERED=1
8
+
9
+ RUN set -ex \
10
+ && apt-get update \
11
+ && apt-get -y upgrade
12
+
13
+ RUN apt-get -yqq install \
14
+ git \
15
+ gcc \
16
+ g++ \
17
+ libsnappy-dev \
18
+ autoconf \
19
+ automake \
20
+ libtool \
21
+ build-essential \
22
+ docker-compose
23
+
24
+ COPY . /src/
25
+ RUN cd /src/ ; pip3 install .
26
+
27
+ COPY pre/ /opt/
28
+
29
+ CMD ["sh", "/opt/entrypoint.sh"]
30
+
31
+ # Setup bitswan user
32
+
33
+ RUN useradd --uid 1000 --create-home bitswan
34
+ ENV HOME=/home/bitswan
35
+ USER bitswan
36
+
37
+ USER root
38
+ RUN mkdir -p /home/bitswan/work
39
+ RUN chown -R bitswan:bitswan /home/bitswan/work
40
+
bitswan-2024.4/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2018-2019, LibertyAces Ltd
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ include *.txt *.md
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.3
2
+ Name: bitswan
3
+ Version: 2024.4
4
+ Summary: Bitswan is a framework for building automations and pipelines in Jupyter
5
+ Project-URL: homepage, https://github.com/bitswan-space/BitSwan
6
+ Author-email: LibertyAces Ltd <timothy.hobbs@libertyaces.com>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2018-2019, LibertyAces Ltd
10
+ All rights reserved.
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions are met:
14
+
15
+ * Redistributions of source code must retain the above copyright notice, this
16
+ list of conditions and the following disclaimer.
17
+
18
+ * Redistributions in binary form must reproduce the above copyright notice,
19
+ this list of conditions and the following disclaimer in the documentation
20
+ and/or other materials provided with the distribution.
21
+
22
+ * Neither the name of the copyright holder nor the names of its
23
+ contributors may be used to endorse or promote products derived from
24
+ this software without specific prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ Requires-Dist: aiohttp>=3.8.3
37
+ Requires-Dist: aiomysql>=0.0.20
38
+ Requires-Dist: aiosmtplib>=1.1.3
39
+ Requires-Dist: aiozk>=0.25.0
40
+ Requires-Dist: confluent-kafka>=1.8.2
41
+ Requires-Dist: croniter>=1.4.1
42
+ Requires-Dist: docker
43
+ Requires-Dist: dockerfile-parse
44
+ Requires-Dist: fastavro>=0.23.5
45
+ Requires-Dist: fastjsonschema<3,>=2.16.2
46
+ Requires-Dist: google-api-python-client>=1.7.10
47
+ Requires-Dist: jupyter
48
+ Requires-Dist: kazoo<3,>=2.9.0
49
+ Requires-Dist: mongoquery>=1.3.6
50
+ Requires-Dist: motor>=2.1.0
51
+ Requires-Dist: mysql-replication>=0.21
52
+ Requires-Dist: nest-asyncio==1.6.0
53
+ Requires-Dist: netaddr>=0.7.20
54
+ Requires-Dist: numpy>=1.19.0
55
+ Requires-Dist: orjson
56
+ Requires-Dist: paho-mqtt
57
+ Requires-Dist: pandas>=0.24.2
58
+ Requires-Dist: pika>=1.1.0
59
+ Requires-Dist: pyasn1==0.4.8
60
+ Requires-Dist: pybind11>=2.6.1
61
+ Requires-Dist: pyjwt==v2.10.0
62
+ Requires-Dist: pymongo>=3.10.1
63
+ Requires-Dist: pymysql<=0.9.2,>=0.9.2
64
+ Requires-Dist: python-dotenv==1.0.1
65
+ Requires-Dist: pytz>=2020.1
66
+ Requires-Dist: pyyaml>=5.4
67
+ Requires-Dist: requests>=2.24.0
68
+ Requires-Dist: xxhash>=1.4.4
69
+ Provides-Extra: dev
70
+ Requires-Dist: black==23.1.0; extra == 'dev'
71
+ Requires-Dist: coverage==4.5.3; extra == 'dev'
72
+ Requires-Dist: pytest; extra == 'dev'
73
+ Requires-Dist: pytest-asyncio; extra == 'dev'
74
+ Requires-Dist: ruff; extra == 'dev'
75
+ Provides-Extra: pyjq-support
76
+ Requires-Dist: pyjq>=2.6.0; extra == 'pyjq-support'
77
+ Description-Content-Type: text/markdown
78
+
79
+ Bitswan: A tool for building Pipelines & Automations in Jupyter
80
+ ===============================================
81
+
82
+ You can find example pipelines in the [examples](./examples/) directory.
83
+
84
+ Installation
85
+ --------------
86
+
87
+ ```
88
+ $ git clone git@github.com:bitswan-space/BitSwan.git
89
+ $ cd BitSwan
90
+ $ python3 -m venv venv
91
+ $ source venv/bin/activate
92
+ $ pip3 install -e ".[dev]"
93
+ ```
94
+
95
+ Running pipelines
96
+ --------------------
97
+
98
+ You can run a pipeline with a simple command:
99
+
100
+ ```
101
+ $ bitswan-cli examples/WebForms/main.ipynb
102
+ ```
103
+
104
+ When developing web endpoints it can be helpful to instruct the pipeline to automatically restart if the source code changes.
105
+
106
+ ```
107
+ $ bitswan-cli examples/WebForms/main.ipynb --watch
108
+ ```
109
+
110
+ Running Tests
111
+ ----------------
112
+
113
+ You can find examples for automatically testing pipelines in the [testing examples](./examples/Testing) directory.
114
+
115
+ Run tests with the `--test` flag.
116
+
117
+ ```
118
+ $ bitswan-cli examples/Testing/InspectError/main.ipynb --test
119
+
120
+ Running tests for pipeline Kafka2KafkaPipeline.
121
+
122
+ ┌ Testing event: b'foo'
123
+ └ Outputs: [b'FOO'] ✔
124
+
125
+ All tests passed for Kafka2KafkaPipeline.
126
+
127
+
128
+ Running tests for pipeline auto_pipeline_1.
129
+
130
+ ┌ Testing event: b'{"foo":"aaa"}'
131
+ └ Outputs: [b'{"foo": "A A A"}'] ✔
132
+
133
+ ┌ Testing event: b'{"foo":"aab"}'
134
+ │ Probing after-upper.
135
+ └ Outputs: [b'{"foo": "B A A"}'] ✔
136
+
137
+ ┌ Testing event: b'{"foo":"cab"}'
138
+ └ Outputs: [b'{"foo": "B A C"}'] ✘
139
+ ```
140
+
141
+ You can combine `--test` with `--watch` to automatically rerun tests whenever the source files change.
142
+
143
+
144
+ Licence
145
+ -------
146
+
147
+ Bitswan is open-source software, available under BSD 3-Clause License.
148
+
@@ -0,0 +1,70 @@
1
+ Bitswan: A tool for building Pipelines & Automations in Jupyter
2
+ ===============================================
3
+
4
+ You can find example pipelines in the [examples](./examples/) directory.
5
+
6
+ Installation
7
+ --------------
8
+
9
+ ```
10
+ $ git clone git@github.com:bitswan-space/BitSwan.git
11
+ $ cd BitSwan
12
+ $ python3 -m venv venv
13
+ $ source venv/bin/activate
14
+ $ pip3 install -e ".[dev]"
15
+ ```
16
+
17
+ Running pipelines
18
+ --------------------
19
+
20
+ You can run a pipeline with a simple command:
21
+
22
+ ```
23
+ $ bitswan-cli examples/WebForms/main.ipynb
24
+ ```
25
+
26
+ When developing web endpoints it can be helpful to instruct the pipeline to automatically restart if the source code changes.
27
+
28
+ ```
29
+ $ bitswan-cli examples/WebForms/main.ipynb --watch
30
+ ```
31
+
32
+ Running Tests
33
+ ----------------
34
+
35
+ You can find examples for automatically testing pipelines in the [testing examples](./examples/Testing) directory.
36
+
37
+ Run tests with the `--test` flag.
38
+
39
+ ```
40
+ $ bitswan-cli examples/Testing/InspectError/main.ipynb --test
41
+
42
+ Running tests for pipeline Kafka2KafkaPipeline.
43
+
44
+ ┌ Testing event: b'foo'
45
+ └ Outputs: [b'FOO'] ✔
46
+
47
+ All tests passed for Kafka2KafkaPipeline.
48
+
49
+
50
+ Running tests for pipeline auto_pipeline_1.
51
+
52
+ ┌ Testing event: b'{"foo":"aaa"}'
53
+ └ Outputs: [b'{"foo": "A A A"}'] ✔
54
+
55
+ ┌ Testing event: b'{"foo":"aab"}'
56
+ │ Probing after-upper.
57
+ └ Outputs: [b'{"foo": "B A A"}'] ✔
58
+
59
+ ┌ Testing event: b'{"foo":"cab"}'
60
+ └ Outputs: [b'{"foo": "B A C"}'] ✘
61
+ ```
62
+
63
+ You can combine `--test` with `--watch` to automatically rerun tests whenever the source files change.
64
+
65
+
66
+ Licence
67
+ -------
68
+
69
+ Bitswan is open-source software, available under BSD 3-Clause License.
70
+
@@ -0,0 +1,54 @@
1
+ from .application import BSPumpApplication
2
+ from .service import BSPumpService
3
+ from .pipeline import Pipeline
4
+ from .pumpbuilder import PumpBuilder
5
+ from .abc.source import Source
6
+ from .abc.source import TriggerSource
7
+ from .abc.sink import Sink
8
+ from .abc.processor import Processor
9
+ from .abc.generator import Generator
10
+ from .abc.connection import Connection
11
+
12
+ from .exception import ProcessingError
13
+ from .abc.lookup import Lookup
14
+ from .abc.lookup import MappingLookup
15
+ from .abc.lookup import DictionaryLookup
16
+ from .fileloader import load_json_file
17
+
18
+ from .analyzer.analyzer import Analyzer
19
+
20
+ from .matrix.matrix import Matrix, PersistentMatrix
21
+ from .matrix.namedmatrix import NamedMatrix, PersistentNamedMatrix
22
+ from .model.model import Model
23
+
24
+ from .abc.anomaly import Anomaly
25
+
26
+ from .__version__ import __version__, __build__
27
+
28
+ __all__ = (
29
+ "BSPumpApplication",
30
+ "BSPumpService",
31
+ "Pipeline",
32
+ "PumpBuilder",
33
+ "Source",
34
+ "TriggerSource",
35
+ "Sink",
36
+ "Processor",
37
+ "Generator",
38
+ "Connection",
39
+ "Analyzer",
40
+ "ProcessingError",
41
+ "Lookup",
42
+ "MappingLookup",
43
+ "DictionaryLookup",
44
+ "load_json_file",
45
+ "Matrix",
46
+ "PersistentMatrix",
47
+ "NamedMatrix",
48
+ "Model",
49
+ "PersistentNamedMatrix",
50
+ "Anomaly",
51
+ "__version__",
52
+ "__build__",
53
+ "step",
54
+ )
@@ -0,0 +1,4 @@
1
+ from .application import BSPumpApplication
2
+
3
+ app = BSPumpApplication()
4
+ app.run()
@@ -0,0 +1,12 @@
1
+ # THIS-FILE-WILL-BE-REPLACED !!! DO NOT CHANGE OR MODIFY THIS FILE !!!
2
+
3
+ # During `setup.py build_py`, this file is overwritten
4
+ # __version__ = '[git describe --abbrev=7 --tags --dirty=+dirty --always]
5
+ # __build__ = '[git rev-parse HEAD]'
6
+
7
+ # PEP 440 -- Version Identification and Dependency Specification
8
+ # https://www.python.org/dev/peps/pep-0440/
9
+
10
+
11
+ __version__ = "devel"
12
+ __build__ = "devel"
File without changes
@@ -0,0 +1,41 @@
1
+ class Anomaly(dict):
2
+ """
3
+ Description: Anomaly is an abstract class to be overriden for a specific anomaly and its type.
4
+
5
+ :return:
6
+
7
+ Implement: TYPE, on_tick
8
+
9
+ |
10
+
11
+ """
12
+
13
+ TYPE = None
14
+
15
+ def is_closed(self):
16
+ """
17
+ Description:
18
+
19
+ :return: sets status to closed
20
+
21
+ |
22
+
23
+ """
24
+ return self.get("status") == "closed"
25
+
26
+ def close(self, current_time):
27
+ """
28
+ Description:
29
+
30
+ """
31
+ self["ts_end"] = current_time
32
+ self["D"] = self["ts_end"] - self["@timestamp"]
33
+ self["status"] = "closed"
34
+
35
+ async def on_tick(self, current_time):
36
+ """
37
+ Description:
38
+
39
+ :hint: Implement to perform operations on the anomaly, f. e. close.
40
+ """
41
+ raise NotImplementedError()
@@ -0,0 +1,71 @@
1
+ import abc
2
+ from bspump.asab import Configurable
3
+
4
+
5
+ class Connection(abc.ABC, Configurable):
6
+ """
7
+ Connection class is responsible for creating a connection between items or services within the infrastructure of BSPump.
8
+ Their main use is to create connection with the main components of BSPump: source, :meth:`processor <bspump.Processor()>` and sink.
9
+
10
+ |
11
+
12
+ """
13
+
14
+ def __init__(self, app, id=None, config=None):
15
+ """
16
+ Description:
17
+
18
+
19
+ **Parameters**
20
+
21
+ app : Application
22
+ Specification of an `Application <https://asab.readthedocs.io/en/latest/asab/application.html#>`_.
23
+
24
+ id : default None
25
+
26
+ config : JSON or other compatible format, default None
27
+ It contains important information and data responsible for creating a connection.
28
+
29
+ """
30
+
31
+ _id = id if id is not None else self.__class__.__name__
32
+ super().__init__("connection:{}".format(_id), config=config)
33
+
34
+ self.App = app
35
+ self.Loop = app.Loop
36
+
37
+ self.Id = _id
38
+
39
+ def time(self):
40
+ """
41
+ Returns accurate time of the asynchronous process.
42
+
43
+ :hint: More information in the ASAB documentation in `UTC Time <https://asab.readthedocs.io/en/latest/asab/application.html#utc-time>`_.
44
+
45
+ |
46
+
47
+ """
48
+ return self.App.time()
49
+
50
+ @classmethod
51
+ def construct(cls, app, definition: dict):
52
+ """
53
+ Creates a connection based on a specific definition. For example, a JSON file.
54
+
55
+ **Parameters**
56
+
57
+ app : Application
58
+ ID of the `Application <https://asab.readthedocs.io/en/latest/asab/application.html#>_`.
59
+
60
+ definition : definition format
61
+ Defines instructions for the method that can be used to create a connection.
62
+
63
+
64
+ :return: cls(app, newid, config)
65
+
66
+ |
67
+
68
+ """
69
+ newid = definition.get("id")
70
+ config = definition.get("config")
71
+ return cls(app, newid, config)