Skip to main content

Enigmind Agent Python SDK for secure IoT connectivity.

Project description

Enigmind Agent Python SDK

A lightweight Python SDK for secure IoT device connectivity.

Quick Start

from enigmind_agent import Agent, AgentConfig

config = AgentConfig(
    broker_url="mqtts://broker.enigmind.ai:8883",
    device_id="device-123",
    api_key="YOUR_API_KEY",
)

agent = Agent(config)
agent.start()
agent.send_telemetry({"temp": 22.4, "vibration": 0.12})

Device Claim Flow (Zero-Touch Setup)

If the agent starts without credentials (device_id + api_key/password), it automatically enters the claim flow:

  1. Generates a stable hardware fingerprint and a human-readable claim token.
  2. Calls the claim API (/api/claims/initiate).
  3. Polls /api/claims/{token}/status until approved.
  4. Stores the returned credentials locally and connects to MQTT.

The claim token is printed at startup when using the CLI, and is also stored locally for retrieval. By default the state file is saved under your user data directory as enigmind_agent/state.json. If you embed the SDK directly, enable Python logging at INFO level to see claim output.

CLI Example

ENIGMIND_CLAIM_BASE_URL=https://api.enigmind.ai enigmind-cli run

Check claim status and token:

enigmind-cli claim status

JSON Config Example

{
  "broker_url": "mqtts://broker.enigmind.ai:8883",
  "claim": {
    "base_url": "https://api.enigmind.ai",
    "poll_interval_s": 5,
    "timeout_s": 300
  }
}

Installation & Setup

py -3.12 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install -U pip
pip install -e .[dev]

Optional Health plugin:

pip install -e .[health]

CLI

enigmind-cli send --data '{"temp": 22.4}' --config ./enigmind.json

Releasing

Releases are published to PyPI automatically via GitHub Actions when you create a GitHub Release.

  1. Bump version in pyproject.toml.
  2. Commit and push to main.
  3. Go to GitHub → Releases → Draft a new release.
  4. Create a new tag (e.g. v0.1.0), add release notes, and click Publish release.
  5. The release.yml workflow will build and publish the package to PyPI.

Plugins

  • Health plugin: CPU/memory/disk metrics (requires optional dependency psutil).
  • Geo plugin: local geofencing hooks (no extra dependencies).

Project details


Download files

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

Source Distribution

enigmind_agent-0.1.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

enigmind_agent-0.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file enigmind_agent-0.1.0.tar.gz.

File metadata

  • Download URL: enigmind_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enigmind_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef9008729d69d7968a9020eb184313258783611fda2422b293c5f44d69c61e03
MD5 22b6a04c65631e825fb76b2d31e37a0f
BLAKE2b-256 9fc5959c398d7355f2ae52cf19a7146481df8202f40dbb953f7fb87bc57145ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for enigmind_agent-0.1.0.tar.gz:

Publisher: release.yml on nefarian-gaming/enigmind-agent

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

File details

Details for the file enigmind_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: enigmind_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enigmind_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4946907f2183e94cedf87d5b0e4a8ac71f15ec2354eb2feb1ec8d3af8c140c63
MD5 6b658221c6b88f326913cfa7cfd6f316
BLAKE2b-256 ec19c6ef731445e38eacca9e27437446e1e2c4213d92e73f67748dd2a343483c

See more details on using hashes here.

Provenance

The following attestation bundles were made for enigmind_agent-0.1.0-py3-none-any.whl:

Publisher: release.yml on nefarian-gaming/enigmind-agent

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