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.1.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.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atheon_codex-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 77790eab5694c36843a4f68e0950db098fe84dfd6a4ea2753b247033ebb1a048
MD5 baf63b321f59ee03e21caf8cb4ee5aa3
BLAKE2b-256 bd9789bd6eed07eaeae685900387db349711d01e206caa195e6ba7756cb648ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for atheon_codex-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8fcb959491eed39be85ea02f21af8ec8a9cc5bac7c081711916171ebac91409
MD5 5ed3f53ad1157d9bfe086824c81c8e6f
BLAKE2b-256 850bbe21bfc0ae7461603a9561348dd1ff1421f338f2980a162003f06f1bb89a

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