Skip to main content

XPawn: A Python client for the XPawn API.

Project description

XPawn Python Client

A Python client library for interacting with the XPawn API.

Installation

pip install xpawn

Quick Start

import xpawn

# Initialize the client
client = xpawn.Client(api_key='your-api-key')

# Get a prompt by ID
response = client.get_prompt('prompt-id')
print(response)

Configuration

Timeout

You can set a custom timeout (default is 30 seconds):

client = xpawn.Client(
    api_key='your-api-key',
    timeout=60
)

API Methods

get_prompt(prompt_id)

Retrieve a prompt by its ID.

Parameters:

  • prompt_id (str): The ID of the prompt to retrieve

Returns:

  • dict: A dictionary containing:
    • message (str): The prompt content
    • tokens_saved (int): Number of tokens saved

Example:

response = client.get_prompt('prompt-123')

health_check()

Perform a health check on the API.

Returns:

  • dict: Health check response

Example:

health = client.health_check()

License

MIT License

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

xpawn-0.2.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.

xpawn-0.2.3-py2.py3-none-any.whl (4.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xpawn-0.2.3.tar.gz.

File metadata

  • Download URL: xpawn-0.2.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for xpawn-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b891cd53f70a41477cb25028bfc935db8c76c6d217e03cea301383ad1d7c8af1
MD5 1cb70a6bb4112a447d73d5565ebf86eb
BLAKE2b-256 1f55472d19dd1c35edf9c12c235c846d114bd35aea25d3e48fbbb0749577a1b2

See more details on using hashes here.

File details

Details for the file xpawn-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: xpawn-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for xpawn-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 83a5354aaaac1b67f9755545697dff3f4957dd7081567985284c6f452a3ff5da
MD5 acd98c5745fe956dbc927b8ea4aa66ee
BLAKE2b-256 fbe62afa7a46d7c05143bb3b68ba41ca1351d7b56f4209a6be4716867d3333c5

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