This project has been archived by its maintainers, and is no longer receiving any updates.
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.
Metadata
Release files for arcana-codex 0.2.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 | |
|---|---|---|---|
| arcana_codex-0.2.0.tar.gz | 43.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arcana_codex-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.4 kB
Release files / arcana_codex-0.2.0.tar.gz
| Download URL | arcana_codex-0.2.0.tar.gz |
|---|---|
| Size | 43.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f64456a532eac8952094b858b99c83021fecca35076597210d997fa12fdbaf4
|
|
BLAKE2b-256 checksum How to use checksums |
989a45c56c5739a313fecf06b925dc2bb52fb5ef7c9f9a85f021d438891b955d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.24
|
Release files / arcana_codex-0.2.0-py3-none-any.whl
| Download URL | arcana_codex-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bd63db5f03a7a0e377323325f4049fc4144b9bca62ca2251b436783fc801f3a
|
|
BLAKE2b-256 checksum How to use checksums |
a00e6f20f4a7a799b63f70cbc6dfed4a2393091386541b5a307d987929b41c33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.24
|