Skip to main content

insightfactory-sdk

Async Python client for the Insight Factory REST API.

from insightfactory_sdk import ApiClient, Configuration
from insightfactory_sdk.api.tasks_api import TasksApi

config = Configuration(
    host="https://your-factory.insightfactory.ai", access_token=token
)

async with ApiClient(config) as client:
    tasks = await TasksApi(client).tasks_get()

Every operation is async and non-blocking, over a pooled httpx.AsyncClient. Each also has a _sync twin for scripts and notebooks — note this builds its own client, outside any async with block:

sync_client = ApiClient(config)
tasks = TasksApi(sync_client).tasks_get_sync()

_sync runs the coroutine on a dedicated background event loop, so it must not be called from inside async code — await the async method there instead.

Don't mix the two on one ApiClient. The connection pool is created on the first request and bound to whichever loop issued it, so a client used both ways binds its pool to one loop and fails on the other — usually as an Event loop is closed far from the call that caused it. Use a separate client for each style.

Layout

path
src/insightfactory_sdk/ generated — do not hand-edit, make generate overwrites it
openapi/swagger.json the spec the client is generated from
tools/patch_spec.py assigns operationIds so methods get readable names
tools/operation_id_overrides.json hand-chosen names where the path doesn't state intent
tests/ hand-written

Only the package tree is copied out of the generator's output, so pyproject.toml, this README and CI are never at risk of being clobbered — there is no .openapi-generator-ignore to keep in sync.

Regenerating

make regen     # fetch the latest spec, then regenerate
make generate  # regenerate from the committed spec
make lint test # what CI runs

make test-integration          # live read-only tests (token via if-cli)
make test-integration-writes   # plus the write paths

make check-drift regenerates and fails if the committed client is stale — wire it into CI so a new endpoint can't ship without the SDK catching up.

Method names come from operationIds. The API does not currently emit any, so patch_spec.py derives them from tag, path and verb before generation. It skips any operation that already has one, so when the API starts supplying its own (CustomOperationIds in if_fc_interfaces_api) this step becomes a no-op and both it and the overrides file can be deleted.

Versioning

pyproject.toml is the single source of truth. The Makefile passes it to the generator as packageVersion, so the wheel and insightfactory_sdk.__version__ cannot drift; a test asserts it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insightfactory_sdk-8.0.6.tar.gz (432.5 kB view details)

Uploaded Source

Built Distribution

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

insightfactory_sdk-8.0.6-py3-none-any.whl (730.7 kB view details)

Uploaded Python 3

File details

Details for the file insightfactory_sdk-8.0.6.tar.gz.

File metadata

  • Download URL: insightfactory_sdk-8.0.6.tar.gz
  • Upload date:
  • Size: 432.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for insightfactory_sdk-8.0.6.tar.gz
Algorithm Hash digest
SHA256 ad8726bc8a5a70c0b88ccf90013b3f404af142b56663beaf87e0da70c917561b
MD5 18db9bd736a0cb8db58f7a3317c0b7a7
BLAKE2b-256 834e35a980085a11de91f9cdadd9ead88920fd77ffbabc6d6142fd91597f7d66

See more details on using hashes here.

Provenance

The following attestation bundles were made for insightfactory_sdk-8.0.6.tar.gz:

Publisher: release.yml on insightfactory-ai/insightfactory-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file insightfactory_sdk-8.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for insightfactory_sdk-8.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f598b0fbec43b5030359f0a2f59ea8d32be71f000d20d7b443d26c8b01454f
MD5 200664c0a0cea47abce1e8586c0459d8
BLAKE2b-256 1b5910e1be633c095e9514c35b01ee96b5162f8dd48650e018dff784434dd0a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for insightfactory_sdk-8.0.6-py3-none-any.whl:

Publisher: release.yml on insightfactory-ai/insightfactory-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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