Skip to main content

AI-Powered Python Library for Code Generation

Project description

Keeya

AI-Powered Python Library for Code Generation

Keeya is a simple Python library that uses AI to generate clean, executable Python code on-demand. Unlike traditional code completion tools, Keeya runs in your Python environment and generates production-ready code based on your requirements.

Installation

pip install keeya

Setup

No setup required! Keeya works out of the box with Google Gemini AI.

Free Tier:

  • 🚀 Gemini 1.5 Flash: 6M tokens/day (60 requests/minute)
  • Fast & Reliable: No rate limits for demo usage
  • 🎯 High Quality: Clean, production-ready code generation

Quick Start

import keeya

# Generate any Python function
code = keeya.generate("function to add two numbers")
print(code)

# Generate complex algorithms
code = keeya.generate("function to implement quicksort")
print(code)

Examples

Basic Code Generation

import keeya

# Generate any Python function
code = keeya.generate("function to add two numbers")
print(code)
# Output: def add_numbers(a, b): return a + b

# Generate data processing function
code = keeya.generate("function to calculate mean of a list")
print(code)
# Output: def calculate_mean(numbers): return sum(numbers) / len(numbers)

Data Science Operations

import keeya
import pandas as pd

# Load your data
df = pd.read_csv('data.csv')

# AI-powered data cleaning
cleaned_df = keeya.clean(df)

# AI-powered analysis
insights = keeya.analyze(df)

# AI-powered visualization
keeya.visualize(df, plot_type='scatter')

# AI-powered ML training
model = keeya.train(df, target='price')

Features

  • Simple API: Just call keeya.generate() or keeya.clean()
  • AI-Powered: Uses AI to generate code based on your data
  • Context-Aware: Understands your DataFrames and generates appropriate code
  • Google Gemini Integration: Powered by Google's advanced AI models
  • Jupyter Ready: Works seamlessly in notebooks and Colab
  • Safe Execution: Safely executes generated code and returns results
  • Clean Code Generation: Produces production-ready Python code with inline comments

Examples

Basic Functions

# Generate utility functions
code = keeya.generate("function to reverse a string")
code = keeya.generate("function to find duplicates in a list")
code = keeya.generate("function to sort a dictionary by values")

Data Science

# Data cleaning
cleaned_df = keeya.clean(df)

# Data analysis
analysis = keeya.analyze(df)

# Visualizations
keeya.visualize(df, plot_type='histogram')
keeya.visualize(df, plot_type='correlation')

# Machine learning
model = keeya.train(df, target='target_column')
predictions = model.predict(test_df)

Model Selection

Keeya uses Google Gemini by default, but you can specify different models:

# Use default Gemini 1.5 Flash (fast and reliable)
code = keeya.generate("function to calculate fibonacci")

# Use Gemini 1.5 Pro (more capable for complex tasks)
code = keeya.generate("complex machine learning pipeline", model="gemini-1.5-pro")

# Get available models
models = keeya.get_available_models()
print(models)

API Reference

keeya.generate(prompt, model=None)

Generate Python code from natural language prompt.

keeya.clean(df, model=None)

AI-powered data cleaning. Returns cleaned DataFrame.

keeya.analyze(df, model=None)

AI-powered data analysis. Returns analysis results.

keeya.visualize(df, plot_type=None, model=None)

AI-powered visualization. Creates and displays plots.

keeya.train(df, target, model=None)

AI-powered ML model training. Returns trained model.

keeya.get_available_models()

Get available models and their descriptions.

Requirements

  • Python 3.8+
  • pandas
  • requests

License

MIT License

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

keeya-0.4.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

keeya-0.4.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file keeya-0.4.0.tar.gz.

File metadata

  • Download URL: keeya-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for keeya-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7569e15e91021f591dd300d9fc31c6527a72fea03c5fe5be8e80bbef8e2662f8
MD5 40c744487cd8132c76ec1e7dcae229bd
BLAKE2b-256 9a8f950f99d29b055d2d97e626c7a8cf4fb3ae85793c1dff384ef7be59718259

See more details on using hashes here.

File details

Details for the file keeya-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: keeya-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for keeya-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f549c039368de7e9e70bc0c87e8d604cf0b6a8271824484dc4af67ce9905864a
MD5 339bb2465047976ba8678491a18b4d08
BLAKE2b-256 86b787b393195be6e295a141e28cfbd991960d4e559d84126c8ae183f23636ba

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