Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.0 instead.
Reason given by maintainers: binary reports the wrong version; superseded by 0.1.1

cognix-sdk

Se instala cognix-sdk y se importa cgx, como pillow→PIL. En PyPI, cognix es de otro proyecto y cgx está reservado por alguien más; cgx es el identificador que CogniX ya usa en sus API keys (cgx_<feature>_…), así que se queda en el módulo y en el binario.

Empaqueta tu modelo como un bundle de CogniX y compruébalo en tu máquina antes de publicarlo.

uv add cognix-sdk
uv add "cognix-sdk[sklearn]"   # si quieres exportar un modelo de scikit-learn a ONNX

Qué problema resuelve

El modelo lo entrenas tú, con lo que quieras. Lo que hay que hacer bien es el artefacto, y ahí hay una trampa que no da ningún error:

el extractor de features se escribe dos veces — tu featurize() en Python para entrenar, y features.star (Starlark) que evalúa Go en producción. Cuando se separan, el modelo sigue contestando: sólo que sobre otra entrada.

No hay excepción, ni traza, ni métrica que baje. Este paquete existe para que eso falle en tu portátil.

Uso

import cgx
from cgx import starlark
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler

# 1. tus datos (exportados con: wolfctl exports download-export --id <uuid> > datos.parquet)
df = pd.DataFrame([json.loads(r) for r in pd.read_parquet("datos.parquet")["RESULT"]])
schema = ["current_a", "vibration", "temperature"]

# 2. tu modelo, como lo entrenas siempre
scaler = StandardScaler().fit(df[schema].to_numpy())
clf = LogisticRegression(max_iter=1000).fit(scaler.transform(df[schema].to_numpy()), df["fault_label"])

# 3. el artefacto
onnx = cgx.to_onnx(clf, n_features=len(schema))

b = cgx.Bundle(
    domain="motor_faults",
    feature="classix",
    schema=schema,
    featurizer=starlark.identity_featurizer(schema),
    starlark=starlark.identity("motor_faults", schema),
    onnx_path=onnx,
    output_names=cgx.onnx.scores_output(onnx),   # el tensor de scores, no `label`
    output_kind="probabilities",                    # skl2onnx ya las emite normalizadas
    payloads=df[schema].head(8).to_dict("records"),   # payloads representativos
    labels=sorted(df["fault_label"].unique()),
    mean=scaler.mean_.tolist(),
    std=scaler.scale_.tolist(),
)

b.check()        # escribe el bundle y lo verifica; levanta BundleError si algo no cuadra

check() hace dos cosas, en este orden:

  1. En Python: que tu featurize() devuelva tantos números como features declaras, para cada payload. Un fallo aquí es tuyo y se ve al instante.
  2. Con el binario cgx, que viene dentro de este paquete: valida el manifest contra el contrato de la feature y corre verify-parity — tu Python contra el Starlark real.

El paso 2 lo hace el binario, no una reimplementación de Starlark en Python. Un segundo intérprete sería una segunda implementación que puede diferir del motor de producción, o sea el mismo problema que esto viene a detectar, movido un nivel. Si el binario no está en el PATH, check() lo dice y no finge un OK.

Falta una tercera comprobación, verify-bundle, que reproduce el resultado completo —clase, probabilidades, puerta OOD— contra una fixture grabada al entrenar. Esa ejecuta el modelo, o sea el motor, y vive en el binario cognix: si lo tienes en el PATH, check() lo usa; si no, dice exactamente qué queda sin cubrir. Un bundle traído de fuera casi nunca trae esa fixture de todos modos, porque la escribe el trainer de la feature.

Y ya se puede servir:

cognix classix serve --bundles dist
cognix classix infer --bundle dist/motor_faults --json '{"current_a":18.5,"vibration":1.2,"temperature":97.0}'

Si tu featurización no es la identidad

starlark.identity() sólo cubre el caso "cada feature es un campo numérico del payload". Para cualquier otra cosa —una razón entre dos campos, un one-hot, una saturación— escribes tu features.star a mano y se lo pasas en starlark=.

⛔ No hay traducción automática de Python a Starlark, y es deliberado. Traducir un featurize() cualquiera leyendo su AST es la funcionalidad que enamora y la que puede traducir mal en silencio — exactamente la clase de fallo que este SDK existe para cazar. check() funciona con el extractor que sea, y esa es la garantía que importa.

Lo que este paquete NO es

No es un cliente de la API REST de WolfOps, y no lo será a mano: un wrapper de ~100 endpoints envejece con cada endpoint nuevo y se convierte en otro sitio donde algo se queda fuera en silencio. Para los datos ya tienes dos líneas que no hay que mantener:

