Skip to main content

Trend Analyzer

Problem statement

It's time consuming to understand the changes happening in competitive / audience / creative landscapes without relying on heave pre-processing and data analysis techniques.

Solution

trend-analyzer uses power of large language models to analyze trends data located to SQL database and make it available for querying with a simple chat bot interface.

Deliverable (implementation)

trend-analyzer is implemented as a:

  • library - Use it in your projects with a help of TrendsAnalyzer class.
  • CLI tool - trend-analyzer tool is available to be used in the terminal.
  • HTTP endpoint - trend-analyzer can be easily exposed as HTTP endpoint.
  • Langchain tool - integrated trend-analyzer into your Langchain applications.

Deployment

Prerequisites

  • Python 3.11+

  • A GCP project with billing account attached

  • Service account created and service account key downloaded in order to write data to BigQuery.

    • Once you downloaded service account key export it as an environmental variable

      export GOOGLE_APPLICATION_CREDENTIALS=path/to/service_account.json
      
    • If authenticating via service account is not possible you can authenticate with the following command:

      gcloud auth application-default login
      
  • API key to access to access Google Gemini.
    • Once you created API key export it as an environmental variable

      export GOOGLE_API_KEY=<YOUR_API_KEY_HERE>
      

Installation

Install trend-analyzer with pip install trend-analyzer command.

Usage

This section is focused on using trend-analyzer as a CLI tool. Check library, http endpoint, langchain tool sections to learn more.

Once trend-analyzer is installed you can call it:

trend-analyzer 'YOUR_QUESTION_HERE' \
  --llm gemini \
  --llm.model=gemini-1.5-flash \
  --db-uri=<DATABASE_URI> \
  --output-type csv \
  --output-destination sample_results

where:

  • YOUR_QUESTION_HERE - trends related question you want to ask.
  • --llm gemini - type of large language model (currently only Google Gemini is supported).
  • --llm.model=gemini-1.5-flash - any parameters to initialize selected LLM.
  • --db-uri=<DATABASE_URI> - location of database with trends data.
  • --output-type csv - type of output.
  • --output-destination sample_results - name of output table or file.

Disclaimer

This is not an officially supported Google product.

Metadata

Release files for trend-analyzer 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trend-analyzer 1.1.0
File Size Uploaded Provenance Actions
trend-analyzer-1.1.0.tar.gz 11.1 kB Without provenance Details for trend-analyzer-1.1.0.tar.gz

Release files / trend-analyzer-1.1.0.tar.gz

Download URL trend-analyzer-1.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b6719da43cd57f9d94c716fc1354701f14d88249ab32936c9a7cad972b7d047b
BLAKE2b-256 checksum
How to use checksums
b72fd657bc2097b4d28c62edbc1888ee82730c53833b08cae69538a262c38a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Security for trend-analyzer 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page