Skip to main content

Python SDK for Arcana

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Codex: Python SDK for Arcana

The Arcana Codex Python library provides convenient access to the Arcana Gateway Ad Service from any Python 3.10+ applications. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.

Installation

# install from PyPI
pip install arcana-codex

Usage

import os
from arcana_codex import ArcanaCodexClient, AdUnitsFetchModel, AdUnitsIntegrateModel

client = ArcanaCodexClient(
    api_key=os.environ.get("ARCANA_CODEX_API_KEY"),
)

fetch_payload = AdUnitsFetchModel(query="How can I write blogs for my website?")
fetch_result = client.fetch_ad_units(fetch_payload)

ad_unit_ids = [ad_unit["id"] for ad_unit in fetch_result["response_data"]]


integrate_payload = AdUnitsIntegrateModel(
    ad_unit_ids=ad_unit_ids, base_content="insert the llm response generated from your application as the base content"
)
integration_result = client.fetch_ad_units(integrate_payload)

print(integration_result)

While you can provide an api_key keyword argument, we recommend using python-dotenv (or something similar) to add ARCANA_CODEX_API_KEY="My Arc API Key" to your .env file so that your API Key is not stored in source control.

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

arcana_codex-0.2.0.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

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

arcana_codex-0.2.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file arcana_codex-0.2.0.tar.gz.

File metadata

  • Download URL: arcana_codex-0.2.0.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for arcana_codex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f64456a532eac8952094b858b99c83021fecca35076597210d997fa12fdbaf4
MD5 af0fe933610b2b48c66145292043427f
BLAKE2b-256 989a45c56c5739a313fecf06b925dc2bb52fb5ef7c9f9a85f021d438891b955d

See more details on using hashes here.

File details

Details for the file arcana_codex-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arcana_codex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bd63db5f03a7a0e377323325f4049fc4144b9bca62ca2251b436783fc801f3a
MD5 8e3705b857863ef9ec52cc584e4109b1
BLAKE2b-256 a00e6f20f4a7a799b63f70cbc6dfed4a2393091386541b5a307d987929b41c33

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