Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

IoT FixtureKit

Experimental local-first tooling for converting IoT diagnostics into reproducible test fixtures. No network access, no telemetry, no automatic uploads.

Home Assistant integration authors frequently need real device behavior to write regression tests. Different projects maintain their own diagnostic-to-fixture workflows. This experiment tests whether an explicit projection engine can reduce that maintenance without replacing their existing protocol libraries or tests.

Alpha preview (0.1.0a2). Independent security review is pending. No privacy certification or upstream endorsement is claimed.

Install the published alpha

In a virtual environment (Python 3.9+):

python -m pip install "https://github.com/FlyzDev/fixturekit/releases/download/v0.1.0a2/iot_fixturekit-0.1.0a2-py3-none-any.whl"

Release files and SHA256 checksums. PyPI publication is pending. The optional pytest integration can be installed with the corresponding direct reference:

python -m pip install "iot-fixturekit[pytest] @ https://github.com/FlyzDev/fixturekit/releases/download/v0.1.0a2/iot_fixturekit-0.1.0a2-py3-none-any.whl"

Start here

See QUICKSTART.md for installation and the five-minute local consumer demo; see CONTRIBUTING.md for pilot feedback.

Run the synthetic demo

Python 3.9+; no runtime dependencies.

PYTHONPATH=src python3 -m iot_fixturekit.cli examples/synthetic-diagnostics.json --policy examples/synthetic-policy.json --profile demo

PYTHONPATH=src python3 -m unittest discover -s tests -v

Unknown object fields are excluded. Selected strings must match declared enum values. Numbers require explicit bounds. Invalid input is rejected. The complete projection policy is validated before use, even for empty arrays. Policies are limited to 64 nested levels and 10,000 rules. The output is versioned and deterministic.

Important security boundary

This is NOT a complete anonymizer, secret scanner, or privacy guarantee. A poorly designed policy can retain sensitive values, keys or measurements. Review policy semantics and output locally before sharing. Do not commit raw diagnostics, credentials, real device identifiers or customer data. No live device adapters are implemented yet. All examples are synthetic.

Pilot validation

Start with maintainer-approved, narrowly scoped adapters for existing fixture workflows. Do not request upstream adoption until compatibility and maintenance benefit have been demonstrated. Research notes are maintained separately in the repository.

Fixture audit (experimental)

Run on an already-reviewed candidate fixture, not as a replacement for redaction:

PYTHONPATH=src python3 -m iot_fixturekit.audit --profile tuya examples/synthetic-tuya-fixture.json

Generic mode checks JSON/HAR structures and plain-text patterns (including XML). Tuya mode additionally checks selected requirements documented by Tuya Device Handlers. Reports contain file ordinals, rule IDs and line numbers (0 for JSON structural checks), not paths or matched values. Exit 0 means no findings, 1 means findings, 2 means an input error. A clean result does NOT certify privacy. Unknown secrets, encoded strings, device identifiers and context-specific sensitive measurements may remain. Generic mode does not parse XML or JSONL structurally. No upstream adoption is claimed.

Tuya diagnostics adapter (experimental)

Create a local review candidate, not a publication-ready fixture:

mkdir -p raw/review
PYTHONPATH=src python3 -m iot_fixturekit.tuya examples/synthetic-tuya-diagnostics.json --output-dir raw/review

The adapter follows the documented Tuya Device Handlers extraction convention: it selects the diagnostics data object, drops account-specific root keys, blanks device_info, preserves functional datapoints and preserves the case of the product ID. Filename components are restricted to safe alphanumeric forms. The candidate is audited before writing, created with exclusive access (no overwrite) and restrictive POSIX permissions. Review every field manually before sharing; unknown datapoints, device names, timestamps and encoded values may still contain personal data. The CLI never prints candidate values. Exit 1 indicates audit findings; exit 2 indicates invalid input or write failure. The ignored raw/ folder is recommended for private local work.

Pytest integration

Install the package with its optional pytest extra. The pytest entry point automatically registers the callable fixture:

def test_device_fixture(iot_fixture_check):
    iot_fixture_check("tests/fixtures/device.json", profile="tuya")

Use the default generic profile for other devices. Explicitly parametrize the files you want checked; there is no automatic repository-wide scanning. The plugin uses the same file audit as the CLI and reports only rule IDs. Avoid pytest options or custom plugins that dump sensitive local variables.

Pre-commit integration

For a local checkout of the package, use a local hook after installing it in the environment running pre-commit:

repos:
  - repo: local
    hooks:
      - id: iot-fixture-audit
        name: Audit IoT test fixtures
        entry: iot-fixture-audit
        language: system
        types: [text]
        files: '(^|/)(fixtures|golden)/.*\.(json|har|xml|jsonl|log|txt)$'

Consumers can also use the public hook pinned to the alpha release:

repos:
  - repo: https://github.com/FlyzDev/fixturekit
    rev: v0.1.0a2
    hooks:
      - id: iot-fixture-audit
