Skip to main content

Lightweight Python SDK for the PFC API

Project description

pfc-client

pfc-client is the lightweight Python SDK for customers integrating with the PFC API.

Install

pip install pfc-client

For local development from this repository:

pip install ./sdk/python

Quickstart

from pfc_client import PFCClient, guarded_tool

client = PFCClient(
    api_url="https://pfc-api.fly.dev",
    api_key="YOUR_API_KEY",
)

decision = client.evaluate(
    action="deploy_production",
    subject={"type": "agent", "id": "website-backend"},
    resource={"type": "service", "id": "checkout-api"},
)

print(decision)

Base URL Configuration

By default the client points to the hosted PFC API:

client = PFCClient()

To use a different environment:

client = PFCClient(api_url="https://your-pfc-host.example.com")

API Key Usage

Pass your website customer API key when creating the client:

client = PFCClient(
    api_url="https://pfc-api.fly.dev",
    api_key="pfc_live_your_api_key",
)

The SDK sends the key as the x-api-key header on evaluate requests.

Check Your Usage

Use your API key to view your request usage:

curl https://pfc-api.fly.dev/v1/usage/me \
  -H "x-api-key: YOUR_PFC_API_KEY"

This returns your customer-specific usage totals based on the same API key used for requests.

Guarded Tool Example

from pfc_client import PFCClient, guarded_tool

client = PFCClient(api_key="pfc_live_your_api_key")


@guarded_tool(client)
def deploy():
    print("Deploying to production")


deploy()

Supported Operations

  • client.evaluate(...) submits an action for policy and authority evaluation
  • client.verify(...) verifies an artifact against a public key via the API

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

pfc_client-0.1.5.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

pfc_client-0.1.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pfc_client-0.1.5.tar.gz.

File metadata

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

File hashes

Hashes for pfc_client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 06fd6f9af8cda97a73f66fa81c43ec9ef8fabadeaa93505319a9aef8b1125d9a
MD5 138a3fecb3ecda3274978283215dbc81
BLAKE2b-256 24fd4cc25ea6bb2ed5704c8f0b9555f6dc73a2f30cc6c105ad82367e3b409cbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_client-0.1.5.tar.gz:

Publisher: publish-pypi-sdk.yml on danlevans1/PFC-runtime

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

File details

Details for the file pfc_client-0.1.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pfc_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd43af3a2141858507685b7313cf0730010b0da0302ba4a5159c6790fb377cc7
MD5 f68811eb5dd35d39610e23da5354524f
BLAKE2b-256 1130680ae2a612e760922af08c4108d5bc55fff36512d70010f004102b2dbfb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_client-0.1.5-py3-none-any.whl:

Publisher: publish-pypi-sdk.yml on danlevans1/PFC-runtime

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