Skip to main content

Cogniflow basic I/O StepPackage with optional C++ acceleration.

Project description

cf-basic-io

Cogniflow I/O StepPackage providing data source and sink steps.

Steps

Step Category Description
cfio:HandleSinkStep sink Persist data to DuckDB, CSV, or other handles
cfio:OpcuaReaderStep source Read configured values from an OPC-UA server
cfio:JsonFieldSelectStep structural Extract one field from a JSON payload
cfio:TimestampToEpochStep structural Convert ISO-8601 timestamp to epoch seconds
cfio:EpochToTimestampStep structural Convert epoch seconds to ISO-8601 timestamp
cfio:ReportChartStep sink Render chart output for reporting
cfio:ReportTableStep sink Render table output for reporting
cfio:StatsRowStep structural Assemble structured row outputs

Dev/demo steps (cfbd:InlineSource, cfbd:OpcuaPhSource) now live in cf-basic-dev. Data hive parquet persistence now lives in cf-basic-sinks as cfsink:DataHiveParquetSinkStep.

Pipeline backend operations

The package also registers pipeline backend operations:

Operation Type Description
handle_sink python Persist via duckdb:// or csv:// handles
duckdb_checkpoint cpp Checkpoint pipeline state to DuckDB
duckdb_resume_from_checkpoint cpp Resume from checkpoint
duckdb_sql cpp Execute SQL on checkpoint data

Installation

pip install cf-basic-io

With optional dependencies:

pip install cf-basic-io[duckdb]   # DuckDB sink support
pip install cf-basic-io[all]      # All optional deps (currently duckdb)

Virtual OPC UA pH server

The demo OPC UA server lives in the separate cf-opcua-server package.

pip install cf-opcua-server
cf-opcua-server start --interval 0.5
# or:
python -m cf_opcua_server.cli start --interval 0.5
# server runs at opc.tcp://127.0.0.1:4840/VirtualPhServer with pH/temperature nodes under ns=2

cfbd:OpcuaPhSource (from cf-basic-dev) is a pure reader and does not start servers; run the demo server externally.

C++ Extensions

Optional native extensions for high-performance pipeline operations:

  • _duckdb_backend_ops - DuckDB checkpoint/resume (requires DuckDB C++ library)
  • _opcua_backend_ops - OPC-UA read via open62541

Build with C++ extensions:

CF_BASIC_IO_ENABLE_DUCKDB_CPP=1 pip install .
CF_BASIC_IO_ENABLE_OPCUA_CPP=1 pip install .

If you run the repo's factory reset script, native deps are staged in .native_deps/duckdb / .native_deps/open62541; the build now auto-detects those paths so a fresh install will attempt to compile the C++ ops without extra env vars.

Usage

from cf_basic_io.steps import handle_sink

# Write to DuckDB
handle_sink({"value": 42}, "duckdb:///output.duckdb?table=results")

StepPackage Integration

This package registers with Cogniflow via the cogniflow.steps entry point and ships steps.jsonld as its sole manifest. The cf:StepPackage node declares cf:packageId cf.basic.io.

Publishing

cf_basic_io is published with the dedicated Windows workflow:

  • Workflow: .github/workflows/cf_basic_io_windows_publish.yml
  • Package directory: sandcastle/cf_basic_steps/cf_basic_io
  • PyPI tag: cf-basic-io-v<version>
  • TestPyPI tag: cf-basic-io-v<version>-test

The initial publish path validates the default package build. Optional native extras such as OPC-UA support remain opt-in and are not required for the first publish workflow.

Local preflight:

powershell -ExecutionPolicy Bypass -File scripts/mimic_windows_python_publish_workflow.ps1 `
  -WorkflowFile .github/workflows/cf_basic_io_windows_publish.yml `
  -PackageDir sandcastle/cf_basic_steps/cf_basic_io `
  -PythonExe py `
  -PythonVersion 3.13

Queue a dry-run dispatch:

powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
  -WorkflowFile .github/workflows/cf_basic_io_windows_publish.yml `
  -PackageDir sandcastle/cf_basic_steps/cf_basic_io `
  -PublishTarget testpypi `
  -Ref main `
  -RequireLocalPass `
  -DryRun

Watch queued runs:

gh run list --workflow cf_basic_io_windows_publish.yml --limit 10
gh run watch --exit-status

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

cf_basic_io-0.1.2.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cf_basic_io-0.1.2-cp313-cp313-win_amd64.whl (33.1 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file cf_basic_io-0.1.2.tar.gz.

File metadata

  • Download URL: cf_basic_io-0.1.2.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for cf_basic_io-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d98cb047b8c20ed9269bfccc11eca9fbe44fd3b09bf5bba7b6352322cdd3ee66
MD5 9cf651e4aad9d58688599c6a2d7a6a07
BLAKE2b-256 18cda50023508fc91316c12527e4e104e29db2b85ae383dd6c28ec7b4633da61

See more details on using hashes here.

File details

Details for the file cf_basic_io-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cf_basic_io-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dc9297d57a7a843ab33f83e7496943ce3c9564fa7d37dee845c7e71ab38bb69a
MD5 7036f7c1f8c27cff02840c061063abee
BLAKE2b-256 3693ed813f240c6b4f50e3b25fdc1df53ae846db5d45799925d3d1ed0eaac7d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page