A package to create a BehaviorCloud compatible data analyzer.
Project description
BehaviorCloud Analyzer
Python Helper
This is a thin package to help you quickly create a BehaviorCloud analyzer. It will handle calls to the BehaviorCloud API server so you don't have to worry about it. This package supports the following features:
- Fully managed analyzer creation - you just make the conversion function!
- One off analysis (pass an "--id" command-line parameter)
- Daemon analysis (use the "--daemon" flag)
- Exception handling and automatic upload to Sentry.io
Example Usage:
import json
from behaviorcloud.analyzer.data import convert_stream_to_json
from behaviorcloud.analyzer.coordinator import Coordinator
def convert(source_request, source_settings, settings, source, targets):
target = targets[0]
source_data = convert_stream_to_json(source_request)
analyzed_data = [{processed: True, original: entry} for entry in source_data]
return [{
"data": json.dumps(analyzed_data),
"extension": "json",
"id": target["id"],
}]
coordinator = Coordinator(convert)
coordinator.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bc-analyzer-0.2.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for bc_analyzer-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8d27f2583b67794994b875510d943ebebf42dd10af35bee980f7278fff2a6d2 |
|
MD5 | f7a0acd34d8b0e4812742c16b6371f87 |
|
BLAKE2b-256 | 1b9204e92d492fdfe68f773de9ee5f8858a7aaa711e3e1930597a25ce867d9c8 |