wolfctl exports download-export --id <uuid> > datos.parquet
df = pd.read_parquet("datos.parquet")

Su contrato es el formato del bundle (v3), que está versionado y cambia a propósito, no una superficie que cambia cada semana.

Referencia

Bundle(...) el artefacto: .manifest(), .payload_schema(), .save(dir), .check(dir)
to_onnx(model, n_features) export de scikit-learn con el opset y la salida que espera el motor
starlark.identity(domain, schema) el features.star del caso identidad
starlark.identity_featurizer(schema) su gemelo Python, para pasarlo a featurizer=

El bloque de tarea de cada feature (calibración, intervalos conformes, puerta OOD, fallbacks) se declara en extra_manifest=: es lo específico de cada una y pertenece a la feature, no a este paquete.

Release files for cognix-sdk 0.1.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 cognix-sdk 0.1.0
File Size Uploaded
cognix_sdk-0.1.0.tar.gz 35.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for cognix-sdk 0.1.0
File
cognix_sdk-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
cognix_sdk-0.1.0-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
cognix_sdk-0.1.0-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
cognix_sdk-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
cognix_sdk-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
cognix_sdk-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
cognix_sdk-0.1.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details
cognix_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 MB

Release files / cognix_sdk-0.1.0.tar.gz

Download URL cognix_sdk-0.1.0.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4436999e8855f6f1281024b7b8e495d75b11d039d39ee5249efe8baccaf9dfd
BLAKE2b-256 checksum
How to use checksums
05f4dd484dce87790067bc32264fe91140664c34e396f2ac8ffe07d536689414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-win_amd64.whl

Download URL cognix_sdk-0.1.0-py3-none-win_amd64.whl
Size 1.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e369a5ec60f6760756cd48840578f202c153bf69c3e5da0cfcf48f8ca23a4514
BLAKE2b-256 checksum
How to use checksums
2e5d0c06f012b064f69752f7d908ffbc736ec48e22c11ccd9b0777ad5e1fe5b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-musllinux_1_2_x86_64.whl

Download URL cognix_sdk-0.1.0-py3-none-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e85795c1521919238deef83bf796d32de6c848c07cde97769458b2d126e15dd7
BLAKE2b-256 checksum
How to use checksums
9ed6e45651504dfe6574fdba5a2044c8bc28aaf28a35ff57f656073760e950e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-musllinux_1_2_aarch64.whl

Download URL cognix_sdk-0.1.0-py3-none-musllinux_1_2_aarch64.whl
Size 1.5 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
448ed64bf761439c77dc6080b497ecdc84f5f9cede483461160d80dedd316fb3
BLAKE2b-256 checksum
How to use checksums
d5c4b196330e547ef32a3c82f5649844ec9bb5cc2df8d2370754131ee8979f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cognix_sdk-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f5b3aac6878f9da8d4eb0145df9e1b98be4c0af449b31237268f6b849f13b87e
BLAKE2b-256 checksum
How to use checksums
8084dc16439889756c75fe29b419531c99c892a1113ebca64d0669c802dca3ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL cognix_sdk-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b3530d94f0aa9f1e7ad3f2df00959d49afa67457a1e83108a1f67ebe882b0b87
BLAKE2b-256 checksum
How to use checksums
0b7525281dce84bdbe66c73a5a4b43249f21324f2cfa3f58602f14169f2d8a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-macosx_11_0_arm64.whl

Download URL cognix_sdk-0.1.0-py3-none-macosx_11_0_arm64.whl
Size 1.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
df66d0f7ab79bb1840f08a58511012ab7e4d94848347242021ffa703863d2321
BLAKE2b-256 checksum
How to use checksums
8e38cb9d583be6572fd990cc9105080ab512050e35a097dd3c18b4233c140c71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-macosx_10_12_x86_64.whl

Download URL cognix_sdk-0.1.0-py3-none-macosx_10_12_x86_64.whl
Size 1.7 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8f3368717c1f07b626ee3a47a036e00e3d6e6a3b35bb3e504790f089ad6c66b1
BLAKE2b-256 checksum
How to use checksums
7f63d4ab024b6eead5a6914340182f2a0dead8742e28ba019a64794062d32a4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release files / cognix_sdk-0.1.0-py3-none-any.whl

Download URL cognix_sdk-0.1.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d38f422df83c1d3ba286689d706c0b58a2a7472e7e9448c2a7bebeee4ee87d00
BLAKE2b-256 checksum
How to use checksums
d0006cd4adc3fb69db860fafb2470a499cc29b9558687b9d617e0d137a3e698d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

9 release files

0.1.4

9 release files

0.1.3

9 release files

0.1.2

9 release files

0.1.1

9 release files

This release

0.1.0 This release

9 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