``` Restrict the file
pattern to reviewed fixture directories; use separate hooks with
`args: [--profile, tuya]` where appropriate. No findings is not a privacy
guarantee, and a hook is not a substitute for human review.

## Project-specific placeholder policies (experimental)

Some libraries intentionally preserve synthetic MAC addresses in test fixtures.
Use an explicitly reviewed JSON policy, such as
`examples/synthetic-placeholder-policy.json`, with the audit CLI:

    iot-fixture-audit --policy examples/synthetic-placeholder-policy.json tests/fixtures/device.json

Pytest accepts the same file through `policy_path`; pre-commit can pass
`args: [--policy, path/to/policy.json]` on a JSON-only hook.
For Python callers, pass the parsed policy via the keyword-only `policy`
argument to `audit_json` or `audit_file`.

Version 1 supports exact typed JSON paths and exact full colon-delimited MAC
placeholder values only. Integer path segments select array indexes; strings
select object keys. No wildcard or regex exemptions, no credential-rule
exemptions, and no exemption of object keys or Tuya structural checks.
Policies are opt-in; the Tuya conversion CLI retains its original strict audit.
Text formats do not accept policies. Keep policy files human-reviewed and use
only known synthetic values, never actual device addresses. A policy is not
evidence that a fixture is safe to publish.

Audit inputs are limited to 8 MiB per file, 64 nested path segments and
200,000 visited JSON nodes (including object keys). The JSON audit rejects
non-finite numbers, unsupported Python values and unpaired Unicode surrogates.
These are defensive limits, not a complete resource-isolation guarantee.

Text audit additionally limits input to 8,388,608 characters and output to
4,096 distinct line/rule findings per audit_text call. Exceeding a limit
is an input error, never a clean scan. Email and JWT matching starts at
token boundaries to avoid repeatedly scanning long runs of punctuation
or token characters. These heuristics can miss unusual or embedded values.

## License

Apache License 2.0. See LICENSE.

## Tuya loader compatibility pilot

A generated synthetic fixture was successfully loaded by the pinned upstream
Tuya Device Handlers test helper using the published alpha. See
[the reproducible pilot](examples/pilot/TUYA.md) for the exact scope and checks.

## Overkiz profile (experimental)

The opt-in JSON profile checks selected exact state names for unmasked
values, including serial numbers, network identifiers and HomeKit setup
states. It recognizes limited mask-only strings and explicit redaction
placeholders; it does not validate all Overkiz fields or prove privacy.
Use the upstream obfuscator first. Generic mode is unchanged.

    iot-fixture-audit --profile overkiz tests/fixtures/setup/device.json

Pytest accepts profile="overkiz", and JSON pre-commit hooks can pass
args: [--profile, overkiz]. MAC placeholder exceptions do not suppress
semantic state findings. This profile is included in the 0.1.0a2 alpha.

## Overkiz post-obfuscation pilot

The published alpha was tested as an additional non-mutating check after
the pinned pyoverkiz obfuscator. See [the pilot and its known gap](examples/pilot/OVERKIZ.md).

## Synthetic consumer pilot

The examples/pilot directory illustrates a fixture convention used by a
device library: a fixed synthetic Wi-Fi MAC placeholder at status.wifi.mac.
The example is independently constructed, incomplete and not an upstream
fixture or a compatibility guarantee.

After installing the package in a separate project, a JSON-only pre-commit
hook can pass the checked-in policy path as an argument:

```yaml
repos:
  - repo: local
    hooks:
      - id: fixturekit
        name: FixtureKit audit
        entry: iot-fixture-audit
        language: system
        args: [--policy, examples/pilot/shelly-style-policy.json]
        files: '^tests/fixtures/.*\.json$'

Use the matching policy in pytest via policy_path. Keep policies under human review and do not apply the exception globally. This supplements, rather than replaces, device-library redactors. See the four pilot integration tests.

Metadata

Release files for iot-fixturekit 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iot-fixturekit 0.1.0a2
File Size Uploaded Provenance Actions
iot_fixturekit-0.1.0a2.tar.gz 34.8 kB With provenance Details for iot_fixturekit-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iot-fixturekit 0.1.0a2
File Interpreter ABI Platform Actions
iot_fixturekit-0.1.0a2-py3-none-any.whl Python 3 none any Details for iot_fixturekit-0.1.0a2-py3-none-any.whl

Total release size: 53.6 kB

Release files / iot_fixturekit-0.1.0a2.tar.gz

Download URL iot_fixturekit-0.1.0a2.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2cf5d149b08a7d6b0f6e209cede14592a9281044ce92788803d7ca3592000976
BLAKE2b-256 checksum
How to use checksums
5747e3070a482c91047f7148f54dab3f655e9793ceedee27a361baee6e06edb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Release files / iot_fixturekit-0.1.0a2-py3-none-any.whl

Download URL iot_fixturekit-0.1.0a2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab5811fa7ed02590eac193f1fbd36b0ee553531826b28faa3acb30a365893029
BLAKE2b-256 checksum
How to use checksums
a28f691dd5cd0b20f0fbe2347cfec986e50b17d0dc786ba29d387ea4700b0dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Security for iot-fixturekit 0.1.0a2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for iot_fixturekit-0.1.0a2.tar.gz

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 Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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