lorrystream 0.0.2__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.
- lorrystream-0.0.2/CHANGES.rst +17 -0
- lorrystream-0.0.2/LICENSE +165 -0
- lorrystream-0.0.2/MANIFEST.in +3 -0
- lorrystream-0.0.2/PKG-INFO +382 -0
- lorrystream-0.0.2/README.rst +283 -0
- lorrystream-0.0.2/doc/backlog.rst +169 -0
- lorrystream-0.0.2/doc/development.rst +54 -0
- lorrystream-0.0.2/doc/operations.rst +3 -0
- lorrystream-0.0.2/doc/prior-art.rst +91 -0
- lorrystream-0.0.2/doc/research-new.rst +26 -0
- lorrystream-0.0.2/doc/research.rst +119 -0
- lorrystream-0.0.2/doc/sink/database.rst +16 -0
- lorrystream-0.0.2/doc/source/amqp.rst +214 -0
- lorrystream-0.0.2/doc/source/mqtt.rst +95 -0
- lorrystream-0.0.2/lorrystream/__init__.py +1 -0
- lorrystream-0.0.2/lorrystream/cli.py +87 -0
- lorrystream-0.0.2/lorrystream/cmd.py +38 -0
- lorrystream-0.0.2/lorrystream/core.py +215 -0
- lorrystream-0.0.2/lorrystream/exceptions.py +14 -0
- lorrystream-0.0.2/lorrystream/model.py +132 -0
- lorrystream-0.0.2/lorrystream/streamz/__init__.py +0 -0
- lorrystream-0.0.2/lorrystream/streamz/amqp.py +513 -0
- lorrystream-0.0.2/lorrystream/streamz/model.py +148 -0
- lorrystream-0.0.2/lorrystream/streamz/sinks.py +114 -0
- lorrystream-0.0.2/lorrystream/streamz/sources.py +89 -0
- lorrystream-0.0.2/lorrystream/util/__init__.py +0 -0
- lorrystream-0.0.2/lorrystream/util/about.py +120 -0
- lorrystream-0.0.2/lorrystream/util/aio.py +59 -0
- lorrystream-0.0.2/lorrystream/util/cli.py +54 -0
- lorrystream-0.0.2/lorrystream/util/common.py +62 -0
- lorrystream-0.0.2/lorrystream/util/data.py +87 -0
- lorrystream-0.0.2/lorrystream.egg-info/PKG-INFO +382 -0
- lorrystream-0.0.2/lorrystream.egg-info/SOURCES.txt +37 -0
- lorrystream-0.0.2/lorrystream.egg-info/dependency_links.txt +1 -0
- lorrystream-0.0.2/lorrystream.egg-info/entry_points.txt +9 -0
- lorrystream-0.0.2/lorrystream.egg-info/requires.txt +36 -0
- lorrystream-0.0.2/lorrystream.egg-info/top_level.txt +2 -0
- lorrystream-0.0.2/pyproject.toml +273 -0
- lorrystream-0.0.2/setup.cfg +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#####################
|
|
2
|
+
LorryStream changelog
|
|
3
|
+
#####################
|
|
4
|
+
|
|
5
|
+
in progress
|
|
6
|
+
===========
|
|
7
|
+
|
|
8
|
+
2024-07-10 v0.0.2
|
|
9
|
+
=================
|
|
10
|
+
- Initial working version, supporting MQTT, AMQP, and SQLAlchemy/CrateDB
|
|
11
|
+
- Add CLI interface
|
|
12
|
+
- Add logging
|
|
13
|
+
- Add software tests
|
|
14
|
+
|
|
15
|
+
2023-04-06 v0.0.1
|
|
16
|
+
=================
|
|
17
|
+
- Framework and code layout explorations
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: lorrystream
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: A lightweight and polyglot stream-processing library, to be used as a data backplane-, message relay-, or pipeline-subsystem.
|
|
5
|
+
Author-email: Andreas Motl <andreas.motl@panodata.org>, Richard Pobering <richard.pobering@panodata.org>
|
|
6
|
+
License: LGPL 3, EUPL 1.2
|
|
7
|
+
Project-URL: Changelog, https://github.com/daq-tools/lorrystream/blob/main/CHANGES.rst
|
|
8
|
+
Project-URL: Documentation, https://github.com/daq-tools/lorrystream
|
|
9
|
+
Project-URL: Homepage, https://github.com/daq-tools/lorrystream
|
|
10
|
+
Project-URL: Issues, https://github.com/daq-tools/lorrystream/issues
|
|
11
|
+
Project-URL: Repository, https://github.com/daq-tools/lorrystream
|
|
12
|
+
Keywords: amqp,data,export,import,mqtt,pandas,rdbms,sql,stream
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Customer Service
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Education
|
|
18
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
19
|
+
Classifier: Intended Audience :: Information Technology
|
|
20
|
+
Classifier: Intended Audience :: Manufacturing
|
|
21
|
+
Classifier: Intended Audience :: Science/Research
|
|
22
|
+
Classifier: Intended Audience :: System Administrators
|
|
23
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
24
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
25
|
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
|
26
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
27
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
28
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
29
|
+
Classifier: Operating System :: Unix
|
|
30
|
+
Classifier: Programming Language :: Python
|
|
31
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Topic :: Adaptive Technologies
|
|
37
|
+
Classifier: Topic :: Communications
|
|
38
|
+
Classifier: Topic :: Database
|
|
39
|
+
Classifier: Topic :: Documentation
|
|
40
|
+
Classifier: Topic :: Education
|
|
41
|
+
Classifier: Topic :: Internet
|
|
42
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
43
|
+
Classifier: Topic :: Office/Business
|
|
44
|
+
Classifier: Topic :: Scientific/Engineering
|
|
45
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
46
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
47
|
+
Classifier: Topic :: Software Development :: Object Brokering
|
|
48
|
+
Classifier: Topic :: Software Development :: Pre-processors
|
|
49
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
50
|
+
Classifier: Topic :: Software Development :: Testing
|
|
51
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
52
|
+
Classifier: Topic :: System :: Archiving
|
|
53
|
+
Classifier: Topic :: System :: Benchmark
|
|
54
|
+
Classifier: Topic :: System :: Clustering
|
|
55
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
56
|
+
Classifier: Topic :: System :: Hardware
|
|
57
|
+
Classifier: Topic :: System :: Logging
|
|
58
|
+
Classifier: Topic :: System :: Monitoring
|
|
59
|
+
Classifier: Topic :: System :: Networking
|
|
60
|
+
Classifier: Topic :: System :: Systems Administration
|
|
61
|
+
Classifier: Topic :: Text Processing
|
|
62
|
+
Classifier: Topic :: Utilities
|
|
63
|
+
Requires-Python: >=3.9
|
|
64
|
+
Description-Content-Type: text/x-rst
|
|
65
|
+
License-File: LICENSE
|
|
66
|
+
Requires-Dist: boltons
|
|
67
|
+
Requires-Dist: click<9
|
|
68
|
+
Requires-Dist: colorama<1
|
|
69
|
+
Requires-Dist: colorlog
|
|
70
|
+
Requires-Dist: dask
|
|
71
|
+
Requires-Dist: funcy
|
|
72
|
+
Requires-Dist: influxdb
|
|
73
|
+
Requires-Dist: influxdb-client[ciso]
|
|
74
|
+
Requires-Dist: paho-mqtt
|
|
75
|
+
Requires-Dist: pandas<2.3
|
|
76
|
+
Requires-Dist: pika<1.4
|
|
77
|
+
Requires-Dist: sqlalchemy==2.0.*
|
|
78
|
+
Requires-Dist: sqlalchemy-cratedb==0.38.0
|
|
79
|
+
Requires-Dist: streamz
|
|
80
|
+
Requires-Dist: toolz
|
|
81
|
+
Provides-Extra: develop
|
|
82
|
+
Requires-Dist: black<25; extra == "develop"
|
|
83
|
+
Requires-Dist: mypy<1.11; extra == "develop"
|
|
84
|
+
Requires-Dist: pika-stubs<0.2; extra == "develop"
|
|
85
|
+
Requires-Dist: poethepoet<0.28; extra == "develop"
|
|
86
|
+
Requires-Dist: pyproject-fmt<3; extra == "develop"
|
|
87
|
+
Requires-Dist: ruff<0.5; extra == "develop"
|
|
88
|
+
Requires-Dist: validate-pyproject<0.19; extra == "develop"
|
|
89
|
+
Provides-Extra: release
|
|
90
|
+
Requires-Dist: build<2; extra == "release"
|
|
91
|
+
Requires-Dist: twine<6; extra == "release"
|
|
92
|
+
Provides-Extra: test
|
|
93
|
+
Requires-Dist: cratedb-toolkit[testing]==0.0.15; extra == "test"
|
|
94
|
+
Requires-Dist: pytest<9; extra == "test"
|
|
95
|
+
Requires-Dist: pytest-asyncio-cooperative; extra == "test"
|
|
96
|
+
Requires-Dist: pytest-cov<6; extra == "test"
|
|
97
|
+
Requires-Dist: pytest-mqtt<0.5; extra == "test"
|
|
98
|
+
Requires-Dist: testcontainer-python-rabbitmq==0.4.*; extra == "test"
|
|
99
|
+
|
|
100
|
+
###########
|
|
101
|
+
LorryStream
|
|
102
|
+
###########
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
*****
|
|
106
|
+
About
|
|
107
|
+
*****
|
|
108
|
+
|
|
109
|
+
**LorryStream** is a lightweight and polyglot stream-processing library, to
|
|
110
|
+
be used as a data backplane-, message relay-, or pipeline-subsystem, in the
|
|
111
|
+
spirit of `socat`_ and `GStreamer`_. It is based on `Streamz`_, `Dask`_, and
|
|
112
|
+
other Python libraries.
|
|
113
|
+
|
|
114
|
+
You can use **LorryStream** to store data received from the network into
|
|
115
|
+
databases, or to relay it back to the network, for example into different
|
|
116
|
+
bus systems. It can be used both as a standalone program, and as a library.
|
|
117
|
+
|
|
118
|
+
- Use as protocol translator, bridge
|
|
119
|
+
|
|
120
|
+
It is conceived to generalize and improve the corresponding subsystems of
|
|
121
|
+
programs and frameworks like `Kotori`_, `Wetterdienst`_, `Luftdatenpumpe`_,
|
|
122
|
+
`amqp-forward`_, `ttnlogger`_, `Kahn`_, or `mqttwarn`_.
|
|
123
|
+
|
|
124
|
+
Details
|
|
125
|
+
=======
|
|
126
|
+
|
|
127
|
+
- Data sources are message bus systems like AMQP, Kafka, MQTT, ZeroMQ,
|
|
128
|
+
and network listener endpoints for TCP, UDP, HTTP, and WebSocket.
|
|
129
|
+
- Data sinks are RDBMS databases supported by SQLAlchemy, or other message
|
|
130
|
+
brokers.
|
|
131
|
+
|
|
132
|
+
Motivation
|
|
133
|
+
==========
|
|
134
|
+
|
|
135
|
+
- Implement a reusable solution, simple to install and operate, that doesn't
|
|
136
|
+
depend on vendor-provided infrastructure, and can easily be embedded into
|
|
137
|
+
existing frameworks and software stacks, or integrated otherwise by running
|
|
138
|
+
it as a separate service.
|
|
139
|
+
|
|
140
|
+
- Help the community and industry to modernize their aging DAQ backend systems
|
|
141
|
+
designed within the previous decades.
|
|
142
|
+
|
|
143
|
+
Background
|
|
144
|
+
==========
|
|
145
|
+
|
|
146
|
+
Flow-Based Programming (`FBP`_) is a programming paradigm that uses a "data
|
|
147
|
+
processing factory" metaphor for designing and building applications.
|
|
148
|
+
It is a special case of `dataflow`_ programming characterized by
|
|
149
|
+
asynchronous, concurrent processes "under the covers".
|
|
150
|
+
|
|
151
|
+
FBP has been found to support improved development time and maintainability,
|
|
152
|
+
reusability, rapid prototyping, simulation, improved performance, and good
|
|
153
|
+
communication among developers, maintenance staff, users, systems people, and
|
|
154
|
+
management - not to mention that FBP naturally takes advantage of multiple
|
|
155
|
+
cores, without the programmer having to struggle with the intricacies of
|
|
156
|
+
multitasking.
|
|
157
|
+
|
|
158
|
+
-- `Flow-based Programming`_
|
|
159
|
+
|
|
160
|
+
Caveat
|
|
161
|
+
======
|
|
162
|
+
|
|
163
|
+
Please note that LorryStream is alpha-quality software, and a work in progress.
|
|
164
|
+
Contributions of all kinds are very welcome, in order to make it more solid.
|
|
165
|
+
|
|
166
|
+
Breaking changes should be expected until a 1.0 release, so version pinning
|
|
167
|
+
is recommended, especially when you use it as a library.
|
|
168
|
+
|
|
169
|
+
Only a few features sketched out in the README have actually been
|
|
170
|
+
implemented right now.
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
********
|
|
174
|
+
Synopsis
|
|
175
|
+
********
|
|
176
|
+
|
|
177
|
+
The canonical command is ``lorry relay <source> <sink>``.
|
|
178
|
+
Please note ``%23`` is ``#``.
|
|
179
|
+
|
|
180
|
+
.. code-block:: sh
|
|
181
|
+
|
|
182
|
+
lorry relay \
|
|
183
|
+
"mqtt://localhost/testdrive/%23" \
|
|
184
|
+
"crate://localhost/?table=testdrive"
|
|
185
|
+
|
|
186
|
+
If you prefer a GStreamer-like pipeline definition syntax.
|
|
187
|
+
|
|
188
|
+
.. code-block:: sh
|
|
189
|
+
|
|
190
|
+
lorry launch "mqttsrc location=mqtt://localhost/testdrive/%23 ! sqlsink location=crate://localhost/?table=testdrive"
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
**********
|
|
194
|
+
Quickstart
|
|
195
|
+
**********
|
|
196
|
+
|
|
197
|
+
If you are in a hurry, and want to run LorryStream without any installation,
|
|
198
|
+
just use the OCI image on Podman or Docker.
|
|
199
|
+
|
|
200
|
+
.. code-block:: sh
|
|
201
|
+
|
|
202
|
+
docker run --rm --network=host ghcr.io/daq-tools/lorrystream \
|
|
203
|
+
lorry relay \
|
|
204
|
+
"mqtt://localhost/testdrive/%23" \
|
|
205
|
+
"crate://localhost/?table=testdrive"
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
*****
|
|
209
|
+
Setup
|
|
210
|
+
*****
|
|
211
|
+
|
|
212
|
+
Install ``lorrystream`` from PyPI.
|
|
213
|
+
|
|
214
|
+
.. code-block:: sh
|
|
215
|
+
|
|
216
|
+
pip install lorrystream
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
*****
|
|
220
|
+
Usage
|
|
221
|
+
*****
|
|
222
|
+
|
|
223
|
+
This section outlines some example invocations of LorryStream, both on the
|
|
224
|
+
command line, and per library use. Other than the resources available from
|
|
225
|
+
the web, testing data can be acquired from the repository's `testdata`_ folder.
|
|
226
|
+
|
|
227
|
+
Prerequisites
|
|
228
|
+
=============
|
|
229
|
+
|
|
230
|
+
For properly running some of the example invocations outlined below, you will
|
|
231
|
+
need a few servers. The easiest way to spin up those instances is to use Podman
|
|
232
|
+
or Docker.
|
|
233
|
+
|
|
234
|
+
.. code-block:: sh
|
|
235
|
+
|
|
236
|
+
docker run --name=mosquitto --rm -it --publish=1883:1883 \
|
|
237
|
+
eclipse-mosquitto:2.0.15 mosquitto -c /mosquitto-no-auth.conf
|
|
238
|
+
|
|
239
|
+
-- https://github.com/docker-library/docs/blob/master/eclipse-mosquitto/README.md
|
|
240
|
+
|
|
241
|
+
.. code-block:: sh
|
|
242
|
+
|
|
243
|
+
docker run --name=cratedb --rm -it --publish=4200:4200 --publish=5432:5432 \
|
|
244
|
+
crate:5.2 -Cdiscovery.type=single-node
|
|
245
|
+
|
|
246
|
+
-- https://github.com/docker-library/docs/blob/master/crate/README.md
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
Command line use
|
|
250
|
+
================
|
|
251
|
+
|
|
252
|
+
Help
|
|
253
|
+
----
|
|
254
|
+
|
|
255
|
+
.. code-block:: sh
|
|
256
|
+
|
|
257
|
+
lorry --help
|
|
258
|
+
lorry info
|
|
259
|
+
lorry relay --help
|
|
260
|
+
|
|
261
|
+
Bus to storage
|
|
262
|
+
--------------
|
|
263
|
+
|
|
264
|
+
.. code-block:: sh
|
|
265
|
+
|
|
266
|
+
# Relay messages from MQTT to CrateDB.
|
|
267
|
+
lorry relay \
|
|
268
|
+
"mqtt://localhost/testdrive/%23" \
|
|
269
|
+
"crate://localhost/?table=testdrive"
|
|
270
|
+
|
|
271
|
+
Bus to bus
|
|
272
|
+
----------
|
|
273
|
+
|
|
274
|
+
.. code-block:: sh
|
|
275
|
+
|
|
276
|
+
# Relay messages from AMQP to MQTT.
|
|
277
|
+
lorry relay \
|
|
278
|
+
"amqp://localhost/testdrive/demo" \
|
|
279
|
+
"mqtt://localhost/testdrive/demo"
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
Library use
|
|
283
|
+
===========
|
|
284
|
+
|
|
285
|
+
.. code-block:: python
|
|
286
|
+
|
|
287
|
+
>>> from lorrystream import parse_launch
|
|
288
|
+
>>> parse_launch("mqttsrc location=mqtt://localhost/testdrive/%23 ! sqlsink location=crate://localhost/?table=testdrive")
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
OCI
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
OCI images are available on the GitHub Container Registry (GHCR). We are
|
|
295
|
+
publishing image variants for general availability- and nightly-releases,
|
|
296
|
+
and pull requests.
|
|
297
|
+
|
|
298
|
+
In order to always run the latest ``nightly`` development version, and to use a
|
|
299
|
+
shortcut for that, this section outlines how to use an alias for ``lorry``,
|
|
300
|
+
and a variable for storing the data source and sink URIs. It may be useful to
|
|
301
|
+
save a few keystrokes on subsequent invocations.
|
|
302
|
+
|
|
303
|
+
.. code-block:: sh
|
|
304
|
+
|
|
305
|
+
docker pull ghcr.io/daq-tools/lorrystream:nightly
|
|
306
|
+
alias lorry="docker run --rm --interactive ghcr.io/daq-tools/lorrystream:nightly lorry"
|
|
307
|
+
SOURCE=mqtt://localhost/testdrive/%23
|
|
308
|
+
SINK=crate://crate@localhost:4200/?table=testdrive
|
|
309
|
+
|
|
310
|
+
lorry relay "${SOURCE}" "${SINK}"
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
*******************
|
|
314
|
+
Project information
|
|
315
|
+
*******************
|
|
316
|
+
|
|
317
|
+
Resources
|
|
318
|
+
=========
|
|
319
|
+
- `Source code <https://github.com/daq-tools/lorrystream>`_
|
|
320
|
+
- `Documentation <https://github.com/daq-tools/lorrystream>`_
|
|
321
|
+
- `Python Package Index (PyPI) <https://pypi.org/project/lorrystream/>`_
|
|
322
|
+
|
|
323
|
+
Contributions
|
|
324
|
+
=============
|
|
325
|
+
The LorryStream library is an open source project, and is `managed on
|
|
326
|
+
GitHub`_.
|
|
327
|
+
Every kind of contribution, feedback, or patch, is much welcome. `Create an
|
|
328
|
+
issue`_ or submit a patch if you think we should include a new feature, or to
|
|
329
|
+
report or fix a bug.
|
|
330
|
+
|
|
331
|
+
Development
|
|
332
|
+
===========
|
|
333
|
+
In order to setup a development environment on your workstation, please head
|
|
334
|
+
over to the `development sandbox`_ documentation. When you see the software
|
|
335
|
+
tests succeed, you should be ready to start hacking.
|
|
336
|
+
|
|
337
|
+
License
|
|
338
|
+
=======
|
|
339
|
+
The project is licensed under the terms of the LGPL license, see `LICENSE`_.
|
|
340
|
+
|
|
341
|
+
Prior art
|
|
342
|
+
=========
|
|
343
|
+
We are maintaining a `list of other projects`_ with the same or similar goals
|
|
344
|
+
like LorryStream.
|
|
345
|
+
|
|
346
|
+
Kudos
|
|
347
|
+
=====
|
|
348
|
+
- `J. Paul Rodker Morrison`_ for discovering/inventing the Flow-Based
|
|
349
|
+
Programming (`FBP`_) paradigm in the late '60s.
|
|
350
|
+
|
|
351
|
+
- `Matthew Rocklin`_, `Christopher J. 'CJ' Wright`_, and `Chinmay Chandak`_
|
|
352
|
+
for conceiving `Streamz`_.
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
.. _amqp-forward: https://github.com/daq-tools/amqp-forward
|
|
357
|
+
.. _Chinmay Chandak: https://github.com/chinmaychandak
|
|
358
|
+
.. _Christopher J. 'CJ' Wright: https://github.com/CJ-Wright
|
|
359
|
+
.. _Create an issue: https://github.com/daq-tools/lorrystream/issues
|
|
360
|
+
.. _Dask: https://github.com/dask/dask
|
|
361
|
+
.. _Dataflow: https://en.wikipedia.org/wiki/Dataflow
|
|
362
|
+
.. _development sandbox: doc/development.rst
|
|
363
|
+
.. _FBP: https://en.wikipedia.org/wiki/Flow-based_programming
|
|
364
|
+
.. _Flow-based Programming: https://jpaulm.github.io/fbp/
|
|
365
|
+
.. _fsspec: https://pypi.org/project/fsspec/
|
|
366
|
+
.. _GStreamer: https://en.wikipedia.org/wiki/GStreamer
|
|
367
|
+
.. _J. Paul Rodker Morrison: https://jpaulm.github.io/
|
|
368
|
+
.. _Kahn: https://github.com/maritime-labs/kahn
|
|
369
|
+
.. _Kotori: https://github.com/daq-tools/kotori
|
|
370
|
+
.. _LICENSE: LICENSE
|
|
371
|
+
.. _list of other projects: doc/prior-art.rst
|
|
372
|
+
.. _Luftdatenpumpe: https://github.com/earthobservations/luftdatenpumpe
|
|
373
|
+
.. _managed on GitHub: https://github.com/daq-tools/lorrystream
|
|
374
|
+
.. _Matthew Rocklin: https://github.com/mrocklin
|
|
375
|
+
.. _mqttwarn: https://github.com/jpmens/mqttwarn
|
|
376
|
+
.. _pandas: https://pandas.pydata.org/
|
|
377
|
+
.. _socat: http://www.dest-unreach.org/socat/
|
|
378
|
+
.. _SQLAlchemy: https://pypi.org/project/SQLAlchemy/
|
|
379
|
+
.. _Streamz: https://github.com/python-streamz/streamz
|
|
380
|
+
.. _testdata: https://github.com/daq-tools/lorrystream/tree/main/tests/testdata
|
|
381
|
+
.. _ttnlogger: https://github.com/daq-tools/ttnlogger
|
|
382
|
+
.. _Wetterdienst: https://github.com/earthobservations/wetterdienst/
|