Skip to main content

Async Python client for Soc-proof API

Project description

py-socproof

Async Python client for the Partner API (https://soc-proof.su).
Easily interact with services, orders, and statuses.


Installation

pip install py-socproof

Examples

You can find example scripts demonstrating how to use soc-proof in the examples folder.

Language Support for Services

The API client supports fetching service details in multiple languages.

language="en" — English (default)

language="ru" — Russian 

Features

  • Async requests with aiohttp

  • Simple in-memory caching with TTL

  • Fetch all services, get service by ID

  • Create orders and check their status

  • Automatically merges service descriptions

  • Easy to use and extend

Models

Service: Represents a service with all fields from the API (name, category, rate, min, max, dripfeed, refill, cancel, description, time, admin_cost)

OrderStatus: Represents an order’s current status, charge, and remaining quantity.

Cache

  • Cache stores services and descriptions in memory with optional TTL.

  • You can force reload services if API data changes:

services = await api.load_services(force_reload=True)

Error Handling

from py_partner_api import PartnerAPIAsync, HTTPRequestError, InvalidResponseError, APIError

try:
    services = await api.load_services()
except HTTPRequestError as e:
    print(f"HTTP error: {e}")
except APIError as e:
    print(f"API returned error: {e}")
except InvalidResponseError as e:
    print(f"Invalid response: {e}")

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

py_socproof-1.0.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

py_socproof-1.0.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file py_socproof-1.0.3.tar.gz.

File metadata

  • Download URL: py_socproof-1.0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for py_socproof-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d16ec80fb27d6172fda9c6455469045f7cd1fc5b68b4b0171fc976e21be6b0b2
MD5 ff8080cb0de46512047052d8a3a49244
BLAKE2b-256 ad3d0a06ab8fe745eea1ff2c3cb5302f0b630ff561dc08cd9b6cbd3ae7f35490

See more details on using hashes here.

File details

Details for the file py_socproof-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: py_socproof-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for py_socproof-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1799b9d4bd6d78bd057709de3ecb352ee3f32f6ab2b2a592796b2adb8cd28fb
MD5 31d8eecd7d3497806f6b30a033fad588
BLAKE2b-256 30f460415f11979ff6d448104cb4a3d6bbb93982fe0d84e87756b993683704da

See more details on using hashes here.

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