Skip to main content
Pre-release

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

ppx-connectors

Outbound ingestion connectors for the Preference Profile Exchange (PPX).

Pull preference signals from services the user already uses, map them onto PPX claims, and propose updates through the provider — so writeback policy, review, and audit all apply uniformly.

Install

pip install ppx-connectors

Requires Python 3.11+. Published version: 0.1.0a1 (PyPI).

Alpha, tracking a draft specification. Expect breaking changes. The version is 0.1.0a1 on PyPI and 0.1.0-alpha.1 on npm — the same release in each ecosystem's required format.

Ship your own connector in three methods

from ppx_connectors import Connector, ConnectorContext, ProposedClaim, SourceSignal

class MyConnector(Connector):
    name = "my-source"
    writes_namespaces = ["my-domain"]
    interval_seconds = 60 * 60 * 12  # every 12h

    def fetch(self, ctx: ConnectorContext) -> list[SourceSignal]:
        # call the external API, return raw signals
        ...

    def to_claims(self, signals: list[SourceSignal]) -> list[ProposedClaim]:
        # map raw signals onto spec claims (pure function, no I/O)
        return [ProposedClaim(
            namespace="my-domain",
            key="some_preference",
            value=0.7,
            confidence=0.8,
            source={"kind": "imported", "origin": self.name},
        )]

Run a connector once (manual / cron-friendly)

from ppx_client import PpxClient
from ppx_connectors import ConnectorContext, run_once
from ppx_connectors.connectors import SpotifyConnector

client = PpxClient("https://api.provider.app")
ctx = ConnectorContext(
    client=client,
    grant_token=writeback_scoped_grant_token,
    credentials={"spotify_access_token": user_spotify_oauth_token},
)
result = run_once(SpotifyConnector(), ctx)
# → {"connector": "spotify", "signals": 150, "proposed": 6, "writeback": "proposal_created"}

Built-in connectors

Name Namespace Claim keys Status
SpotifyConnector music genre_preference, energy_preference, tempo_preference, valence_preference, danceability_preference, acousticness_preference, listening_intensity shipping
StravaConnector fitness activity_frequency, terrain_preference, cardio_load, pace_preference, outdoor_bias shipping
GoogleCalendarConnector core social_energy_preference, pace_preference, morning_evening_skew, weekend_activity shipping

Design notes

  • Separation of concerns. fetch() does I/O; to_claims() is pure. This makes claim-mapping testable without hitting external services, and reusable for replay / dry-run.
  • Spec-compliant writeback. All claims go through /v1/profile/propose-updates, so the user's writeback_policy is honored automatically. Under review_required the user sees every proposal before anything takes effect.
  • Confidence by volume. Pull-based inference has an inherent signal count; the built-in _conf_from_volume helper scales confidence linearly with observation count.
  • Every claim is attributed. source.kind = "imported" and source.origin = <connector-name> on every proposal. The user always knows who learned each claim.

License

Apache-2.0.

Download files

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

Source Distribution

ppx_connectors-0.1.0a1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

ppx_connectors-0.1.0a1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file ppx_connectors-0.1.0a1.tar.gz.

File metadata

  • Download URL: ppx_connectors-0.1.0a1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for ppx_connectors-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 8e50cdb39db19d14e71c05cf1911fc8211f2a3ed086a63feeac0c4a80c2eab07
MD5 91562a22785b5f124fb6cc8bb4b24f7b
BLAKE2b-256 89c6e2c2f3d7847e776e90addac4b92c9e4f779c16197ce70837b5360d480fe5

See more details on using hashes here.

File details

Details for the file ppx_connectors-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ppx_connectors-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 adbf2f21cfed8eff64c83ce425f0d7ebee6f8712b87be03ee070288fd822c436
MD5 2411031d3c4531622ee944788fc9f895
BLAKE2b-256 a52b973cf4ee01730198bfcdcf17e21bd59f3f855ed666683da1dde53ffaa2a0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page