Skip to main content

A simple AI toolkit for text processing using OpenAI and Gemini APIs

Project description

AIWand 🪄

A simple and elegant Python package for AI-powered text processing using OpenAI and Google Gemini APIs.

PyPI version Python versions License

✨ Features

  • Smart Provider Selection - Automatically uses OpenAI or Gemini based on available keys
  • Text Summarization - Create concise, detailed, or bullet-point summaries
  • AI Chat - Have conversations with context history
  • Text Generation - Generate content from prompts
  • CLI Interface - Use from command line
  • Virtual Environment Ready - Easy setup with automated scripts

🚀 Quick Start

Installation

# Using pip
pip install aiwand

# With virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
pip install aiwand

Basic Usage

import aiwand

# Set your API key
aiwand.configure_api_key("your-api-key", "openai")  # or "gemini"

# Summarize text
summary = aiwand.summarize("Your long text here...")

# Chat with AI  
response = aiwand.chat("What is machine learning?")

# Generate text
story = aiwand.generate_text("Write a poem about coding")

CLI Usage

# Direct prompts (easiest way!)
aiwand "Ten fun names for a pet pelican"
aiwand "Explain quantum computing in simple terms" 
aiwand "Write a haiku about programming"

# Or use specific commands
aiwand summarize "Your text here" --style bullet-points
aiwand chat "What is machine learning?"
aiwand generate "Write a story about AI"

🔧 Configuration

Set your API keys via environment variables:

# Option 1: OpenAI
export OPENAI_API_KEY="your-openai-key"

# Option 2: Gemini  
export GEMINI_API_KEY="your-gemini-key"

# Option 3: Both (set preference)
export OPENAI_API_KEY="your-openai-key"
export GEMINI_API_KEY="your-gemini-key"
export AI_DEFAULT_PROVIDER="gemini"  # or "openai"

Or use a .env file:

OPENAI_API_KEY=your-openai-key
GEMINI_API_KEY=your-gemini-key
AI_DEFAULT_PROVIDER=openai

📚 Documentation

🤝 Connect

📝 License

MIT License - see LICENSE file for details.


Made with ❤️ by Aman Kumar

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

aiwand-0.3.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

aiwand-0.3.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file aiwand-0.3.0.tar.gz.

File metadata

  • Download URL: aiwand-0.3.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for aiwand-0.3.0.tar.gz
Algorithm Hash digest
SHA256 28efb85e015a332b29cbe6514f554fb1b949aafd88479211086ebe4fa9ceb4f0
MD5 c8ca1cef450d3f2f12fc7714e326be3c
BLAKE2b-256 b6f3ca72011d4cf912508424a234f664948600ea464039d7dcb5e358b03200f8

See more details on using hashes here.

File details

Details for the file aiwand-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: aiwand-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for aiwand-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf00c26a7f4481dbea02f75c2e58c2f06f3853216139b11b52e08aaaeb067388
MD5 70bc81b9a8e2d9b7a7e841c514d9df4f
BLAKE2b-256 c5827779452754b326cffae67735888c4170fe32d1a97efeb0f129a501146606

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