This is the Python binding for reading Dozer logs.
pip install pydozer_log
This library contains native code so have limited platform support.
If above command gives you:
ERROR: Could not find a version that satisfies the requirement pydozer_log (from versions: none)
ERROR: No matching distribution found for pydozer_log
it means your platform is not supported.
As a general rule, we support CPython >= 3.10 on Windows, MacOS and Linux, both amd and arm architectures. Meanwhile, some other versions of PyPy and CPython with certain platform combinations are also supported.
To see all supported platforms, please check the file list at https://pypi.org/project/pydozer-log/#files.
Assume your have Dozer running and the app is listening to http://127.0.0.1:50053
, and you have an endpoint named trips
. You can read the Dozer logs in Python as follows:
import pydozer_log
reader = await pydozer_log.LogReader.new('http://127.0.0.1:50053', 'trips')
print(await reader.next_op())
Install maturin
in your Python environment:
pip install maturin
Install the development version of dozer-log-python
:
maturin develop --features python-extension-module
The whole library is behind a feature flag, so you need to specify --features python-extension-module
to enable it.
This is a known issue of pyo3
.
See PyO3 for more information.
From the repository root:
python examples/reader.py