Skip to main content

A FastAPI service for campaign generation, competitor research, and audio content.

Project description

Campaign Generator

Campaign Generator is a Python FastAPI application for creating content based on competitor research and user-generated audio. It provides a web interface for generating questions, summarizing text, transcribing audio, and fetching the latest news. The app uses local LLMs via Ollama and supports both Mac and Linux environments.

Features

  • Audio Transcription: Upload or record audio and transcribe it using Whisper (macOS: whisper-mps, Linux: faster-whisper).
  • Text Summarization: Summarize any text using local LLMs (Gemma 3 1B, GPT-OSS 20B) via Ollama.
  • Question Generation: Generate questions from text using LLMs.
  • Latest News: Fetch recent news on any topic.
  • Modern Web UI: Beautiful interface built with Tailwind CSS.
  • OS-aware: Automatically selects the best transcription backend and Ollama API endpoint for your platform.

Prerequisites

  • Python 3.10+
  • Homebrew (for macOS)
  • pipx
  • ffmpeg (for audio conversion)
  • Ollama installed and running with required models (gemma3:1b, gpt-oss:20b)

Install system dependencies (macOS)

brew install pipx
brew install ffmpeg
pipx ensurepath
source ~/.zshrc  # or restart your terminal

Install with pipx

pipx install campaign-generator

Usage

Set your ClickUp API key and team ID in your environment variables:

export CLICKUP_API_KEY=your_clickup_api_key
export CLICKUP_TEAM_ID=your_clickup_team_id

env | grep CLICKUP # to verify they are set

When you start the app for the first time, the following folders will be created in the directory you run the command from:

  • research output/: Stores research results generated from RSS feeds.
  • question output/: Stores generated questions.
  • audio output/: Stores uploaded audio files.
  • transcripts output/: Stores transcriptions of audio files.
  • content generation/: Stores generated content.

Because of this behavior, it's recommended to run the app from a dedicated project directory.

Start the app with:

campaign-generator

By default, the API will run on http://localhost:8080.

Open your browser and navigate to /frontend to use the web interface:

http://localhost:8080/frontend
http://localhost:8080/frontend/chat # for RAG chat interface
http://localhost:8080/docs # for API docs
http://localhost:8080/graph-viewer # for visualization of the RAG graph

How It Works

  • Transcription: Uses whisper-mps on macOS and faster-whisper on Linux for audio transcription.
  • LLM Integration: Connects to Ollama API for text summarization and question generation. The API endpoint is chosen automatically based on your OS.
  • Templates: The web UI is served from templates/home.html.

Development

  • All source code is in the root and routers/ directory.
  • The entrypoint is main.py, which runs the FastAPI app.
  • You can also run with Docker or Docker Compose (see Dockerfile and docker-compose.yml).

Build and Publish to PyPI

  1. Upgrade build and twine:
    python -m pip install --upgrade build twine
    
  2. Build your package:
    python -m build
    
  3. (Optional) Check your package:
    python -m twine check dist/*
    
  4. Upload to PyPI:
    python -m twine upload dist/*
    

After publishing, you (and others) can install globally with pipx:

pipx install campaign-generator

Troubleshooting

  • If you see errors about missing templates, ensure you installed with pipx after running pipx ensurepath and that your terminal session is up to date.
  • Make sure Ollama is running and the required models are pulled.
  • If you see errors about ffmpeg, make sure it is installed and available in your PATH.

License

MIT

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

campaign_generator-0.1.7.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

campaign_generator-0.1.7-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file campaign_generator-0.1.7.tar.gz.

File metadata

  • Download URL: campaign_generator-0.1.7.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for campaign_generator-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a343af5fadabf086b4bf147278d19108b6c945f470fc1daafd388fa9dbca88aa
MD5 c1eff5a8b46826e4e389e5f26cde35b5
BLAKE2b-256 a64967e49f68c791cf2702ae8efeca10b01a76d0ecadb5effcacc9f1f3dca388

See more details on using hashes here.

File details

Details for the file campaign_generator-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for campaign_generator-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 533798241158dfcd0b3795f45dc3e4dbd88656e473d5a067107e5189b06cf8ab
MD5 1c79614b90e13c55cac4d7759817db72
BLAKE2b-256 faa700d4ac1f7e3a58b542b70e26263a8086d9d7759cbed9a91b4a7c29616ceb

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