Skip to main content

NEES Python SDK v0.2.0

nees-core-sdk is the synchronous Python client for NEES Core V2's supported public application-integration contracts. It is application-neutral: the SDK does not include product adapters, policy machinery, administrative controls, or Core internals.

Install with pip install nees-core-sdk (Python 3.9+), then set NEES_API_KEY or pass api_key=. Remote endpoints must use HTTPS; HTTP is accepted only for localhost development.

from nees import NEESClient

client = NEESClient()
reply = client.chat("Hello", session_id="session-123", user_id="user-123")
print(reply.reply)

SDK v0.2.0 supports API-key-scoped chat, session-memory read/reset, safe chat evidence, Core-owned governed action submit/resume/evidence, and the complete application-owned external-action lifecycle. Use get_external_action() and get_external_action_evidence() for lifecycle status and evidence.

For Core-owned actions, submit through the configured application action reference and resume only when Core requests clarification or supplies an approval continuation:

action = client.submit_action("my-app.safe-operation.v1", session_id="s-1")
if action.execution_paused:
    action = client.resume_action(action.action_id, clarifications={"context": "current"})
evidence = client.get_action_evidence(action.action_id)
from nees import ActionProposal, NEESClient

client = NEESClient()
proposal = ActionProposal("send_message", "recipient:example", {"body": "Hello"})
action = client.submit_external_action("my-app.message.v1", session_id="s-1", proposal=proposal)

# ALLOW is not permission to perform the effect. Redeem the exact permit first.
started = client.start_external_action(
    action.action_id, permit_ref=action.permit_ref, session_id="s-1", proposal=proposal
)
if started.execution_authorized:
    # The application performs its own external effect here.
    client.report_external_result(
        action.action_id, permit_ref=action.permit_ref, session_id="s-1",
        status="succeeded", observed_result="Application completed the effect."
    )
evidence = client.get_external_action_evidence(action.action_id)

Session memory is available only when the API key has the corresponding public capability:

history = client.get_session_memory("s-1")
client.reset_session_memory("s-1")

Use resume_external_action() or resume_action() only to supply clarifications and a Core-issued approval reference when required. The SDK does not accept client assertions of authority, policy, approval, trust, or execution authorization. start_external_action() is the explicit authorization boundary; the SDK never executes application business logic.

Responses are typed, immutable, and intentionally limited to public-safe fields. Unknown and private server fields are ignored. Catch NEESAPIError or a specific exported subclass such as NEESAuthenticationError, NEESConflictError, or NEESRateLimitError.

The SDK does not expose API-key administration, service administration, policy or authority stores, raw diagnostics, replay/simulation, database/runtime controls, or private audit data.

Release files for nees-core-sdk 0.2.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 nees-core-sdk 0.2.0
File Size Uploaded
nees_core_sdk-0.2.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nees-core-sdk 0.2.0
File Interpreter ABI Platform
nees_core_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / nees_core_sdk-0.2.0.tar.gz

Download URL nees_core_sdk-0.2.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cd659c040ceb1f30632573e76d4ebbd95d8be69538122e3c717c609acee579ca
BLAKE2b-256 checksum
How to use checksums
184b2b02170e33b22bc79eac4fea65bfdb3bcf0f0e3467cb116f3674a5a447db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / nees_core_sdk-0.2.0-py3-none-any.whl

Download URL nees_core_sdk-0.2.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4266ac4efce92b5b52bf066b82f4e990fea4f91669c74ed233023c4807cc3bed
BLAKE2b-256 checksum
How to use checksums
c0a1fe4c5f6d287ecd1ec7d113c968b2891edd44e6ad4e6d914ddee2caa80e7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

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