Pereval SDK for Python
Server-side client for the Pereval partner API, protocol 1.0.1. Keep partner keys on your server. Use separate credentials, event cursors and storage for sandbox and live.
Installation
Run python -m pip install pereval-dating on Python 3.10+. Import the package as pereval.
Run python -m pip install . from this checkout with Python 3.10 or newer.
Set PEREVAL_API_KEY to your sandbox key. The quickstart checks the mode without writing data.
import os
from pereval import AsyncClient
async def feed(member_id: str):
async with AsyncClient(
os.environ["PEREVAL_API_KEY"],
webhook_secret=os.environ["PEREVAL_WEBHOOK_SECRET"],
) as client:
caps = await client.capabilities.get()
if caps["mode"] != "sandbox":
raise RuntimeError("Expected sandbox mode")
return await client.feed.list(member_id, {"limit": 10})
API
See service methods for arguments and defaults. Groups cover health, capabilities, languages, members, feed, likes, matches, messages, events, moderation, photos, commerce and MCP. JSON fields keep their wire names. Photo downloads return bytes and a content type. Only orders require the additional commerce_key option.
Integrating with an existing application
Use Client with with and AsyncClient with async with. By default the SDK uses HTTPX when installed. Otherwise it uses the standard library with one HTTPS connection per request and a worker thread for async calls. For pooled connections install pereval-dating[httpx]. The timeout defaults to 20 seconds.
| Optional extra | Adapter for an existing instance |
|---|---|
| httpx | httpx_transport(client) or async_httpx_transport(client) |
| requests | requests_transport(session) |
| aiohttp | aiohttp_transport(session) |
| structlog | structlog_logger(logger) |
| loguru | loguru_logger(logger) |
import logging
import os
import requests
from pereval import Client, requests_transport, logging_logger
with requests.Session() as session:
with Client(os.environ["PEREVAL_API_KEY"],
transport=requests_transport(session),
logger=logging_logger(logging.getLogger("pereval"))) as client:
print(client.capabilities.get()["mode"])
Implement Sender or AsyncSender with the SDK's Request and Response types. Honor request.timeout, never follow redirects and bound response reads to 15 MiB. AsyncClient accepts both sync and awaitable loggers. See custom extensions. Typed responses are described in pereval.models.
Applications own sessions and agents passed through adapters. Middleware receives the next sender and returns a sender. The first layer runs first. Log entries contain method, status, duration and level (info, warning or error). Avoid logging URLs, headers and payloads in custom code.
HTTP failures raise ApiError with status, code and detail. MCP errors raise RpcError. Transport exceptions propagate. There are no automatic retries. Use stable operation references when retrying supported writes. Redirects are disabled and responses are limited to 15 MiB.
Event delivery
See polling and webhook handlers. Pass the original request bytes and the X-Network-Signature header to client.webhooks.parse. Persist each event once by ID across both delivery channels. Start polling at cursor 0 and save the next cursor only after the whole page succeeds.
Tests
Install build, ruff, mypy and .[test] from the checkout. Run python -m unittest discover -s tests, mypy src, ruff check src tests examples and python -m build. Tests use local transports and require no partner credentials.
Sandbox integration test
Use two dedicated test partners with a small feed. Set PARTNER_A and PARTNER_B through your environment. Optionally set PEREVAL_ORIGIN to a trusted HTTPS API origin. Run python tests/sandbox.py after installing dependencies. The test checks both partners for sandbox mode before writing. It creates two synthetic members, verifies batch updates, discovery, mutual likes, message deduplication, read receipts, event pagination and validation errors, then requests removal of its test members. Test events can still reach configured webhooks. Run this separately from the offline suite.
MIT license.
Metadata
Release files for pereval-dating 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pereval_dating-1.0.0.tar.gz | 22.3 kB | With provenance | Details for pereval_dating-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pereval_dating-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pereval_dating-1.0.0-py3-none-any.whl |
Total release size: 38.8 kB
Release files / pereval_dating-1.0.0.tar.gz
| Download URL | pereval_dating-1.0.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cc2a80daf6dca31bd0ef0d57c84a4f3c795389be10595a4ddf350e653394014
|
|
BLAKE2b-256 checksum How to use checksums |
21bf71ae767d679517a0e91e7c28cae0c53ecd5b4d5c1856c99f8ef412b3b4e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / pereval_dating-1.0.0-py3-none-any.whl
| Download URL | pereval_dating-1.0.0-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bc6495acbd371aa182f1a1befe0f4003eb834ca5827bdea7bb90e3d659e8c61
|
|
BLAKE2b-256 checksum How to use checksums |
c762761f73137f299cf6768f3da5f3c36c10049d20dd22cbc35e7bde95885950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for pereval-dating 1.0.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pereval_dating-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA 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.