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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad8726bc8a5a70c0b88ccf90013b3f404af142b56663beaf87e0da70c917561b
|
|
| MD5 |
18db9bd736a0cb8db58f7a3317c0b7a7
|
|
| BLAKE2b-256 |
834e35a980085a11de91f9cdadd9ead88920fd77ffbabc6d6142fd91597f7d66
|
Provenance
The following attestation bundles were made for insightfactory_sdk-8.0.6.tar.gz:
Publisher:
release.yml on insightfactory-ai/insightfactory-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
insightfactory_sdk-8.0.6.tar.gz -
Subject digest:
ad8726bc8a5a70c0b88ccf90013b3f404af142b56663beaf87e0da70c917561b - Sigstore transparency entry: 2429751506
- Sigstore integration time:
-
Permalink:
insightfactory-ai/insightfactory-sdk@1347954a49778c74ea3a6055e39c2b535abbab58 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/insightfactory-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1347954a49778c74ea3a6055e39c2b535abbab58 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file insightfactory_sdk-8.0.6-py3-none-any.whl.
File metadata
- Download URL: insightfactory_sdk-8.0.6-py3-none-any.whl
- Upload date:
- Size: 730.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3f598b0fbec43b5030359f0a2f59ea8d32be71f000d20d7b443d26c8b01454f
|
|
| MD5 |
200664c0a0cea47abce1e8586c0459d8
|
|
| BLAKE2b-256 |
1b5910e1be633c095e9514c35b01ee96b5162f8dd48650e018dff784434dd0a5
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
insightfactory_sdk-8.0.6-py3-none-any.whl -
Subject digest:
e3f598b0fbec43b5030359f0a2f59ea8d32be71f000d20d7b443d26c8b01454f - Sigstore transparency entry: 2429751551
- Sigstore integration time:
-
Permalink:
insightfactory-ai/insightfactory-sdk@1347954a49778c74ea3a6055e39c2b535abbab58 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/insightfactory-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1347954a49778c74ea3a6055e39c2b535abbab58 -
Trigger Event:
workflow_run
-
Statement type: