AI-powered developer & language toolkit — grammar, translation, quizzes, bug reports, PR reviews, trip planning, and more.
Project description
asimtool
AI-powered developer & language toolkit — a standalone Python package extracted from AsimAI.
Wraps g4f providers for grammar checking, translation, quizzes, bug-report formatting, PR reviews, trip planning, solar energy optimisation, and much more.
Installation
pip install asimtool
With optional extras:
pip install asimtool[all] # includes all optional extras
pip install asimtool[pdf] # PDF text extraction only
pip install asimtool[ocr] # PDF OCR for scanned documents
pip install asimtool[language] # auto-language detection for replies
pip install asimtool[docx] # robust DOCX extraction
Quick Start
import asimtool
# Grammar check
corrected = asimtool.check_grammar("me go store yesterday")
print(corrected)
# Translation
translated = asimtool.translate("Hello world", "German")
print(translated)
# Vocabulary quiz
quiz = asimtool.generate_quiz("German", "A2", "English")
print(f"Word: {quiz['word']}, Options: {quiz['options']}")
Features
🔤 Language Learning
| Function | Description |
|---|---|
check_grammar(text, tone) |
Grammar correction (formal/informal) |
translate(text, target_language) |
Full text translation |
translate_word(word, source, target) |
Single word with explanation |
get_news(country, language, level) |
News headlines translated by CEFR level |
generate_quiz(language, level, options_lang) |
Vocabulary MCQ with 4 options |
build_vocabulary(words, word_lang, meaning_lang) |
Word meanings + example sentences |
generate_listening(language, level, num_q) |
Passage + comprehension questions |
🛠️ Developer Tools
| Function | Description |
|---|---|
improve_bug_description(text) |
Structure a bug report with template |
generate_test_cases(requirements, risk, code) |
Markdown table of test cases |
review_pull_request(pr_text) |
AI code review (understands diffs) |
validate_specsheet(text) |
Spec validation from tester POV |
validate_requirements(req, risk, commit) |
Requirements vs code analysis |
ask_about_code(question, files) |
Q&A about a codebase |
generate_standup(notes, commit) |
Notes → spoken standup summary |
🎬 Entertainment
| Function | Description |
|---|---|
recommend_movie(media_type, genre) |
Movie/series recommendations by IMDB |
plan_trip(location, start, end) |
Detailed travel itinerary |
find_venue(zip1, zip2, country1, country2) |
Meeting venue at midpoint |
generate_lyrics(title, genre, mood, lang) |
Song lyrics generation |
optimize_solar(postal_code, country, date) |
Solar energy optimal hours (free APIs) |
🔧 Utility Tools
| Function | Description |
|---|---|
extract_text(file_path) |
PDF, DOCX, or image OCR (Groq vision) |
transcribe(audio_path, api_key, lang) |
Audio → text (Groq Whisper) |
Chat() |
Stateful conversational AI |
suggest_reply(messages, tone) |
Professional reply suggestion |
image_to_prompt(image_path) |
Image → AI generation prompt |
tailor_cv(cv_text, job_description) |
Tailor CV to job description |
Advanced Usage
Custom Providers
from asimtool.core.provider import Provider, call_ai
# Use specific g4f providers
provider = Provider(["OperaAria", "AnyProvider"])
corrected = asimtool.check_grammar("bad text", provider=provider)
Direct AI Calls
from asimtool import call_ai, call_ai_json
# Plain text response
answer = call_ai("What is Python?", model="gpt-4o")
# Parsed JSON response
data = call_ai_json('Return JSON: {"name": "test"}', model="grok_3")
Chat with History
from asimtool import Chat
chat = Chat(assistant_name="MyBot")
print(chat.send("Hello!"))
print(chat.send("Tell me a joke"))
print(chat.send("Now in Dutch", response_language="Dutch"))
chat.clear()
Solar Optimizer (No AI, No API Key)
from asimtool import optimize_solar
result = optimize_solar("1011", country="NL")
print(f"Location: {result['location']}")
print(f"Weather: {result['weather']['description']}")
for h in result['optimal_hours'][:3]:
print(f" {h['time']} — {h['efficiency']}% efficiency")
CV Tailoring
from asimtool import tailor_cv
# From text
result = tailor_cv(cv_text="...", job_description="...")
# From file
result = tailor_cv(cv_file="my_cv.pdf", job_description="...")
print(result)
Environment Variables
Some features need environment variables:
| Variable | Used By | Required? |
|---|---|---|
GROQ_API_KEY |
transcribe(), extract_text() |
Yes, for transcription and OCR |
I2P_API_URL |
image_to_prompt() |
Yes, for image analysis |
I2P_API_ORIGIN |
image_to_prompt() |
Yes, for image analysis |
I2P_API_REFERER |
image_to_prompt() |
Yes, for image analysis |
Dependencies
- g4f — AI provider abstraction
- requests — HTTP client (solar, transcription, image-to-prompt)
- feedparser — Google News RSS parsing
- pypdf (optional) — PDF text extraction
- pymupdf (optional) — PDF OCR rendering for scanned documents
- Pillow (optional) — Image processing for OCR
- python-docx (optional) — Robust DOCX text extraction
- langdetect (optional) — Auto language detection for replies and grammar
License
MIT — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asimtool-0.2.0.tar.gz.
File metadata
- Download URL: asimtool-0.2.0.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d51fa8453b0278fb0520735a27d0f842a1f3f4b3655ab7fb51514a797101294
|
|
| MD5 |
84b60ecfde5adb7eb4324dfb7f38a226
|
|
| BLAKE2b-256 |
9cdf5748f1a41c9c8a163af1140e39bd3aec607a97a327064a7c4fd42e453f54
|
File details
Details for the file asimtool-0.2.0-py3-none-any.whl.
File metadata
- Download URL: asimtool-0.2.0-py3-none-any.whl
- Upload date:
- Size: 48.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b298869c9c398be9b613a27c3863be13e73150b2308349dce912086d1a73e489
|
|
| MD5 |
573e0beb9d6ff333952dc63a19237408
|
|
| BLAKE2b-256 |
240c08ced3fcfe3725948bf2d35617bcadbb77c8c5db6d6780d4a31be8537374
|