Skip to main content

pinexq-procon-io

I/O utilities for the pinexq ecosystem. This package provides reader and writer callables for common data formats — JSON (via Pydantic), Apache Parquet, Matplotlib figures, and Plotly JSON — designed to plug directly into pinexq-procon dataslot annotations.

How readers and writers work with dataslots

In pinexq-procon, a processing step declares its inputs and outputs through @dataslot annotations. Each annotation accepts a reader or writer callable that handles serialization:

  • dataslot.input(reader=...) — the reader is called with a file-like object and must return the deserialized data.
  • dataslot.output(writer=...) — the writer is called with a file-like object and the data to serialize.
  • dataslot.returns(writer=...) — same as output, but for the function's return value.

The functions in pinexq.procon.io follow exactly these signatures (Callable[[IO], T] for readers, Callable[[IO, T], None] for writers) so they can be passed directly to a dataslot annotation.

Example

from pinexq.procon.dataslots import dataslot, MediaTypes
from pinexq.procon.io import pydantic_reader, base_model_dump_json
from pinexq.procon.io.parquet import parquet_buffer_reader, parquet_buffer_writer
from pinexq.procon.io.matplotlib import figure_to_png_buffer
from pydantic import BaseModel


class Config(BaseModel):
    threshold: float


@dataslot.input("config", media_type=MediaTypes.JSON, reader=pydantic_reader(Config))
@dataslot.input("data_in", media_type=MediaTypes.OCTETSTREAM, reader=parquet_buffer_reader)
@dataslot.output("data_out", media_type=MediaTypes.OCTETSTREAM, writer=parquet_buffer_writer)
@dataslot.returns(media_type=MediaTypes.PNG, writer=figure_to_png_buffer)
def process(config: Config, data_in, data_out, **kwargs):
    # config is already deserialized into a Config instance by pydantic_reader
    # data_in is already a pandas DataFrame via parquet_buffer_reader
    filtered = data_in[data_in["value"] > config.threshold]
    # data_out will be serialized to Parquet via parquet_buffer_writer
    data_out = filtered
    # the returned figure will be written as PNG via figure_to_png_buffer
    return create_plot(filtered)

Installation

From GitHub

pip install git+https://github.com/data-cybernetics/pinexq-procon-io.git

Or with uv:

uv add git+https://github.com/data-cybernetics/pinexq-procon-io.git

From source

git clone https://github.com/data-cybernetics/pinexq-procon-io.git
cd pinexq-procon-io
pip install .

Optional extras

The core package only depends on Pydantic. Heavier I/O dependencies are available as optional extras so you only install what you need.

Parquet

Adds support for reading and writing Apache Parquet buffers via pandas and PyArrow.

pip install "pinexq-procon-io[parquet] @ git+https://github.com/data-cybernetics/pinexq-procon-io.git"
from pinexq.procon.io.parquet import parquet_buffer_writer, parquet_buffer_reader

Matplotlib

Adds support for serializing Matplotlib figures to PNG buffers.

pip install "pinexq-procon-io[matplotlib] @ git+https://github.com/data-cybernetics/pinexq-procon-io.git"
from pinexq.procon.io.matplotlib import figure_to_png_buffer

Plotly

Adds support for writing pandas DataFrames as Plotly-compatible JSON (uses scipy sparse arrays internally).

pip install "pinexq-procon-io[plotly] @ git+https://github.com/data-cybernetics/pinexq-procon-io.git"
from pinexq.procon.io.plotly import plotly_json_writer

Installing all extras

pip install "pinexq-procon-io[parquet,matplotlib,plotly] @ git+https://github.com/data-cybernetics/pinexq-procon-io.git"

Usage

JSON / Pydantic helpers

The core module provides helpers for reading and writing JSON via Pydantic models and plain dicts:

from pinexq.procon.io import dict_2_json_writer, base_model_dump_json, pydantic_reader

Parquet helpers (requires parquet extra)

from pinexq.procon.io.parquet import parquet_buffer_writer, parquet_buffer_reader

Matplotlib helpers (requires matplotlib extra)

from pinexq.procon.io.matplotlib import figure_to_png_buffer

Plotly helpers (requires plotly extra)

from pinexq.procon.io.plotly import plotly_json_writer, to_plotly_json

Development

This project uses uv for dependency management.

git clone https://github.com/data-cybernetics/pinexq-procon-io.git
cd pinexq-procon-io
uv sync --all-extras

Namespace package

This package uses PEP 420 implicit namespace packages. The pinexq and pinexq.procon namespaces are shared and can be extended by other distributions in the pinexq family.

Metadata

Release files for pinexq-procon-io 0.1.1

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

Source distribution (sdist)

Source distribution for pinexq-procon-io 0.1.1
File Size Uploaded Provenance
pinexq_procon_io-0.1.1.tar.gz 4.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pinexq-procon-io 0.1.1
File Interpreter ABI Platform
pinexq_procon_io-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / pinexq_procon_io-0.1.1.tar.gz

Download URL pinexq_procon_io-0.1.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
248423610387f2a9a7694ec1c472c953dbe5cfae34b554d9d99b8f99fb1a6b35
BLAKE2b-256 checksum
How to use checksums
73382ee5cc0704999ca72a98dad77741b480b63fb727bc6854a76ca9823ddbac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2026.

Transparency log

Release files / pinexq_procon_io-0.1.1-py3-none-any.whl

Download URL pinexq_procon_io-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34e5bb021cea47705f4b8a6b5eb6fad31a0ea8500f99b32c9387c1c1eb025c2f
BLAKE2b-256 checksum
How to use checksums
96452aa66ca0858c9df98a2731c5f964e6acce914e25f3fae466ad1d26f776dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2026.

Transparency log

Security for pinexq-procon-io 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pinexq_procon_io-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2026.

Transparency log

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

0.1.1 This release

2 release files Full 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