Skip to main content

kcai-data-sampling

The command-line front door to kcai data-sampling, and the place its pieces are composed.

A transformation is one fully specified operation,

T : x ↦ x'

taking one input sample to one output sample in the same space — an algorithm, its resolved parameters, a seed where it draws randomness, and a model where one is involved. This package installs the core contracts that define that operation and the CLI that inspects it. Every method, and every piece of IO, lives in a separate package you add yourself.

What it ships today

  • version — the installed versions of the umbrella, the core, and the job / images members when present.
  • list — every registered plugin, grouped into transformations, models, dataloaders and output writers.
  • process — run a sampling job from a YAML configuration. Available only when the job package is installed; see the [job] extra below.

Install

pip install kcai-data-sampling

That is the base install, and it is deliberately small: the core library plus the CLI. It resolves to two distributions and nothing more.

A consequence worth knowing: because the CLI builds its command list from what is actually importable, a base install gives you a working kcai-data-sampling with version and list — and no process. That is not a broken install; it is the designed default. version reports the absent members rather than hiding them:

kcai-data-sampling: 0.1.0
core: 0.1.0
job: None
images: None
fgsm: None
lama: None

Every member is listed whether or not it is installed, so this is also the quickest way to confirm a large extra landed: [lama] pulls CPU or CUDA torch, and lama: None tells you it did not. Add the extra for the surface you want and the matching command appears.

Extras

Extra Adds Notes
job the job package: the process command, the parquet dataloader, and the images and parquet output writers the YAML pipeline; also where image-file handling and Pillow live
images horizontal_flip and crop_resize, plus the image batch type numpy only
fgsm the fgsm attack numpy only, no torch
lama inpaint and the lama_inpaint tool model pulls torch; the checkpoint is fetched on first use
notebooks pandas, python-pptx, ipykernel and ultralytics — for reading and plotting results installs no fgsm and no lama; still resolves torch, because ultralytics depends on it
all every row above the recipe to use if you want the whole set

Install one, or combine them:

pip install "kcai-data-sampling[job,images]"
pip install "kcai-data-sampling[all]"

The extras are independent — asking for [job] installs the job package and leaves the image methods out — so a project can compose exactly the surface it needs. kcai-data-sampling version is the quickest way to see what a given install actually resolved to.

The three families

Methods are grouped by the model's role, not chosen by hand:

Model role Family Meaning
no model procedural computed from the input sample alone
tool generative the model produces the output content
target adversarial the model's response enters the computation

Two more properties hold across all of them. Transformations listed together are applied independently to the same source sample, not chained. And whether an output is a perturbation, an augmentation or a corruption is read off the input/output pair afterwards — it is not declared by the algorithm.

Running a job

With the job extra installed:

kcai-data-sampling process -p config.yaml
dataloaders:
  loaders:
    - name: images
      type: parquet
      path: /path/to/samples.parquet
      id_column: id
      load_batch_size: 10
      decode: img_bytes
      sample_path:
        - column: path
          prefix: /path/to/images

operations:
  outputs:
    path: /path/to/outputs/{selection}/ledger.parquet
    write_samples: true
    samples_dir: /path/to/outputs/{selection}/payloads
  transformations:
    - name: horizontal_flip
      type: horizontal_flip

Each run writes a ledger — one metadata-only row per generated sample, recording its lineage and the algorithm's declaration — and the payloads beside it as content-addressed files.

Where to go next

The sibling packages each document one thing: the core contracts and how to add your own method, the procedural slot, the job's orchestration, and the generative and adversarial slots. Their names are the distribution names, and each is installed through the matching extra above.

Metadata

Release files for kcai-data-sampling 0.8.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 kcai-data-sampling 0.8.0
File Size Uploaded
kcai_data_sampling-0.8.0.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kcai-data-sampling 0.8.0
File Interpreter ABI Platform
kcai_data_sampling-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / kcai_data_sampling-0.8.0.tar.gz

Download URL kcai_data_sampling-0.8.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
be242b329cfc3f1d49e288a133d1667a3e7393a3a0c9d52c71d260f2949f768d
BLAKE2b-256 checksum
How to use checksums
e68f5dcc132e86a8978b49e20fc274c1d4859acabc9512f49bc6310b75f4738d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.17

Release files / kcai_data_sampling-0.8.0-py3-none-any.whl

Download URL kcai_data_sampling-0.8.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
047dd808088cb2f8e1641fb867ca60962c78259367834fc06cd2a8235a8df454
BLAKE2b-256 checksum
How to use checksums
5d44d30d8354792b6e4b0c8a90ca237c04b85bb05eeb588e9c5e92946a90b794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.17

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

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