Skip to main content

cred-protocol

Async Python client and FastAPI dependency for the Cred Protocol trust evaluation API — composite trust scores (credit, sybil resistance, identity) for any Ethereum wallet, with policy templates and gates.

pip install cred-protocol            # core client (httpx)
pip install "cred-protocol[fastapi]" # + FastAPI dependency

Quick start

import asyncio
from cred_protocol import CredClient

async def main():
    async with CredClient(api_key="cred_sk_...") as cred:
        result = await cred.evaluate(
            wallet_address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            policy="standard",
        )
        print(result.trust_score)  # 0-100
        print(result.trust_tier)   # TrustTier.VERIFIED
        print(result.all_passed)   # True

asyncio.run(main())

Custom gates instead of a policy template:

result = await cred.evaluate(
    wallet_address="0x...",
    gates=["human", "verified", "established"],
    operator="WEIGHTED",
    weights={"human": 0.4, "verified": 0.35, "established": 0.25},
    composite_threshold=60,
)

FastAPI

import os
from fastapi import Depends, FastAPI
from cred_protocol import TrustResult
from cred_protocol.fastapi import require_trust

app = FastAPI()

@app.get("/resource")
async def get_resource(
    trust: TrustResult = Depends(require_trust(api_key=os.environ["CRED_API_KEY"], policy="standard")),
):
    return {"wallet": trust.wallet_address, "score": trust.trust_score, "tier": trust.trust_tier.value}

require_trust(..., on_fail="deny" | "challenge" | "pass") returns 403, 402 or lets the request through when the wallet fails the policy.

MIT License.

Metadata

Release files for cred-protocol 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cred-protocol 0.1.0
File Size Uploaded Provenance Actions
cred_protocol-0.1.0.tar.gz 5.6 kB Without provenance Details for cred_protocol-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cred-protocol 0.1.0
File Interpreter ABI Platform Actions
cred_protocol-0.1.0-py3-none-any.whl Python 3 none any Details for cred_protocol-0.1.0-py3-none-any.whl

Total release size: 13.0 kB

Release files / cred_protocol-0.1.0.tar.gz

Download URL cred_protocol-0.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37c1967d37a045b7758de9cdeda420c9fdfb2095d1ee72e41cdf3733ac1d88a0
BLAKE2b-256 checksum
How to use checksums
a9dc98991b54e19becbb219e4c1771f55f4d0840f3ef8442ebb6ab9b252ba30b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cred_protocol-0.1.0-py3-none-any.whl

Download URL cred_protocol-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c5c0bb9cbfe7a803300961a03ed88d130d4b66530b7c4637cdc62f60d25d7a8
BLAKE2b-256 checksum
How to use checksums
a51dfa22fe35250a06ca34942459b56de2f251b2b90241c43d4e6d1179429e77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cred-protocol 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page