Skip to main content

Canonical schemas for MetaSPN-compatible signal processing systems

Project description

metaspn-schemas

Canonical, stdlib-only schema package for MetaSPN-compatible systems.

Install

pip install metaspn-schemas

Development

python -m pip install -e .[dev]
pytest -q
python -m build
python -m twine check dist/*

Design constraints

  • Tiny and dependency-light (stdlib only)
  • Frozen dataclasses for immutable-by-default objects
  • Explicit schema_version on all public objects
  • to_dict() / from_dict() on every schema
  • UTC ISO-8601 datetime serialization
  • Traceability metadata (trace_id, caused_by, provenance)
  • Privacy mode support (to_dict(privacy_mode=True) omits raw blobs)

Example

from datetime import timezone, datetime

from metaspn_schemas import SignalEnvelope
from metaspn_schemas.utils.ids import generate_id

signal = SignalEnvelope(
    signal_id=generate_id("signal"),
    timestamp=datetime.now(timezone.utc),
    source="linkedin.webhook",
    payload_type="SocialPostSeen",
    payload={"post_id": "123", "platform": "linkedin"},
    schema_version="0.1",
)

as_dict = signal.to_dict()
round_trip = SignalEnvelope.from_dict(as_dict)

Public imports

from metaspn_schemas import (
    SignalEnvelope,
    EmissionEnvelope,
    Task,
    Result,
    SocialPostSeen,
    ProfileEnriched,
    ScoresComputed,
)

Package layout

metaspn-schemas/
  pyproject.toml
  README.md
  src/metaspn_schemas/
    __init__.py
    core.py
    tasks.py
    entities.py
    social.py
    outcomes.py
    features.py
    state_fragments.py
    utils/
      ids.py
      time.py
      serde.py
  test/
    test_serde.py
    test_ids.py
    test_backcompat.py

Release

Release automation is configured in:

  • .github/workflows/ci.yml
  • .github/workflows/publish.yml

See RELEASE.md for the end-to-end push + PyPI release flow.

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

metaspn_schemas-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

metaspn_schemas-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for metaspn_schemas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 81d10cf6baa3fdd8dfeda3db5909aa3d69df2a7b16cf3ad523d4754e2ab74ff8
MD5 ffa3cf20ea3721e54fdeb3369de9e14c
BLAKE2b-256 5dad1d4604ab176d8b8ae84f05e74a287ffdedba8bfae9e2f5ddd307cea9c3f6

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on MetaSPN/metaspn-schemas

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

File details

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

File metadata

File hashes

Hashes for metaspn_schemas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53d18b4aab0c8205494ddb77c2fda82d17b5075b85450f7d0890a88f40cc5f50
MD5 2e75b9486dc5678cdf63c4726ba99c30
BLAKE2b-256 4b20216d8f835962d77be4a0e0388f2b45e663f2c08aed13fd4fe2261808c1db

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on MetaSPN/metaspn-schemas

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