Skip to main content

Python SDK for Atheon

Project description

Codex: Python SDK for Atheon

The Atheon Codex Python library provides convenient access to the Atheon 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 atheon-codex

Usage

  1. Analytics Tool:
import os
from atheon_codex import AtheonCodexClient, TrackUnitIntegrateModel

client = AtheonCodexClient(
    api_key=os.environ.get("ATHEON_CODEX_API_KEY"),
)

integrate_payload = TrackUnitIntegrateModel(
    base_content="insert the llm response generated from your application as the base content"
)
integration_result = client.fetch_track_unit(integrate_payload)

print(integration_result)
  1. Monetization via Adverts:
import os
from atheon_codex import AtheonCodexClient, AdUnitsFetchModel, AdUnitsIntegrateModel

client = AtheonCodexClient(
    api_key=os.environ.get("ATHEON_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 ATHEON_CODEX_API_KEY="My Eon 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

atheon_codex-0.4.0.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

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

atheon_codex-0.4.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file atheon_codex-0.4.0.tar.gz.

File metadata

  • Download URL: atheon_codex-0.4.0.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for atheon_codex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 971440429d108cd075dd475f340f61ca742b672558253d77df2331215475ed1f
MD5 7cae6baaabbfe577b57ae4639770c86d
BLAKE2b-256 f462986275a809a990dd8a1447b565623c9710ba9de97dedb69351937e35ba3f

See more details on using hashes here.

File details

Details for the file atheon_codex-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for atheon_codex-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2c30f06c4e4cf099dfca8438bea25bb0c9a85aa360c978ea3c0f7f07d886bd
MD5 dfc65c3c3a0b6d6d89c247193f750206
BLAKE2b-256 b8287fc888388cbea634ab85393fef91f774f00f635c51b8bd754d2e512ceaa3

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