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.0a1on PyPI and0.1.0-alpha.1on 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'swriteback_policyis honored automatically. Underreview_requiredthe user sees every proposal before anything takes effect. - Confidence by volume. Pull-based inference has an inherent signal
count; the built-in
_conf_from_volumehelper scales confidence linearly with observation count. - Every claim is attributed.
source.kind = "imported"andsource.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ppx_connectors-0.1.0a4.tar.gz.
File metadata
- Download URL: ppx_connectors-0.1.0a4.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f7a74991825d59ac5eb7e27232550fb9672078cf9ac9dc75ab2b2780f0c483e
|
|
| MD5 |
f8a5aa58f99788dec63f04b6186b2ea2
|
|
| BLAKE2b-256 |
5d59b59d73b1c3c815d2a033c9351dce9bda5ab6f3089552ff3922113a397c46
|
File details
Details for the file ppx_connectors-0.1.0a4-py3-none-any.whl.
File metadata
- Download URL: ppx_connectors-0.1.0a4-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69c7d80a07d2210515853b35e2a33b84e4e47d503cbcd8fbcc0c14b9e3b17129
|
|
| MD5 |
3ee43ccb9fdad12ab73776c47839084a
|
|
| BLAKE2b-256 |
9284621841e993645b213c67180d7fdfdec24d8aa132fcd455fb2d339b5f9e9e
|