Skip to main content

log-processor-py

Simple Python processors to send an array of messages to a channel and to log an incoming stream to the RDF-Connect logging system.

Usage

To use the Python rdfc:LogProcessorPy or rdfc:SendProcessorPy in your RDF-Connect pipeline, you need to have a pipeline configuration that includes the rdfc:PyRunner (check out their documentation to find out how to install and configure it).

You can install the Python runner package using the following command:

uv add rdfc_log-processor

Next, you can add the processors to your pipeline configuration as follows:

@prefix rdfc: <https://w3id.org/rdf-connect#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.

# Import the processor
<> owl:imports <./.venv/lib/python3.13/site-packages/rdfc_log_processor/processor.ttl>.

### Define the channels your processor needs
<channel> a rdfc:Writer, rdfc:Reader.

# Attach the processor to the pipeline under the PyRunner
# Add the `rdfc:processor <send>, <log>` statement under the `rdfc:consistsOf` statement of the `rdfc:PyRunner`

### Define and configure the processors
<send> a rdfc:SendProcessorPy;
       rdfc:writer <channel>;
       rdfc:msg "Hello, World!", "Good afternoon, World!",
                "Good evening, World!", "Good night, World!".

<log> a rdfc:LogProcessorPy;
      rdfc:reader <channel>;
      rdfc:level "info";
      rdfc:label "test".

Configuration

Parameters of rdfc:SendProcessorPy:

  • rdfc:writer: The channel to which the processor will write messages.
  • rdfc:msg: The messages to be sent by the processor.

Parameters of rdfc:LogProcessorPy:

  • rdfc:reader: The channel from which the processor will read messages.
  • rdfc:writer: The channel to which the processor will write log messages (optional).
  • rdfc:level: The log level to use (e.g., "debug", "info", "warning", "error", "critical"). Defaults to "info".
  • rdfc:label: A label for the log messages, which can be used to filter or categorize logs. Defaults to "log".
  • rdfc:raw: If set to true, the processor will log raw messages to stdout without any formatting instead of to the RDF-Connect logging system. Defaults to false.

Development

The Packaging Python Projects guide was used to set up this project. As build backend, the default Hatchling is used, for which the pyproject.toml file is configured. That file tells build frontend tools like pip which backend to use. This project uses uv as package manager.

First, make sure you have Hatch installed:

pip install hatch
# OR
brew install hatch
# OR another method of your choice

Then, create a virtual environment and spawn a shell. This will automatically install the project dependencies defined in pyproject.toml:

hatch env create
hatch shell

You can build the project with:

hatch build

You can run the tests using:

hatch test

Lastly, you can publish the package to PyPI with:

hatch publish

Project Structure

log-processor-py/             # Root directory of the project
├── src/                      # Source code directory
│   └── rdfc_log_processor/   # Package directory
│       ├── __init__.py       # Package initialization, allows importing as a regular package
│       ├── processor.py      # Contains the main logic for the Python processor
│       └── processor.ttl     # RDF schema for the processor, used for metadata and configuration
├── tests/                    # Directory for unit tests
├── pyproject.toml            # Project metadata and build configuration

Metadata

Release files for rdfc_log-processor 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rdfc_log-processor 1.0.0
File Size Uploaded Provenance Actions
rdfc_log_processor-1.0.0.tar.gz 16.6 kB Without provenance Details for rdfc_log_processor-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rdfc_log-processor 1.0.0
File Interpreter ABI Platform Actions
rdfc_log_processor-1.0.0-py3-none-any.whl Python 3 none any Details for rdfc_log_processor-1.0.0-py3-none-any.whl

Total release size: 21.8 kB

Release files / rdfc_log_processor-1.0.0.tar.gz

Download URL rdfc_log_processor-1.0.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
854e897a8c174b9358d72455d73fadcf8119b464a1e043501386f18600c4843c
BLAKE2b-256 checksum
How to use checksums
23e8579128efd512ed56f8dd05d5009aa0fdb96af01e25cf0b64157af359e085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / rdfc_log_processor-1.0.0-py3-none-any.whl

Download URL rdfc_log_processor-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23c24b3ffa8dd9cdbaea4956ffbc2ae08313e66636a8742e0e91acadc44b7094
BLAKE2b-256 checksum
How to use checksums
5cacd0f475807d365fa7e74c8cb1bf303aead09224e3bbadbf26098a037bff1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for rdfc_log-processor 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page