|
1 | 1 | # python-bitflow |
2 | | -Python bitflow implementation |
3 | | -Supported inputs/output: |
4 | | -* read/write File |
5 | | -* download/send from Host:Port |
6 | | -* Listen Input/Output (currently hardcoded buffersize [unlimited]) |
| 2 | +**python-bitflow** is a python library for sending, receiving and transforming streams of data. Read the documentation under [bitflow.rtfd.io](https://bitflow.readthedocs.io/en/latest/ "Bitflow documentation") to learn more about bitflow and the correlated projects. |
7 | 3 |
|
8 | | -Further: |
9 | | -* Currently ownly marshalls csv like bitflow format |
10 | | -* first implementation of bitflow script, including most of the language functionallity (python-bitflow) |
| 4 | +Python-bitflow is current running in python3.6. It may run under other python3.x version but is not tested yet. |
11 | 5 |
|
12 | | -## Example |
| 6 | +## Installation |
| 7 | +You can install python-bitflow by running the following command. This will put the exection script python-bitflow into your $PATH and will make the bitflow classes availble within your current python environmnet. |
| 8 | +``` |
| 9 | +python setup.py install |
| 10 | +``` |
| 11 | +## Python-Bitflow script and usage examples |
| 12 | +Bitflow script is a powerfull scripting language. It allows to define pipelines, processing steps (order), forks and more. |
| 13 | + |
| 14 | +#### Help! |
| 15 | +Get help: |
| 16 | +``` |
| 17 | +python-bitflow --help |
| 18 | +``` |
| 19 | + |
| 20 | +#### Python-Bitflow, Capabilities |
| 21 | +Get an overview of all available processing steps and forks |
| 22 | +``` |
| 23 | +python-bitflow -capabilities |
| 24 | +``` |
| 25 | + |
| 26 | +#### Script example 1. reading file into Noop processing step |
| 27 | +``` |
| 28 | +python-bitflow -script "testing/testing_file_in.txt -> Noop()"" |
| 29 | +``` |
| 30 | + |
| 31 | +#### Script example 2. reading file into PlotLinePlot processing step |
| 32 | +This will generate in .png file in the current path |
| 33 | +``` |
| 34 | +python-bitflow -script "testing/testing_file_in.txt -> PlotLinePlot(metric_names='ongoing_connections')" |
| 35 | +``` |
| 36 | + |
| 37 | +#### Script example 3. reading file into PlotLinePlot processing step |
| 38 | +Reads testing file, if tag "filter" is set to "port_1935" the metric pkg_out_1300-1400 will be plottet, else if tag "filter" is set to "port_1936" the metric pkg_out_1400-1500. Afterwards both kind of samples got forwarded to a Noop() processing step. |
| 39 | +``` |
| 40 | +python-bitflow -script "testing/testing_file_in.txt -> Fork_Tags(tag='filter'){ port_1935 -> PlotLinePlot(metric_names='pkg_out_1300-1400') ; port_1936 -> PlotLinePlot(metric_names='pkg_out_1400-1500') } -> Noop()" |
| 41 | +``` |
| 42 | + |
| 43 | +#### Script example 4. load processing step from external file (requires installation) |
| 44 | +``` |
| 45 | +python-bitflow -script "testing/testing_file_in.txt -> my_processing()" -p my_processing.py |
| 46 | +``` |
| 47 | +Current version does not close properly in all cases. Use strg-C to exit. |
| 48 | + |
| 49 | +## Library Examples |
13 | 50 | bitflow-example.py: provides a short overview about how to setup a pipeline and initialize source,sink, and processing steps. |
14 | 51 | download-data.py: downloads data from a given endpoint, filters samples |
15 | 52 | provide-data.py: reads a file and provides this file via a listen port |
16 | 53 |
|
17 | 54 | ## TODO |
18 | 55 | * support binary bitflow format |
19 | | -* adopt all processing steps for bitflow script |
20 | | -* enable forks in bitflow script |
21 | 56 | * intensive testing |
22 | | -* implement capabilities argument |
23 | 57 | * automatic source recognition (removes marshaller parameter from sources) |
| 58 | +* closing python-bitflow properly |
24 | 59 |
|
25 | 60 | ## Known Issues: |
26 | 61 | * not all implemented processing steps are prepared to run in bitflow scripts |
27 | 62 | * sometimes a zombie process still exisits after closing python-bitflow with strg+c |
28 | | - |
| 63 | +* Forks are currently not listed in -capabilities |
0 commit comments