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.

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.3.tar.gz (3.6 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.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pfc_client-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 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.3.tar.gz
Algorithm Hash digest
SHA256 cf896e1596dcbf1571bc26bc58339c2782f1c1859c3b54f11d55d277dee97cf1
MD5 bb71e829adb2a25165a6c7c170097c80
BLAKE2b-256 7b37dfcaf44b1cd22d49d803762a954b8bc1ae69926a5726e864454d4d6c81b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_client-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: pfc_client-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 45818e818ea12b1d1be700eee72e755a38878a6b23d86e0626a38db0c196cf09
MD5 41200092e67841928f537aaa910782e3
BLAKE2b-256 13b44d5472f6aaa85799fe706199d2957ac1ab9fc4d9d18802296699d54a7bde

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_client-0.1.3-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