Skip to main content

Python utilities for TrendsAGI ad-platform execution helpers and scaffolding.

Project description

TrendsAGI Python Utilities

PyPI Version License: MIT Python Versions

About

trendsagi provides:

  • ad-platform execution helpers for Google, Meta, TikTok, and LinkedIn
  • deterministic idempotency-key generation
  • scaffold commands for Docker and Terraform templates

This package does not include a TrendsAGI HTTP API client.

Installation

pip install trendsagi

Quick Start

from trendsagi import AIInsight
from trendsagi.integrations import GoogleAdsExecutor

insight = AIInsight.model_validate(
    {
        "trend_id": 123,
        "key_themes": ["running shoes", "marathon prep"],
        "audience_injection": {
            "interest_keywords": ["running shoes"],
            "negative_keywords": ["cheap"],
            "demographics": {"regions": ["US"]},
        },
    }
)

google = GoogleAdsExecutor(
    {
        "access_token": "YOUR_ACCESS_TOKEN",
        "developer_token": "YOUR_DEVELOPER_TOKEN",
    }
)

result = google.apply_targeting(
    insight,
    customer_id="1234567890",
    campaign_id="9876543210",
    dry_run=True,
)

print(result.idempotency_key)

CLI Scaffolder

trendsagi scaffold --type docker --output-dir ./runner
trendsagi scaffold --type terraform --output-dir ./infra

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

trendsagi-0.8.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

trendsagi-0.8.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file trendsagi-0.8.0.tar.gz.

File metadata

  • Download URL: trendsagi-0.8.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for trendsagi-0.8.0.tar.gz
Algorithm Hash digest
SHA256 ac14f769e879e4aaee3023c2a0e9cb173a9e846989b2f60e7f8f7caa42955692
MD5 5f554ec91dd98457ff999673f293e586
BLAKE2b-256 07ac377cc647c291868e7f47c5dea8b28bebab3361c50dd0e0b7cd202c0fef8d

See more details on using hashes here.

File details

Details for the file trendsagi-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: trendsagi-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for trendsagi-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa0e3f81e1e9647b5c62a89a3da55e71d8a70f2991562db5f74ca19465b8d075
MD5 374f2423b24f04b006d194a57e6dac75
BLAKE2b-256 8441edbe5d8f34a84f95d503bd16b68c37e265aa14416b2bc8167f88a519d6c1

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