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 evaluationclient.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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06fd6f9af8cda97a73f66fa81c43ec9ef8fabadeaa93505319a9aef8b1125d9a
|
|
| MD5 |
138a3fecb3ecda3274978283215dbc81
|
|
| BLAKE2b-256 |
24fd4cc25ea6bb2ed5704c8f0b9555f6dc73a2f30cc6c105ad82367e3b409cbc
|
Provenance
The following attestation bundles were made for pfc_client-0.1.5.tar.gz:
Publisher:
publish-pypi-sdk.yml on danlevans1/PFC-runtime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pfc_client-0.1.5.tar.gz -
Subject digest:
06fd6f9af8cda97a73f66fa81c43ec9ef8fabadeaa93505319a9aef8b1125d9a - Sigstore transparency entry: 1147969706
- Sigstore integration time:
-
Permalink:
danlevans1/PFC-runtime@92a919f639dc9c4013f51578b5bb3c5a1134c345 -
Branch / Tag:
refs/tags/pfc-client-v0.1.5 - Owner: https://github.com/danlevans1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-sdk.yml@92a919f639dc9c4013f51578b5bb3c5a1134c345 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd43af3a2141858507685b7313cf0730010b0da0302ba4a5159c6790fb377cc7
|
|
| MD5 |
f68811eb5dd35d39610e23da5354524f
|
|
| BLAKE2b-256 |
1130680ae2a612e760922af08c4108d5bc55fff36512d70010f004102b2dbfb0
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pfc_client-0.1.5-py3-none-any.whl -
Subject digest:
bd43af3a2141858507685b7313cf0730010b0da0302ba4a5159c6790fb377cc7 - Sigstore transparency entry: 1147969717
- Sigstore integration time:
-
Permalink:
danlevans1/PFC-runtime@92a919f639dc9c4013f51578b5bb3c5a1134c345 -
Branch / Tag:
refs/tags/pfc-client-v0.1.5 - Owner: https://github.com/danlevans1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-sdk.yml@92a919f639dc9c4013f51578b5bb3c5a1134c345 -
Trigger Event:
push
-
Statement type: